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 |
|---|---|---|---|---|---|---|
f48929e3-8341-42f5-8859-e1ad5eb76431 | meetanupam/Leetcode-Problem-Solutions | 826.Most Profit Assigning Work.cpp | class Solution {
public:
int maxProfitAssignment(vector<int>& difficulty, vector<int>& profit, vector<int>& worker) {
int ans = 0;
vector<pair<int, int>> jobs;
for(int i = 0; i < difficulty.size(); i++) {
jobs.push_back({difficulty[i], profit[i]});
}
sort... | ALGO | 0.999948 | 5.724012 |
b10ab7c9-b0e3-4cac-93dc-743432c2fab5 | ck89119/Algorithm | Codeforces/r303/div2D.cpp | #include <bits/stdc++.h>
using namespace std;
#define dump(x) cerr << __LINE__ << " : "<< #x << " = " << (x) << endl
#define CLR(a, x) memset(a, x, sizeof(a)) //0:0, -1:-1, INF:0x3f, -INF:0x80
#define MP(A, B) make_pair(A, B)
#define PB(A) push_back(A)
#define lson l, m, rt << 1
#define rson m + 1, r, rt << 1 | 1
#... | ALGO | 0.999923 | 4.423896 |
0f8f5b45-b926-4fa6-8ccd-90e9921c111b | Nayumi1910/Algoritmia-y-estructura-de-Datos | L2 - TADs EX/EX1 2023-2/P1-2023-2/funcionesPila.cpp | /*
* File: funcionesPila.cpp
* Author: ANA RONCAL
* Created on 7 de abril de 2024, 03:41 PM
*/
#include <iostream>
#include <iomanip>
#include "Pila.h"
#include "funcionesLista.h"
#include "funcionesPila.h"
using namespace std;
/*constructor de Pila*/
void construir(struct Pila & pila){
construir(pila.li... | TOOL | 0.909388 | 4.67022 |
ee85d3c3-a5e2-4faf-8b3d-c5ea5ae4e920 | mohitiitb/Competitive_Programming | grundy_numbers/g3.cpp | // By Mohit Gupta
#include <bits/stdc++.h>
using namespace std;
#define printint(v) copy(begin(v), end(v), ostream_iterator<int>(cout," "))
#define printintv(s,e) copy(s,e, ostream_iterator<int>(cout," "))
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = ... | ALGO | 0.999998 | 3.85429 |
a9bee39d-50dc-4b35-b91e-894e41842d46 | yuchuangu85/Android-framework-code | av/media/libstagefright/codecs/amrnb/common/src/negate.cpp | /*
Pathname: ./gsm-amr/c/src/negate.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the negate function. Sync'ed up with
the current template and fixed tabs.
Description: Removed conditional code that updates WMOP... | TOOL | 0.929474 | 6.022855 |
6d998e51-5bbf-4e0f-bec1-294959ded2fb | TheJoseph-Dev/Competitive-Programming | CSES/Geometry/PolygonLatticePoints.cpp | #include <stdio.h>
#include <math.h>
#include <vector>
#include <algorithm>
#define ll long long
template<typename T = ll>
struct Vec3 {
T x, y, z;
Vec3(T x = 0, T y = 0, T z = 0): x(x), y(y), z(z) {};
double Length() const {
return sqrt(x*x + y*y + z*z);
}
static double SqrDistance(con... | ALGO | 0.99987 | 5.221807 |
c2548a3f-1385-4552-95b2-30bd9802b8fe | Matovic/edge-detection-filter | src/main.cpp | /**
* Course: Parallel Programming (FIIT - WS 2021/2022)
* Purpose:
*
* @file main.cpp
* @author Erik Matovic
* @version 30.11.2021
*/
#include <iostream>
#include <vector>
#include <filesystem>
#include <string>
#include <sstream>
#include <tuple>
#include <mpi.h>
#include <omp.h>
#include <opencv2/opencv.hpp>
#inclu... | TOOL | 0.961363 | 5.326044 |
edb50010-8d6f-4552-865e-ed358e585418 | vucongtuanduong/dsa-codeptit | submit/algo-design/sort-search/dsa06010/dsa06010.cpp | #include <iostream>
#include <algorithm>
#include <map>
using namespace std;
void testCase();
int main() {
// Write your code here
int t;
cin >> t;
while (t--) {
testCase();
cout << endl;
}
return 0;
}
void testCase() {
int n;
cin >> n;
map<int,int> mp;
for (int i... | ALGO | 0.999815 | 4.918405 |
6391bfac-3cfe-4ebd-ba46-9c2260bf8189 | Reemaa828/cpp_exercises | codewars_zero_level_one/video_6.cpp | #include <iostream>
#include <algorithm>
using namespace std;
string slice_string(string word){
word.erase(word.begin());
word.erase(word.end()-1);
return word;
}
string repeat(string word,int num){
string s="";
for(int i=0;i<num;i++){
s+=word;
}
return s;
}
string remove_spaces... | ALGO | 0.997903 | 3.683599 |
dd6c13b5-ecd5-4646-8a6e-cd0068e2b21c | iSuneast/uva-codes-for-acm-icpc | UVa 100 - 9999/925 - No more prerequisites, please!_0805_graph theory_dag.cpp | /*
925 - No more prerequisites, please!
graph theory...
DAG...
ΪʲôǴݱհ?
ĿֻҪǰ
Կֱdfsǰǰ
(ǰ,ǵǰǰǰ...)
*/
#include<iostream>
#include<algorithm>
#define MAXN 123
using namespace std;
bool g[MAXN][MAXN],flag[MAXN];
struct DATA
{
char s[23];
bool operator<(const DATA &t)const
{
return strcmp(s,t.s)<0;
}
}data[MAXN],buf... | ALGO | 0.99995 | 3.688866 |
7c8a9738-6217-48ff-a55d-394c1a910e17 | sandysihotang/CPP | sandy/Code/TLX/Old Toki/Bab 3/3C - Teori Bilangan/3.cpp | #include <bits/stdc++.h>
using namespace std;
int gcdr (int a, int b)
{
if(a==0) return b;
return gcdr (b%a,a);
}
int main()
{
int a;
long long int x,y;
scanf("%d",&a);
for(int i=0;i<a;i++)
{
scanf("%lld %lld",&x,&y);
printf("%d\n",gcdr(x,y));
}
return 0;
}
| ALGO | 0.999678 | 3.592815 |
8c708952-c24c-4a1f-ad42-b76b1e3f73c2 | diegom-21/lab9-10movilesmultiplataforma | 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 |
0bd96cf7-30d5-4970-b2f2-9387f910eb48 | Aditya61101/DSA | 12.BST/5.delete_a_node/main.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
Node *left,*right;
int data;
Node(int x){
data=x;
left=right=NULL;
}
};
void print(Node *root){
if(root==NULL){
return;
}
cout<<root->data<<" ";
print(root->left);
print(root->right);
}
Node* findLast... | ALGO | 0.999997 | 4.646668 |
d53df6d2-73c7-4736-b7cd-d5ea2c6e2fc7 | lbvx/CP-Problems | 2023.1-Matematica/lista3/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll powLL(ll base, ll exp)
{
ll result = 1;
for (;;)
{
if (exp & 1)
result *= base;
exp >>= 1;
if (!exp)
break;
base *= base;
}
return result;
}
int main()
{
ll x;
w... | ALGO | 0.998693 | 3.821239 |
79ef5d84-dd02-4cbe-91a8-50d8863d302d | kghandour/3D-Scanning-and-Motion-Capture-Exercises | Exercise-4/gaussian.cpp | #include "utils/io.h"
#include "utils/points.h"
#include "ceres/ceres.h"
#include <math.h>
struct GaussianCostFunction
{
GaussianCostFunction(const Point2D& point_)
: point(point_)
{
}
template<typename T>
bool operator()(const T* const mu, const T* const sigma, T* residual) const
{
// TODO: Implement the ... | ALGO | 0.998007 | 6.978109 |
cddfdcb2-4091-4b80-9734-3bbb5859a41c | jethost007/QTUMR-TEA | src/policy/fees.cpp | #include "policy/fees.h"
#include "policy/policy.h"
#include "amount.h"
#include "primitives/transaction.h"
#include "random.h"
#include "streams.h"
#include "txmempool.h"
#include "util.h"
void TxConfirmStats::Initialize(std::vector<double>& defaultBuckets,
unsigned int maxConfirms, d... | ALGO | 0.951967 | 6.154011 |
b89366a1-ec78-4131-b342-6c871fb35482 | Vallahham/Computer-Graphics-Animation2 | Graphics/nanogui/ext/eigen/doc/examples/DenseBase_middleCols_int.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl;
return 0;
}
| ALGO | 0.967476 | 3.133398 |
2e973957-847d-4416-bc1e-207fa6ee446f | raincross7/code-similarity | codes/train_code/problem324/problem324_173.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T... | ALGO | 0.999955 | 4.373277 |
d782713b-e4db-4a6b-a756-fe9b4d1af65c | abhisarxverma/DSA-by-heart | Arrays/03-remove_duplicates_sorted_array/remove_duplicates_sorted_array.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_set>
using namespace std;
/*
Brute Force Approach
---------------------
INTUITION - use a set to store the seen numbers and if the number is not seen then add that into vector
TIME COMPLEXITY - O(N)
SPACE COMPLEXITY - O(2N) - set and result... | ALGO | 0.999564 | 6.218257 |
146b3d7c-88dd-4cd5-99be-f736e50155cc | vekariyahimani/ecom1 | 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.998859 | 6.785645 |
1fcd1c44-dea0-43c7-9c95-c533af365476 | Vishnuteja-Surla/DAA-Lab | La1-3.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
void findPair(int nums[], int n, int target)
{
unordered_map<int, int> map;
for (int i = 0; i < n; i++)
{
if (map.find(target - nums[i]) != map.end())
... | ALGO | 0.99981 | 3.14094 |
020df71b-c78a-4eaf-a3e2-a59f8341034f | apache/ignite | modules/platforms/cpp/thin-client/src/impl/utility.cpp | #include <cctype>
#include <algorithm>
#include <sstream>
#include <ignite/binary/binary.h>
#include <ignite/common/utils.h>
#include "impl/utility.h"
namespace ignite
{
namespace impl
{
namespace thin
{
namespace utility
{
bool ParseSingleAddress(cons... | TOOL | 0.980315 | 6.472414 |
a056b330-9348-4c43-9be6-7e99573b238e | tanggeTom/ue5_2_1_mirror | Engine/Plugins/Experimental/NNE/Source/ThirdParty/ORT_4_1/Private/Windows/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorCumSum.cpp | #include "precomp.h"
namespace Dml
{
class DmlOperatorCumSum : public DmlOperator
{
public:
using Self = DmlOperatorCumSum;
DmlOperatorCumSum(const MLOperatorKernelCreationContext& kernelCreationContext)
: DmlOperator(kernelCreationContext)
{
ML_CHECK_VALID_ARGUMENT(kernelCreationContext.Ge... | TOOL | 0.865213 | 7.600773 |
ebadcba2-b4ca-4f2e-8169-a6b752fa1803 | anonimo-iv/scilammps | src/EXTRA-PAIR/pair_e3b.cpp | #include "pair_e3b.h"
#include "atom.h"
#include "citeme.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "neigh_list.h"
#include "neighbor.h"
#include "update.h"
#include <cmath>
#include <cstring>
//these are defined here to avoid confusing hardcoded indic... | ALGO | 0.999028 | 5.814597 |
6f33dca6-9506-4e47-b89f-38a569d28ee2 | t3nsor/SPOJ | double.cpp | // 2009-01-16
#include <iostream>
#include <deque>
using namespace std;
bool better(deque<int> a,deque<int> b)
{
while (a.size()&&a.front()==0) a.pop_front();
while (b.size()&&b.front()==0) b.pop_front();
if (!b.size()) return true;
return a.size()<b.size()||a.size()==b.size()&&a<b;
}
int main()
{
int T,B,i,rem,j,... | ALGO | 0.999979 | 3.575177 |
df5ce748-27f3-4743-ab8a-57025b07e6d1 | par4m/dsa | LinkedList/Questions/BubbleSort.cpp | #include <bits/stdc++.h>
#include <vector>
using namespace std;
class Node {
public:
int data;
Node *next;
public:
Node(int data, Node *next = nullptr) {
this->data = data;
this->next = next;
}
};
void printData(Node *head) {
int ctr = 0;
while (head != nullptr) {
cout << head->data << "->";
... | ALGO | 0.999636 | 5.105221 |
7e201d3a-6ff3-477d-90f5-aefb7ba29b07 | Ankit8607/GeeksForGeeks-must-do-problems | greedy/Geek collects the balls.cpp | // https://practice.geeksforgeeks.org/problems/geek-collects-the-balls5515/1
class Solution{
public:
int maxBalls(int n, int m, vector<int> a, vector<int> b){
// code here
// sum_a - max balls with current position on road a at index around i
// sum_b - max balls with current posit... | ALGO | 0.999966 | 5.405268 |
0aee527b-b0f6-448d-beaf-527156d32b3e | ameyjain99/CodingNinja | Number Theory-3/GCD_Extreme.cpp | /* Given the value of N, you will have to find the value of G. The meaning of G is given in the following code
G=0;
for(i = 1 ; i < N ; i++)
for(j = i+1 ; j <= N ; j++)
G+=gcd(i,j);
Here gcd() is a function that finds the greatest common divisor of the two input numbers.
Input
The input file contains at most... | ALGO | 0.999774 | 4.668656 |
92f8431d-91a8-42c3-bb53-fb3f4c5ef34c | zenyxqord/zenyx | src/chain.cpp | #include <chain.h>
/**
* CChain implementation
*/
void CChain::SetTip(CBlockIndex *pindex) {
if (pindex == nullptr) {
vChain.clear();
return;
}
vChain.resize(pindex->nHeight + 1);
while (pindex && vChain[pindex->nHeight] != pindex) {
vChain[pindex->nHeight] = pindex;
p... | ALGO | 0.999544 | 6.972731 |
e3ee199b-f92c-4deb-9683-9b1bc41081c5 | shivamacs/leetCode | algorithms/cpp/Problems 1201-1300/_1240_TilingARectangleWithTheFewestSquares.cpp | /* Source - https://leetcode.com/problems/tiling-a-rectangle-with-the-fewest-squares/
Author - Shivam Arora
*/
#include <bits/stdc++.h>
using namespace std;
int tilingRectangle(int n, int m) {
if((n == 11 && m == 13) || (m == 11 && n == 13))
return 6;
int dp[n + 1][m + 1];
memset(dp, 0, siz... | ALGO | 0.999961 | 5.742784 |
f0187725-aca1-40b9-b165-66fe39db429e | MoonGrt/Wheel_Robot | Software/Firmware/Freertos/Tests/test_trap_traj.cpp |
#include <doctest.h>
#include <limits.h>
#include <cmath>
#include <iostream>
#include <random>
#include "MotorControl/utils.hpp"
// TODO: This is currently a copy-paste of the real code due to non-trivial
// include dependencies. Should include real code.
class TrapezoidalTrajectory {
public:
struct Step_t {
... | TEST | 0.876611 | 7.821546 |
5d786eef-5402-4b36-a0c7-bb91337f59c2 | lephe/memory-light-isa | subject/simu.src/processor.cpp | #include "processor.h"
using namespace std;
Processor::Processor(Memory* m): m(m) {
pc=0;
sp=0;
a1=0;
a2=0;
for (int i=0; i<7; i++)
r[i]=0;
}
Processor::~Processor()
{}
void Processor::von_Neuman_step(bool debug) {
// numbers read from the binary code
int opcode=0;
int regnum1=0;
int regnum2=0;
int shift... | ALGO | 0.918906 | 4.249232 |
d89597ed-67d6-440d-b4b6-385809e08bc8 | fish47/leetcode | src/067_add-binary.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <string>
class Solution
{
public:
std::string addBinary(std::string a, std::string b)
{
std::string ret;
bool hasCarry = false;
int len1 = a.size();
int len2 = b.size();
... | ALGO | 0.999939 | 6.123242 |
f722bd51-e5d9-41e1-ac58-de7946b0d6c1 | AbdElRahmanOsama182/LeetCode-Problems | 0896-monotonic-array/0896-monotonic-array.cpp | class Solution {
public:
bool isMonotonic(vector<int>& nums) {
return is_sorted(nums.begin(), nums.end()) || is_sorted(nums.rbegin(), nums.rend());
}
}; | ALGO | 0.999957 | 6.060723 |
cee011f1-9198-4387-80db-cec9ce16c8a9 | boring-ing/GAMES101_Graphics_Practice | MathLib/eigen-3.4.0/doc/examples/TutorialLinAlgComputeTwice.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A, b;
LLT<Matrix2f> llt;
A << 2, -1, -1, 3;
b << 1, 2, 3, 1;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the right hand side b:\n" << b << endl;
cout << "Computing LLT... | ALGO | 0.999942 | 3.145425 |
e863a6c0-615f-4bbc-bfba-bca14c21df37 | samratalamshanto/LeetCode | 1512-number-of-good-pairs/1512-number-of-good-pairs.cpp | class Solution {
public:
int numIdenticalPairs(vector<int>& nums) {
int sum=0;
for(int i=0;i<nums.size();i++){
for(int j=nums.size()-1;j>=0;j--){
if(i<j and i!=j and nums[i]==nums[j]){
//i<j, i!=j, nums[i]= nums[j]
sum+=1;
}
... | ALGO | 0.999979 | 5.78196 |
974c1115-8af9-4487-8053-0451d1180ceb | Malcom-Nubbins/DX11-Engine | DirectX 11 Engine/Core/Handlers/System Handlers/MathsHandler.cpp | #include "MathsHandler.h"
MathsHandler::MathsHandler()
{
}
MathsHandler::~MathsHandler()
{
}
XMFLOAT2 MathsHandler::Add(const XMFLOAT2& a, const XMFLOAT2& b)
{
XMFLOAT2 result = XMFLOAT2(0.0f, 0.0f);
XMStoreFloat2(&result, XMVectorAdd(XMLoadFloat2(&a), XMLoadFloat2(&b)));
return result;
}
XMFLOAT3 MathsHandler:... | TOOL | 0.933415 | 6.552687 |
98e7a00f-224e-48e2-b9a4-f6efa1d1f5dd | BuschMath/Ch11_Example | Ch11_Example/Ch11_Working_w_2D_Arrays_Example.cpp | #include <iostream>
using namespace std;
const int numRows = 3;
const int numCols = 4;
typedef double Array2D[numRows][numCols];
void RowSum(Array2D r_array, double* arrayRowSum);
void ColSum(Array2D c_array, double* arrayColSum);
int main()
{
double i_array[numRows][numCols];
for (int i = 0; i < numRows; i++)
... | ALGO | 0.999044 | 4.36228 |
31322840-b9fa-4aab-86b1-8267568516fe | raincross7/code-similarity | codes/train_code/problem319/problem319_379.cpp | // include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <algorithm>
#include <math.h>
using namespace std;
// func
// ------------------------------------------------
int CalcSumOfDigit(int n); // 各桁の和を計算する。
int getDigit(int n); // 数字の桁数を取得する。
string upper(stri... | ALGO | 0.999626 | 4.197319 |
bed080ba-663d-4b6c-afd2-d23986f02c85 | cryptobuks1/herbsters | src/chainparams.cpp | #include "chainparams.h"
#include "consensus/merkle.h"
#include "tinyformat.h"
#include "util.h"
#include "utilstrencodings.h"
#include <assert.h>
#include "chainparamsseeds.h"
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nB... | CONFIG | 0.970347 | 6.219556 |
7f90f617-d629-4482-bdb8-1a91c960ad0b | ir-rafio/iut-algorithms-lab-1a-summer-23-24 | Lab 3/Task B/submission/220041133_lab3_taskB(1).cpp | #include <iostream>
#include <vector>
using namespace std;
void dfs(int node, const vector<vector<int> >& graph, vector<bool>& visited, int& count) {
visited[node] = true;
count++;
for (int neighbor : graph[node]) {
if (!visited[neighbor]) {
dfs(neighbor, graph, visited, count);
... | ALGO | 0.999806 | 4.962634 |
e142d158-2ef6-4e62-822b-e41d19183d73 | mc-cat-tty/llvm-17.0.6-compilers | mlir/lib/Analysis/Presburger/Matrix.cpp | #include "mlir/Analysis/Presburger/Matrix.h"
#include "mlir/Analysis/Presburger/Utils.h"
#include "llvm/Support/MathExtras.h"
using namespace mlir;
using namespace presburger;
Matrix::Matrix(unsigned rows, unsigned columns, unsigned reservedRows,
unsigned reservedColumns)
: nRows(rows), nColumns(co... | TOOL | 0.976639 | 4.747102 |
3c4faafb-f5e7-406c-ba9c-a3132adb8e25 | ReiAccept/Algorithm | hdu/4593.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int n,a[1005];
int main()
{
while(cin >> n)
{
memset(a, 0, sizeof(a));
for(int i=0; i<=n;i++)
{
int x;
cin>>x;
a[x]++;
}
for(int i=1;i<=n;i++)
... | ALGO | 0.99964 | 3.224865 |
1f7f51c2-414c-43d8-b491-4b43f4036700 | wide777/AtCoder | Other_Contests/競プロ典型90問/002.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 n;
cin >> n;
for(int bit = 0; bit < (1 << n); ++bit) {
string s;
for(int i = n - 1; 0 <= i; --i) {
if(bit & (1 << i)) {
s += '... | ALGO | 0.999884 | 4.041349 |
19bb8458-123d-4914-b7ab-29efeb620e01 | mohlerm/hotspot | src/share/vm/gc/g1/g1EvacFailure.cpp | #include "precompiled.hpp"
#include "gc/g1/concurrentMark.inline.hpp"
#include "gc/g1/dirtyCardQueue.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1EvacFailure.hpp"
#include "gc/g1/g1OopClosures.inline.hpp"
#include "gc/g1/g1_globals.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/g1/heapRegionRem... | TOOL | 0.879866 | 7.406681 |
b673b97f-dd99-4ac9-9e32-fd0b5a2784df | piash76/2013-2014-ACM-ICPC-Pacific-Northwest-Regional-Contest | Problem G_Generations of Tribbles.cpp |
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll,ll>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define cy cout<<"YES"<<endl
#define cn cout<<"NO"<<endl
using namespace std;
const ll inf=1e18;
const int mod=1e9+7;
cons... | ALGO | 0.999986 | 4.124906 |
b4f20091-821f-4d63-9995-b99153eaa543 | Raajzz/leetcode-dsa | climbing-stairs/climbing-stairs.cpp | class Solution {
public:
int dp_prog(int n, unordered_map<int,int> &umap){
int val = umap[n];
if(val != 0){
return val;
}
if(n==0 || n==1){
return 1;
}
return umap[n] = dp_prog(n-1, umap) + dp_prog(n-2, umap);
}
int climbStairs(i... | ALGO | 0.999983 | 6.358381 |
c59fcdc6-e049-4e0c-a5b0-8bb5e4e41649 | ml1150258/CSC_CIS_5 | Proj/RecentProjectCrapsDevelopment/Craps_V1/main.cpp | /*
* File: main.cpp
* Author: Dr. Mark E. Lehr
* Created on January 26th, 2021, 10:40 AM
* Purpose: Version 1 -> Implementing the Rules of the Game
*/
//System Libraries
#include <iostream> //I/O Library
#include <cstdlib> //Random function
#include <ctime> //Time Library
using namespace std;
//User L... | ALGO | 0.987971 | 3.467174 |
e4daefd7-f6fb-4a79-9d89-d011a9c5f69f | arriopolis/AOC2020 | Day5/part2.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
string s;
vector<int> ids;
while (cin >> s) {
int r = 0;
for (char c : s) {
if (c == 'B' || c == 'R') r = r*2+1;
else if (c == 'L' || c == 'F') r *= 2;
}
ids.push_back(r);
... | ALGO | 0.999301 | 3.420416 |
b2256f3f-3d67-423a-b554-e32a7d90f26a | cwang588/algorithms | USACO 2021 January Contest, Bronze/A.cpp | #include<bits/stdc++.h>
using namespace std;
char a[55],b[10005];
int mm[55];
int main(){
cin>>a>>b;
int n=strlen(a),m=strlen(b),ans=1;
for(int i=0;i<n;++i)mm[a[i]-'a']=i;
for(int i=1;i<m;++i)if(mm[b[i]-'a']<=mm[b[i-1]-'a'])++ans;
printf("%d\n",ans);
return 0;
}
| ALGO | 0.999962 | 3.452134 |
953dc71a-f286-4c04-9819-96fa0037702e | thegamer1907/Code_Analysis | contest/1542581169.cpp | #include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define PI acos(-1)
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define INF64 0x3f3f3f3f3f3f3f3f
#define random(a,b) ((a)+rand()%((b)-(a)+1))
#define ms(x,v) memset((x),(v),sizeof(x))
#define eps 1e-8
using namespace std;
typede... | ALGO | 0.99998 | 3.697161 |
bab9dcc9-5d46-4849-85d5-2b763d148906 | Dai-vl/Estructura-de-datos- | Ej18-Revision.cpp | // Nombre del alumno Daniela Vidal
// Usuario del Juez A75
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <stack>
using namespace std;
struct fecha {
int anyo, mes, dia;
/* bool operator>(fecha f1) {
return ((anyo > f1.anyo) || (anyo == f1.anyo && mes > f1.mes) |... | ALGO | 0.999722 | 3.95563 |
7709159d-cfe1-49be-b468-b8cf440eefd1 | 6namdang/distributed_programming | CPP/Fork/ForkE2.cpp | #include <sys/wait.h> //sleep
#include <iostream> //for terminal
#include <unistd.h> //for fork(), getpid(), getppid()
int main() {
int count = 0;
pid_t fpid = fork();
if (fpid == -1){
printf("forked failed");
return -1;
}
else if( fpid > 0){
printf("parent waiting for child to stop counting \n");
int ... | TOOL | 0.998222 | 4.243317 |
5164797e-08dc-43c0-9411-eec613a33551 | wanghyu/leetcode | editor/cn/337-HouseRobberIII.cpp | //The thief has found himself a new place for his thievery again. There is only
//one entrance to this area, called root.
//
// Besides the root, each house has one and only one parent house. After a tour,
// the smart thief realized that all houses in this place form a binary tree. It
//will automatically contact t... | ALGO | 0.999955 | 6.494073 |
a083b9cc-d1f0-4c1a-a5d6-adfc355be59c | MrNytro/Interviewbit | Arrays/Add One To Number.cpp | vector<int> Solution::plusOne(vector<int> &A) {
vector<int>res;
int carry=1;
for(int i=A.size()-1;i>=0;i--){
if(A[i]==9&&carry==1)
res.push_back(0);
else{
res.push_back(A[i]+carry);
carry=0;
}
}
if(carry==1)
res.push_back(1);
r... | ALGO | 0.999839 | 5.90626 |
9458e936-b93e-45ba-b258-fc84604443cc | AdrianHordila/oop2024 | Laborator 1/Problema 1/main.cpp | #include <iostream>
#include <cstring>
/*
Write a program in C-Language that open the file "in.txt", and prints the sum of the numbers that are found on each line of the file in.txt.
To open the file use fopen API.
Write your own function that converts a string to a number (similar cu atoi API).
To print something to ... | ALGO | 0.95221 | 4.416627 |
53863eca-d2ea-4aac-9cf7-1096aa8d7e70 | Abrahul-107/DSA_CHALLENGE | Tree/08_mirror_tree.cpp | #include <bits/stdc++.h>
using namespace std;
class TreeNode
{
public:
int data;
TreeNode *left;
TreeNode *right;
TreeNode(int val) : data(val), left(nullptr), right(nullptr){};
~TreeNode()
{
delete left;
delete right;
}
};
void mirrorTree(TreeNode *root)
{
if(root==nul... | ALGO | 0.999976 | 5.821725 |
c5d69b6b-d912-4346-97b5-d0c7b85613de | NikolaiIvanouski1979/Project5 | Project5/Source.cpp | # include <iostream>
using namespace std;
int main()
{
void order(int&, int&);
int n1 = 99, n2 = 11;
int n3 = 22, n4 = 88;
order(n1, n2);
order(n3, n4);
cout << "n1= " << n1 << endl;
cout << "n2 = " << n2 << endl;
cout << "n3 = " << n3 << endl;
cout << "n4 = " << n4 << endl;
system("pause");
return 0;
}
vo... | ALGO | 0.998505 | 4.201255 |
d11b33fa-706a-490f-9545-f0252b779c3a | ybch14/DataStructure-and-Algorithm-OJ-Assignments | Experiment5/puzzle.cpp |
#include <iostream>
#include <stdio.h>
#define INF 2147483647
using namespace std;
int i=0;int j=0;
class Node
{
public:
int number;
int weight;
bool spt;
Node *next;
Node()
{
number=0;
weight=0;
spt=false;
next=NULL;
}
Node(int n_number,int n_weight)
{
number=n_number;
weight=n_weight;
spt=fals... | ALGO | 0.99996 | 3.334326 |
16b32bb1-068b-4aab-82e6-408e8250e1b8 | anubhav811/DSA-Practice | 19-remove-nth-node-from-end-of-list/19-remove-nth-node-from-end-of-list.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* removeNthFr... | ALGO | 0.999963 | 5.974084 |
5823962e-4dde-4f61-9448-05d040c6e0fa | ishandutta2007/codeforces | enkognit/normal/1404/A.cpp | #include <bits/stdc++.h>
#include <random>
#include <ctime>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
#define ll long long
#define mp make_pair
#defin... | ALGO | 0.999992 | 4.184351 |
672b08ef-dc96-45b1-a886-ceed7e889240 | zhuminjie/OpenSeesPy | SRC/system_of_eqn/linearSOE/mumps/c_example1.cpp | /* This file is part of MUMPS VERSION 4.7.3
This Version was built on Fri May 4 15:54:01 2007
*/
/* $Id: c_example1.cpp,v 1.1 2007-06-01 17:44:35 fmk Exp $ */
/* Example program using the C interface to the
* double precision version of MUMPS, dmumps_c.
* We solve the system A x = RHS with
* A = diag(1 2) and RH... | ALGO | 0.999777 | 4.343982 |
a644ab2e-3959-45c0-aaba-855dde6f0d48 | Kaneko773/Class20250417HomeWork | HitJudgeManager.cpp | #include "HitJudgeManager.h"
#include "BoxCollider.h"
#include "Player.h"
#include "Paddle.h"
HitJudgeManager* HitJudgeManager::pInstance = nullptr;
HitJudgeManager* HitJudgeManager::getInstance()
{
if (pInstance == nullptr)
{
pInstance = new HitJudgeManager();
}
return pInstance;
}
void HitJudgeManager::create... | TOOL | 0.948292 | 5.873626 |
60125ea7-10c0-480c-8142-551444d0328c | marioyc/Online-Judge-Solutions | TJU/1782 - The jackpot.cpp | #include <cstdio>
using namespace std;
int main(){
int N,a[10000],dp[10000];
int ans;
while(1){
scanf("%d",&N);
if(N==0) break;
for(int i=0;i<N;i++) scanf("%d",&a[i]);
ans=a[0];
dp[0]=a[0];
for(int i=1;i<N;i++){
... | ALGO | 0.999729 | 3.253341 |
85e8692c-78c7-4c3c-a0c8-ae041f23cb5b | rbnalexs/Programacion_C_Introduccion | la suma de los numeros pares del 1 al 20.cpp | //NOMBRE:GABRIELA MUNIVIS EFIGENIO.
//FECHA:14 DE ABRIL DE 2015.
//DESCRIPCION:LA SUMA DE LOS NUMEROS PARES DEL 1 AL 20.
#include "stdio.h"
#include "conio.h"
main()
{
int S,C,I;
S=0;
for(I=1; I<=20; I++)
{
I=I+1;
S=S+I;
}
printf("La suma es %d",S);
getche();
return 0;
}
| ALGO | 0.99651 | 3.24382 |
4a8faf0a-0fee-4cfc-92cf-d67e04f86e9e | ahti/fsbench | src/codecs/cryptopp/integer.cpp | // integer.cpp - written and placed in the public domain by Wei Dai
// contains public domain code contributed by Alister Lee and Leonard Janke
#include "pch.h"
#ifndef CRYPTOPP_IMPORTS
#include "integer.h"
#include "modarith.h"
#include "nbtheory.h"
#include "asn.h"
#include "oids.h"
#include "words.h"
#include "al... | ALGO | 0.960258 | 6.034801 |
d73f1f02-0994-486d-bb79-c7ac359e7f4c | BangKartavya/DSA-Sheet-by-Love-Babbar | Bit Manipulation/Power of 2/main.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:
// Function to check if given number n is a power of two.
bool isPowerofTwo(int n) {
while(n > 1) {
if(n%2 ==... | ALGO | 0.986466 | 6.532374 |
2101e725-4153-491b-8659-a6b7c83c7499 | Zerefez/DOA-general-codes | BRRR/Opgave4-Jan-2023/flight.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <queue>
#include <array>
#include <climits>
using namespace std;
struct flight_location {
int price = INT_MAX; // Initialize price to avoid uninitialized variable warning
vector<int> path; // Gemmer den rute, der frte til destinationen
};... | ALGO | 0.999967 | 5.789381 |
3dcfed8c-2615-4a07-8d10-ffa888cb6889 | alexandraback/datacollection | solutions_2749486_0/C++/natha0x6e/2.cpp | #include <iostream>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <list>
#include <queue>
#include <utility>
#include <vector>
#include <algorithm>
#include <list>
typedef long long ll;
typedef double dub;
using namespace std;
const int SPACESIZE = 1000;
const int SPACEMID = SPACESIZE / 2;
char space... | ALGO | 0.999955 | 3.388434 |
e4c2099c-c90e-4e6d-b820-e48b334729fa | ssrpsx/uni-coding-practice | css121/hw/S-LinkedList-Polynomian.cpp | #include <iostream>
#include <climits>
using namespace std;
struct Node {
int value;
int power;
Node* next;
};
Node *createList() // Big-O(1)
{
Node *headNode = new Node{0, INT_MIN, nullptr};
return headNode;
}
void insert(Node *&head, int value, int power) // ดีสุด Big-O(1) กรณีแย่สุดต้องลูปทุกต... | ALGO | 0.999559 | 3.806985 |
ee56a13d-f435-4a92-a8ec-008f9e7cd4fa | wtsi-svi/ReadServer | src/util/index_rlebwt.cpp | //
// Main programme to create index structure for run-length encoded BWT string.
// e.g. ./index_rlebwt rlebwt.in
//
#include <string>
#include <memory>
#include "rlebwt.h"
using namespace std;
int main (int argc, char **argv) {
if ( argc < 2 ) {
cerr << "Require more arguments for index_rlebwt." << endl;
... | TOOL | 0.921595 | 4.80537 |
49f93240-1591-4fd5-8df0-a319bf49f572 | dylan007/Coding | Codeforces/515c.cpp | /*
* =====================================================================================
*
* Filename: 515c.cpp
*
* Description:
*
* Version: 1.0
* Created: Monday 11 July 2016 05:00:13 IST
* Revision: none
* Compiler: gcc
*
* Author: Shounak Dey (), <EM... | ALGO | 0.999942 | 4.154895 |
c1cf0fda-10d1-4cd6-b373-39f5e28c7ae9 | akowalew/cuda-imgproc | lib/src/cpu/cpu_filter.cpp | ///////////////////////////////////////////////////////////////////////////////
// cpu_filter.cpp
//
// Implementation of CPU convolution filterer
///////////////////////////////////////////////////////////////////////////////
#include "cpu_filter.hpp"
#include <cmath>
#include "log.hpp"
void cpu_filter(Image& dst... | ALGO | 0.956344 | 7.156477 |
c1375b6d-053a-486e-a066-a7656e3291a3 | ldcduc/leetcode-training | cpp/duplicate-zeros.cpp | /* Problem url: https://leetcode.com/problems/duplicate-zeros
* Code by: ldcduc
* */
/* Begin of Solution */
class Solution {
public:
void duplicateZeros(vector<int>& arr) {
for (int i = 0; i < arr.size(); ++ i) {
if (arr[i] == 0) {
for (int j = arr.size() - 1; j > i; -- j) {
... | ALGO | 0.999818 | 7.026501 |
9366874e-d91f-4057-b14d-9ef7dc522346 | Thisayang/Codeforces | 734A_Anton_and_Danik.cpp | #include<iostream>
#include<string.h>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
char x[100000];
int num=0;
cin>>x;
for(int i=0;i<strlen(x);i++)
{
if(x[i]=='D') num++;
}
if(num>n-num) cout<<"Danik"<<endl;
else if(num<n-num) cout<<"Anton"<<endl;
else cout<<"Friendship"<<endl;
}
re... | ALGO | 0.999856 | 3.332389 |
8e518947-26ce-4af8-8c6d-01413e14dd1b | ADIL0025/Geeksforgeeks | Difficulty: Easy/Facing the sun/facing-the-sun.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
// Returns count buildings that can see sunlight
int countBuildings(vector<int> &height) {
// code here
int maxi=height[0];
int count=... | ALGO | 0.998695 | 6.537319 |
20421a14-00c1-42be-8096-90bf1ed56aed | jasonmphelan/sidis_analysis_suite | classes/CLAS.cpp | #include "CLAS.h"
#include "TF1.h"
#include "TString.h"
#include "TRandom3.h"
#include "TLorentzVector.h"
#include <fstream>
#include <unistd.h>
#define DAT_PATH _DATA
using namespace std;
CLAS::CLAS() {
ReadMomentumParameters((TString) DAT_PATH+"/acceptance_map/upper_momentum_fit.dat", (TString) DAT_PATH+"/acce... | ALGO | 0.971561 | 3.539918 |
26fa91dd-2806-4180-8185-64ae10280765 | sizhuo-zhang/boost_1_62_0 | libs/numeric/ublas/doc/samples/vector_slice.cpp | #include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
vector<double> v (3);
vector_slice<vector<double> > vs (v, slice (0, 1, 3));
for (unsigned i = 0; i < vs.size (); ++ i)
... | ALGO | 0.965281 | 3.141449 |
5fd8e1d5-62f2-451e-851e-3ecdc06067c2 | vraj27-k/servicity | backend/venv/Lib/site-packages/sklearn/svm/src/liblinear/tron.cpp | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "tron.h"
#ifndef min
template <class T> static inline T min(T x,T y) { return (x<y)?x:y; }
#endif
#ifndef max
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
#endif
static void default_print(const char *buf)
{... | ALGO | 0.999581 | 5.847107 |
7150d95a-3f20-4d4f-9bf4-d6600e585039 | saadsaeed-ss/cplusplus | SinglyLinkedList.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
node *link;
};
class singlylist
{
private:
node *head;
public:
singlylist()
{
head=NULL;
}
void addfirst(int val)
{
node *newer=new node;
newer->data=val;
newer->link=head;
head=ne... | ALGO | 0.999862 | 4.292044 |
33cbda35-6c55-4fc5-a7e7-e9f7aeb1cb9b | edge555/Online-Judge-Solves | UVA/10340 - All in All.cpp | #include <bits/stdc++.h>
#define sc scanf
#define pf printf
#define in1(num) scanf("%d",&num)
#define in2(num1,num2) scanf("%d %d",&num1,&num2)
typedef long long ll;
using namespace std;
int main()
{
string s1,s2;
int n,cnt;
while(cin>>s1>>s2)
{
n=s1.size();
cnt=0;
for(int i=0... | ALGO | 0.999972 | 3.607325 |
667ca48a-659b-4f9c-9ce1-fe96352fb0ec | Hvg0D/EE451 | decrypt.cpp | /* decrypt.cpp
* Performs decryption using AES 128-bit
* @author Cecelia Wisniewska
*/
#include <iostream>
#include <cstring>
#include <fstream>
#include <sstream>
#include "structures.h"
using namespace std;
/* Used in Round() and serves as the final round during decryption
* SubRoundKey is simply an XOR of a 12... | ALGO | 0.97241 | 4.371522 |
3d6c2b14-fb2c-4768-b62f-4bbc430466fe | manikanta2901/ubuntu | .history/SRM/elab/DataStructures/LinkedList/LL18_20200925184030.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
struct node{
int data;
struct node* next;
};
void printList(struct node *s){
while(s != NULL){
cout << s->data <<" ";
s = s->next;
}
cout << endl;
}
void reverseList(struct node **s){
struct node *current = *s,*pr... | ALGO | 0.999963 | 4.652164 |
5b7c37ca-0dbc-424c-b26b-eda51465555b | PhoenixNil/Data-structure-and-algorithm | PAT/1030.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
#define max 550
#define inf 9999
using namespace std;
//BFS
int M, N;
queue<int> temp;
vector<vector<int>> path(max);
bool visit[max];
int d[max],lost[max];
struct Gnode
{
int length;
int Cost;
} G[max][max];
void BFS(in... | ALGO | 0.999794 | 3.680117 |
dce2e1f3-3c2a-4b73-9e80-3799d45233cb | RSMIT01/6Companies30Days | Walmart/6.cpp | //link:https://practice.geeksforgeeks.org/problems/power-of-numbers-1587115620/1/?company[]=Walmart&company[]=Walmart&page=1&query=company[]Walmartpage1company[]Walmart
class Solution{
public:
//You need to complete this fucntion
long long power(long long N,long long R)
{
//Your code here
... | ALGO | 0.999985 | 5.39585 |
aa148350-01ef-43f1-84ae-4ccb26cd91eb | lkoiescg2031/APSS | Baekjoon Online Judge/1509.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int n;
char str[2502];
int is_pal[2501][2501];
int dp[2501];
int main() {
str[0] = ' ';
scanf("%s", str + 1);
n = strlen(str) - 1;
for (int i = 1; i <= n; i++) {
is_pal[i][i] = 1;
is_pal[i][i + 1] = str[i] == str[i + 1];
}
for ... | ALGO | 0.999928 | 3.706888 |
2fdd8b4f-b2ba-4b08-a34f-0bcb1c94f71b | Geek-a-Byte/Competitive-Programming | 1_stl/basics/set.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
//set -> std::set -> ordered_set we do not write ordered_set bcoz set is implicitely ordered
//set will store unique integers in ordered form i.e it will sort them out
//set will store the strings which are different in case but same in alphabet... | ALGO | 0.967361 | 4.450488 |
e1360607-67da-4b8d-ac22-401e798943af | enoxum/UbiBelPMF_2024 | libs/glm/include/test/core/core_func_integer_find_lsb.cpp | #include <glm/glm.hpp>
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
int nlz(unsigned x)
{
int pop(unsigned x);
x = x | (x >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >>16);
return pop(~x);
}
int pop(unsigned x)
{
x = x - ((x >> 1) & 0... | ALGO | 0.997088 | 4.794778 |
d0b95f60-2aaa-4b61-8cd9-ef059f4a6472 | georgehodgkins/Zhuque_artifact | clobber-pmdk/llvm/libcxx/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// bool
// is_sorted(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_iterators.h"
#if TEST_STD_VER > 17
TEST_CONSTEXPR bool test_constexpr() {
int ia[] = {0, 0, 1, 1};
int i... | TEST | 0.994104 | 6.92351 |
dcd9244f-1a3d-49b5-810f-8a9c81a997c0 | moondemon68/cp | ITEBE/Kontes8/dummy.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define LL long long
using namespace std;
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
LL bp... | ALGO | 0.999656 | 3.69301 |
aac226b7-3fa0-4167-978d-5148dab65a65 | qq734628996/ac-code | HDU/2328/16710873_AC_483ms_9332kB.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <ctime>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
... | ALGO | 0.999941 | 3.503365 |
56b4cf59-ece9-4dcc-98b3-cf17d2959acc | Pritanjan/time-pass | queue/07 First negative integer in every window of size k.cpp | // https://practice.geeksforgeeks.org/problems/first-negative-integer-in-every-window-of-size-k3345/1
// https://www.geeksforgeeks.org/first-negative-integer-every-window-size-k/
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
vector<long long> printFirstNegativeInteger(long long int arr[],
... | ALGO | 0.999883 | 5.742973 |
91b2d463-5746-41ce-a2ab-44f2a79f6a91 | MHMITHUN/Lab_evaluation-and-practise-08-14-2023- | problem1.cpp | #include<iostream>
using namespace std;
class example
{
int A;
example(int value){
A= value};
public:
int compare(int n1,int n2,int n3)
{
num1=n1;
num2=n2;
num3=n3;
if(num1>num2 && num1>num3)
{
return num1;
}
else if(num2>num1 &... | ALGO | 0.997412 | 4.161586 |
3835aac4-5569-43a6-9edf-8077b8a4c544 | gamekit-developers/gamekit | bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp | #include "LinearMath/btVector3.h"
#include "btRaycastVehicle.h"
#include "BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h"
#include "BulletDynamics/ConstraintSolver/btJacobianEntry.h"
#include "LinearMath/btQuaternion.h"
#include "BulletDynamics/Dynamics/btDynamicsWorld.h"
#include "btVehicleRaycaster.h"
#i... | ALGO | 0.89906 | 5.251037 |
974312a4-7ecc-43a8-bcb1-10a115427742 | raincross7/code-similarity | codes/train_code/problem149/problem149_195.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
int main()
{
int n;
cin >> n;
vector<int> checked(100005);
int ans = 0;
for (int i = 0; i < n; i++)
{
int a;
cin >> a;
... | ALGO | 0.999873 | 3.821494 |
f1b97ffe-9fc6-4ed6-bcf3-0af7142cbf91 | sevysingh2223/CPP_AugR23 | Recursion/SumOfN.cpp | #include<stdio.h>
#include<iostream>
using namespace std;
int t_sum =0;
int sumN(int n){
//base case (termination case)
if(n==0){
return t_sum ;
}
t_sum += n;
return sumN(n-1);
}
int main(){
cout<<sumN(10);
return 0;
} | ALGO | 0.999841 | 4.47664 |
9905e457-cfba-4947-ad00-0f7f1a969ce4 | Zengrane/ardupilot | libraries/AC_PID/AC_P_1D.cpp | /// @file AC_P_1D.cpp
/// @brief Generic P algorithm
#include <AP_Math/AP_Math.h>
#include "AC_P_1D.h"
const AP_Param::GroupInfo AC_P_1D::var_info[] = {
// @Param: P
// @DisplayName: P Proportional Gain
// @Description: P Gain which produces an output value that is proportional to the current error value
... | ALGO | 0.999249 | 5.970104 |
1eb9253d-9fc2-44db-aeef-4a3293fea5ef | melon1313/Learning_C-C- | Overloading_Operators.cpp | #include <iostream>
using namespace std;
class CVector{
public:
int x, y;
CVector(){x = 0; y = 0;}
CVector(int, int);
CVector operator+(CVector);
};
CVector::CVector(int a, int b){
x = a;
y = b;
}
CVector CVector::operator+(CVector a){
CVector temp;
temp.x = x + a.... | TOOL | 0.952233 | 4.426412 |
34a153d1-fa75-4dd7-802d-ddb2002cf2a8 | patrickhao/PAT | algorithm/advanced2/dfs2.cpp | #include <cstdio>
#include <vector>
using namespace std;
const int maxn = 4;
int n = 4, k = 2, x = 6, maxSumSqu = -1, A[maxn] = {2, 3, 3, 4};
vector<int> temp, ans;
void dfs(int index, int nowK, int sum, int sumSqu) {
if(nowK == k && sum == x) {
if(sumSqu > maxSumSqu) {
maxSumSqu = sumSqu;
... | ALGO | 0.999804 | 4.355925 |
7f44c4c4-df23-4dc0-b9a8-4286915e925e | suiramdev/42-cpp | 08/ex01/Span.cpp | #include "Span.hpp"
#include <algorithm>
#include <iostream>
#include <vector>
Span::Span() : _N(0) {}
Span::Span(unsigned int N) : _N(N) {}
Span::Span(const Span &other) {
_N = other._N;
_v = other._v;
}
Span::~Span() {}
Span &Span::operator=(const Span &other) {
_N = other._N;
_v = other._v;
return *th... | ALGO | 0.991624 | 4.869999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.