uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
08f426e1-1750-42d4-bbdf-5a4b4ea522de | thegamer1907/Code_Analysis | contest/1542590144.cpp | #include <bits/stdc++.h>
#define itn int
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#ifdef ONLINE_JUDGE
inline int pidorand() {
return ((rand() & 32767) << 15) | (rand() & 32767);
}
#define rand pidorand
#endif // ONLINE_JUDGE
#... | ALGO | 0.999762 | 3.520715 |
ebecb6d3-cc52-45a6-97b6-03d74414daea | chenyufjfz/WaterSound | watersound/SpaceFilterCPU.cpp | #include "SpaceFilter.h"
#include "math.h"
#include <string.h>
/*
Copy from Bao xizhong
*/
static float coef_filter_GPU[256] = { 0.0007f, 0.0007f, 0.0007f, 0.0008f, 0.0008f, 0.0008f, 0.0008f, 0.0009f, 0.0009f, 0.0009f, 0.0009f, 0.0010f, 0.0010f, 0.0010f, 0.0011f,
0.0011f, 0.0011f, 0.0011f, 0.0011f, 0.0012f, 0.0012f, ... | ALGO | 0.986807 | 3.62967 |
c851fe10-dac8-4f1c-b780-05f2f0d9cf92 | PessimistA/data_structures | stack_queue/prefix_calculate.cpp | #define _CRT_SECURE_NO_WARNINGS // Visual Studio kullanıyorsanız bu satır gereklidir.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#define MAX 100
typedef enum
{
left_parent, right_parent, add, subtract, multiply, divide, eos, operand
}precedence;
char expr[] = "- / * 20* 50 + 3 6 30... | ALGO | 0.998228 | 4.257366 |
a223d017-6ddc-4976-84bd-663526409daa | Adarsh-kumar/Competitive_coding_practice | t_shirts.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
string arr1[105];
string arr2[105];
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
cin>>arr1[i];
for(int i=0;i<n;i++)
cin>>arr2[i];
int ans=0;
int temp;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(arr2[i].size()==arr1[j].size())
{
if(arr2[i][... | ALGO | 0.999808 | 3.249418 |
f2d1d732-63dd-425e-8cc1-0c703083a059 | craigsapp/humextra | cli/lofcog.cpp | //
// Programmer: Craig Stuart Sapp <<EMAIL>>
// Creation Date: Wed Nov 19 15:25:16 PST 2003
// Last Modified: Sat Mar 12 20:17:33 PST 2016
// Filename: ...sig/examples/all/lo5.cpp
// Web Address: http://sig.sapp.org/examples/museinfo/humdrum/lofcog.cpp
// Syntax: C++; museinfo
//
// Description: Lin... | ALGO | 0.984586 | 5.300462 |
a58cd634-1cef-49c7-b9d8-26a56a3c1bd0 | Saqib-nawab/algorith_toolbox | Weak3/2_maximum_value_of_the_loot/fractional_knapsack.cpp | #include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>
using namespace std;
class Item {
private:
int weight;
int value;
public:
Item(int value, int weight) : value(value), weight(weight) {}
~Item() = default;
Item() = delete;
int getWeight() { return weight; }
int getValue() { ... | ALGO | 0.99991 | 5.079839 |
c397c0af-5864-4841-a916-cc31279b2eb2 | MdAsimKhan/Striver-SDE-2022-Solutions | FlattenALL.cpp | #include <bits/stdc++.h>
Node* merge2LL(Node* a, Node* b){
Node *temp = new Node(0);
Node *res=temp;
while(a && b){
if(a->data < b->data){
temp->child=a;
temp=temp->child;
a=a->child;
}
else{
temp->child=b;
temp=temp->child... | ALGO | 0.999981 | 4.357388 |
2bee1b2d-d138-4caa-84c0-a6a6b4d926d1 | UsmanovaRenata/OOP_LETI_LABS | five/server/rational.cpp | #include"rational.h"
Rational::Rational()
{
numerator = 0;
denominator = 1;
}
Rational::Rational(int a, int b)
{
numerator = a;
denominator = b;
}
Rational::Rational(int a)
{
numerator = a;
denominator = 1;
}
Rational Rational::operator+(Rational const& num)
{
int numer = numerat... | TOOL | 0.865139 | 4.593752 |
de23afb0-1327-4df1-b62b-181977556484 | kayush96/C_plus_plus | CodingNinjas/Patterns/pattern10.cpp | #include <iostream>
using namespace std;
int main()
{
int i, n;
cout << "Enter value of N: ";
cin >> n;
while (i <= n)
{
int j = 1;
while (j <= i)
{
cout << i;
j++;
}
i++;
cout << endl;
}
return 0;
}
| ALGO | 0.999702 | 3.892513 |
8f3fb916-cfd2-405e-b420-87b48311e0d8 | eggag32/Competitive-Programming | Codeforces/Expansion coefficient of the array.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cout << #x << ": " << x << endl
#define repn(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) for(int i = 0; i < (a); i++)
#define all(v) v.begin(), v.end()
#define mp make_p... | ALGO | 0.999887 | 3.543651 |
259dcd79-8d6d-4715-b341-a7708633b5d3 | damucz/chipmunk2d | src/cpSpaceHash.cpp | #include "chipmunk/chipmunk_private.h"
#include "prime.h"
typedef struct cpSpaceHashBin cpSpaceHashBin;
typedef struct cpHandle cpHandle;
struct cpSpaceHash {
cpSpatialIndex spatialIndex;
int numcells;
cpFloat celldim;
cpSpaceHashBin **table;
cpHashSet *handleSet;
cpSpaceHashBin *pooledBins;
cpArray *poo... | ALGO | 0.982001 | 3.801939 |
04fb34a0-4bc7-4d82-adef-bf9a628d21b6 | GeorgeLyon/SwiftHDL | mlir/llvm/llvm/tools/llvm-xray/xray-graph-diff.cpp | #include "xray-graph-diff.h"
#include "xray-graph.h"
#include "xray-registry.h"
#include "xray-color-helper.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/XRay/Trace.h"
using namespace llvm;
using namespace xray;
static cl::SubCommand GraphDiff("graph-diff",
... | TOOL | 0.94584 | 7.610459 |
5b378bf6-49c4-4931-9598-a598e9bc9d93 | lazybones1/Algorithms | leetcode/30-Day LeetCoding Challenge/week 3/5. Search in Rotated Sorted Array.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int f=0, e=nums.size()-1;
while(f<=e){
int mid = (f+e)/2;
int midnum = nums[mid], left = nums[f], right = nums[e];
if(midnum == target) return mid;
if(midnum < left){
... | ALGO | 0.999922 | 5.763059 |
80121072-67c1-46f0-b3e8-c11ced0f54d6 | suirless/libeigen | lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.9991 | 5.816968 |
9da22fef-4e77-442c-8b5e-d9bf42a59d37 | ajmat6/DSA | L_Score_of_a_String.cpp | class Solution {
public:
int scoreOfString(string s) {
int ans = 0;
for(int i=0; i<s.size()-1; i++) {
ans += abs((s[i] - 'a') - (s[i + 1] - 'a'));
}
return ans;
}
}; | ALGO | 0.999706 | 5.638669 |
c2566d93-28d4-4439-ae99-b1fa1dccf2e3 | salmangadit/scope | scope-ocr --username aravindh.shankar.91@gmail.com/tess-two/tess-two/jni/com_googlecode_tesseract_android/src/ccstruct/vecfuncs.cpp | /*----------------------------------------------------------------------
I n c l u d e s
----------------------------------------------------------------------*/
#include "mfcpch.h"
#include "vecfuncs.h"
/*----------------------------------------------------------------------
F u n c t i o ... | ALGO | 0.918826 | 5.112952 |
1d1ce284-38d8-4701-9bcd-b6ea02288e4f | charlierance/Highway_Path_Planner | src/Eigen-3.3/doc/snippets/JacobiSVD_basic.cpp | MatrixXf m = MatrixXf::Random(3,2);
cout << "Here is the matrix m:" << endl << m << endl;
JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);
cout << "Its singular values are:" << endl << svd.singularValues() << endl;
cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU(... | ALGO | 0.999619 | 3.463409 |
767dd1c1-59a8-4518-ab46-c8f5b41adf0c | Saif502/CP_Hunter | C & c++ code/Codeforces/918a.cpp | #include<bits/stdc++.h>
#include<iostream>
#include<math.h>
#include<map>
#include<vector>
#include<iterator>
#include<string.h>
#define ll long long int
#define i_for(n) for(ll i=0;i<n;i++)
#define ri_for(n) for(ll i=n-1;i>=0;i--)
#define for_i(n) for(ll i=1;i<=n;i... | ALGO | 0.999874 | 3.232928 |
c313646b-64f0-40d2-b1ca-04d330f60580 | kogito0325/boj | cpp_codes/boj2579.cpp | #include <iostream>
using namespace std;
int arr[301];
int dp[301];
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> arr[i];
dp[0] = 0;
dp[1] = arr[1];
dp[2] = arr[1] + arr[2];
for (int i = 3; i <= n; i++)
dp[i] = max(dp[i-2], dp[i-3] + arr[i-1]) ... | ALGO | 0.999966 | 4.427674 |
c9c5a7e8-6ec5-412f-96df-133111bc191f | tmuttaqueen/MyCodes | Online Judge Code/codeforces/Codeforces Round #304 (Div. 2)/D. Soldier and Number Game.cpp | #include <bits/stdc++.h>
using namespace std;
const double pi = 3.141592653589793;
#define xx first
#define yy second
#define mp make_pair
#define intl long long
#define filein freopen("input.txt", "r", stdin)
#define fileout freopen("output.txt", "w", stdout)
#define debug... | ALGO | 0.999807 | 4.12833 |
585c056c-6000-4540-acca-2f264670d29a | KleskBY/IrrLicht-Shooter-Example | irrBullet/3rdparty/bullet3-2.83.7/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp | #include "btMultiSapBroadphase.h"
#include "btSimpleBroadphase.h"
#include "LinearMath/btAabbUtil2.h"
#include "btQuantizedBvh.h"
/// btSapBroadphaseArray m_sapBroadphases;
/// btOverlappingPairCache* m_overlappingPairs;
extern int gOverlappingPairs;
/*
class btMultiSapSortedOverlappingPairCache : public btSortedOv... | ALGO | 0.975918 | 4.027205 |
a4c67e8b-fe96-4878-b2ec-fdddc8a1b9cd | josedoneguillen/CPP | calcular-nota/main.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debu... | TOOL | 0.86937 | 3.723056 |
87d15b55-ceaa-4b6e-a7f6-3a4c05ce9dd9 | dev-neha-raj/CppSolutionsArchive | Basic-program-2022/equilibriumIndex.cpp | //finding equilibrium index;
#include<bits/stdc++.h>
using namespace std;
int EquilibriumIdx(int arr[], int n){
int leftSum=0; int rightSum=0;
for(int i=0;i<n;i++){
// int leftSum=0;
for(int j=0;j<i;j++){
leftSum +=arr[j];
}
// int rightSum=0;
for(int j=i+1;j<n;j++){
rightSum += arr[j];
}
if(rightSum==leftSum)
retur... | ALGO | 0.999979 | 5.278467 |
e480fda4-90e2-4c3d-a654-142789bbb808 | Mulab11/cntt2016-hw1 | TC-SRM-578-div1-1000/yyt16384.cpp | #include <algorithm>
#include <queue>
#include <tuple>
#include <vector>
static const int INF = 0x3f3f3f3f;
class TreeGraph {
public:
int n = 0;
std::vector<std::vector<int>> edge;
std::vector<int> fa;
std::vector<int> order;
TreeGraph() { }
TreeGraph(int n_) : n(n_), edge(n), fa(n, -1) { }... | ALGO | 0.999731 | 4.591737 |
afa7829e-792e-483e-8eab-c4815d78cccb | SafiyatulHoque/Bootcamp-NSU | Bootcamp 11/Pre Codeforce Contest/F.cpp | #include<iostream>
using namespace std;
int main()
{
string str;
cin>>str;
int len = str.length();
int zero = 0;
int one = 0;
for(int i=0;i<len;i++)
{
if(str[i] == '0')
zero++;
if(str[i] == '1')
one++;
}
if(zero>one)
cout<<one*2;... | ALGO | 0.9999 | 3.733319 |
4d8da311-918c-4219-b710-7433fbc3c961 | AustinHuang823/Leetcode | CPP/array/121. Best Time to Buy and Sell Stock.cpp |
class Solution {
public:
int maxProfit(vector<int>& prices) {
int cur_min_cost = -INT_MAX;
int profit = 0;
for (int n: prices){
if (-n > cur_min_cost){
cur_min_cost = -n;
continue;
}
if (profit < n + cur_min_cost){
... | ALGO | 0.999906 | 5.884321 |
80d3e298-87bb-4a21-9f31-736fa0621289 | Husainbw786/LeetCode | 0705-design-hashset/0705-design-hashset.cpp | class MyHashSet {
public:
int hash[1000001] = {0};
MyHashSet() {
}
void add(int key) {
hash[key] = 1;
}
void remove(int key) {
hash[key] = 0;
}
bool contains(int key) {
return hash[key];
}
};
/**
* Your MyHashSet object ... | ALGO | 0.998959 | 5.005824 |
d97c774c-9360-4974-aaac-06e6ba110404 | PirateNetwork/pirate | src/zcash/JoinSplit.cpp | #include "JoinSplit.hpp"
#include "prf.h"
#include "zcash/util.h"
#include <memory>
#include <boost/format.hpp>
#include <fstream>
#include "tinyformat.h"
#include "sync.h"
#include "amount.h"
#include "librustzcash.h"
#include "streams.h"
#include "version.h"
#include <rust/blake2b.h>
#include <rust/constants.h>
... | ALGO | 0.997698 | 7.253305 |
603deed0-6358-455e-afc6-b4598b3ae4c0 | atalia/leetcode | 206.cpp | /*
206. Reverse Linked List
Reverse a singly linked list.
Hint:
A linked list can be reversed either iteratively or recursively. Could you implement both?
*/
#include <iostream>
#include <cctype>
#include <string>
#include <cstdlib>
#include <queue>
#include <sstream>
#include <algorithm>
using namespace std;
struct Li... | ALGO | 0.999938 | 5.764146 |
a5e26e6f-3db0-4ee9-830a-5d5ff3a4888d | akshaykumar89/Codeforces-Contests | C_Almost_All_Multiples.cpp | #include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define inf 1e18
#define ninf 1e18*(-1)
#define ff first
#define ss second
#define pb push_back
#define ppb pop_back()
#define vi vector<int>
#define mp make_pair
#define pii pair<int,int>
#define mii map<int,int>
#define pqb priority_queue<int>
#de... | ALGO | 0.999849 | 4.088493 |
0505a0e7-b901-4634-b9dc-4005ad66b5c9 | ishandutta2007/codeforces | somethingnew/normal/1220/A.cpp | #include "list"
#include <iostream>
#include <vector>
#include <fstream>
#include <map>
#include "algorithm"
#include <iomanip>
#include "cmath"
#include "set"
#include <climits>
#define all(x) (x).begin(), (x).end()
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
int z = 0, r = 0, e = 0, o = 0... | ALGO | 0.999207 | 3.223273 |
3889afd7-6d35-499d-ba9f-d6c3f3b95f48 | dorivaldiola0101/Teste | pilhas.cpp | #include <stdio.h>
#include <stdlib.h>
#include "pilha.h"
void desalocar(celula *&lst)
{
celula *aux;
while(lst) // lst != NULL
{
aux = lst;
lst = lst->prox;
free(aux);
}
lst = NULL;
}
/*Função recebe o ponteiro para o topo da pilha, cria um novo nó(célula) para
arm... | ALGO | 0.99962 | 3.719974 |
9a5216ba-d09a-4fa4-bb9d-0488c22446f6 | alexrodriguezlop/Alg | P3/Rodriguez_Lopez_Alejandro_VariosElectricistas.cpp | //**********************************************************************
//Autor: Alejandro Rodrguez Lpez
//Email: <EMAIL>
//Fichero: Prctica3-Algoritmica (Greedy) Varios Electricistas
//**********************************************************************
#include <iostream>
#include <ctime>
#include <cstdlib>
#inclu... | ALGO | 0.999682 | 4.908262 |
72793ff5-ec32-4488-a465-a8bc672aa608 | munna516/Online-Judge | Codeforces/443A.cpp | #include <iostream>
using namespace std;
int main()
{
int i, t = 0, a[26] = {0};
string s;
getline(cin, s);
for (i = 0; s[i] != '\0'; i++)
{
if (s[i] >= 'a' && s[i] <= 'z')
a[s[i] - 97] = 1;
}
for (i = 0; i < 26; i++)
{
t += a[i];
}
cout << t;
return 0;
}
| ALGO | 0.999084 | 3.90591 |
0842a12a-b8d6-4734-8512-104a2c0b3fc8 | terratenff/ga-lib | ga-lib/ga-lib/ga.cpp | #include "pch.h"
#include "ga.h"
#include <iostream>
#include <stdexcept>
#include <limits>
#include <chrono>
#include <functional>
GA::GA()
{
}
GA::~GA()
{
if (rng_ != nullptr) delete rng_;
if (problemData_ != nullptr) delete problemData_;
if (population_ != nullptr) delete population_;
if (criteria_ != nullptr)... | ALGO | 0.999417 | 6.636764 |
c8f8a928-daff-4927-85a2-86b78154c37a | oakkarwin20/OakTreeProjects | Engine/Code/Engine/Math/ConvexPoly3D.cpp | #include "Engine/Math/ConvexPoly3D.hpp"
#include "Engine/Math/Vec3.hpp"
#include "Engine/Core/EngineCommon.hpp"
//----------------------------------------------------------------------------------------------------------------------
ConvexPoly3D::ConvexPoly3D( std::vector<Vec3> ccwOrderedPoints )
{
m_ccwOrderedPoints... | ALGO | 0.942402 | 7.562048 |
28eca478-2d72-490a-9eca-4caab97c4be9 | kirito-udit/DSA-450 | FINAL450/Backtracking/NQueen/Nqueen.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<string>>sol;
bool isSafe(char board[][100],int N,int row, int col)
{
//checking forqueen in coulmn
for(int i=0;i<row;i++)
{
if(board[i][col]=='Q')
return false;
}
... | ALGO | 0.999779 | 5.768997 |
87fb904c-0cc4-46cb-a793-780579b3baa4 | kaiumallimon/cpp-codes | sort/bubble.cpp | #include<iostream>
using namespace std;
void printArray(int array[], int n)
{
for (int i = 0; i < n; i++)
{
cout << array[i] << " ";
}
cout<<"\n";
}
void bubbleSort(int array[], int size){
for(int bl=size-2;bl>=0;bl--){
for(int i=0;i<=bl;i++){
if(array[i]>array[i... | ALGO | 0.999905 | 5.321367 |
1423b44b-68bf-4fca-8607-dd171f214ff3 | TanvirFahimBD/ps-contest-cp | uri/5th Page/URI 1828.cpp | #include<iostream>
#include<bits/stdc++.h>
#include<string.h> //! String comparison header file
using namespace std;
int main()
{
int n, i;
char sh[10], rj[10];
cin >> n;
for(i=1; i<=n; i++){
scanf("%s %s", &sh, &rj);
if(!strcmp(sh, rj)) //!... | ALGO | 0.999802 | 3.646891 |
9f445690-f9be-4b0c-b253-61e7078766ba | 0-jij-0/CompetitiveProgramming | Problems Archive/1000 - 1999/1993 - Triple.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> v;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int t; cin >> t; while (t--) {
int n; cin >> n; v.resize(n);
for (auto& x : v) { cin >> x; }
vector<int> freq(n + 1);
for (auto& x : v) freq[x]++;
... | ALGO | 0.999652 | 4.811474 |
0e52f351-5024-4e82-b32c-55761aaf99c6 | ivanguillardini/Problemas_adven_of_code_2024 | dia1_arboles/dia1_arbol.cpp |
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
class Nodo {
public:
int valor;
Nodo* izquierda;
Nodo* derecha;
Nodo(int val){
valor=val;
izquierda=nullptr;
derecha=nullptr;
}
};
class ArbolBinario {
private:
Nodo* raiz;
voi... | ALGO | 0.999991 | 5.836408 |
6d939428-537a-4cce-b530-67e56c1ec0e8 | cataratoru-fara-cap/ccpBasics | Lab5/ex4.cpp | #include <iostream>
using namespace std;
const char* getDep(char *p){
while (*p)
{
if (*p == ','){
return p + 2;
}
p++;
}
return nullptr;
}
int main (){
char tab[] = "Slatina, OT";
char *p = &tab[0];
cout << "Department est: " << getDep(p)<< endl;
... | TOOL | 0.969652 | 3.367177 |
93396415-88dd-49d2-9c4a-74b192bb840c | abdallah-shehawey/PS_Assuit_Sheet | Sheet_1/V.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int A,B;
char S;
cin >> A >> S >> B;
if (S == '=')
{
if (A == B)
{
cout << "Right";
}
else
{
cout << "Wrong";
}
}
else if (S == '<')
{
if (A < B)
... | ALGO | 0.999839 | 3.427838 |
e34fd153-d98d-49b5-b375-5a1490aecaaf | dinies/3D-Lidar-Odometry-and-Tracking | src/tests/TestSelfMatchablesSolver.cpp | #include <srrg_system_utils/parse_command_line.h>
#include <srrg_system_utils/system_utils.h>
#include <srrg_system_utils/shell_colors.h>
#include <srrg_qgl_viewport/viewer_core_shared_qgl.h>
#include <srrg_messages/instances.h>
#include <srrg_solver/solver_core/instances.h>
#include <srrg_solver/SE3/instances.h>
#in... | TOOL | 0.956816 | 5.458108 |
19794dff-8076-4c95-aa39-e7285ff93742 | AvanishShukla20/Leetcode-problems | 1029-vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-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.999997 | 6.193142 |
a355c89c-46d4-4a1b-995b-43efb481e5d4 | Anujkumar2017/GFG-Questions | Play With OR - GFG/play-with-or.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
int* game_with_number(int arr[], int n);
int main()
{
int t;cin>> t;
while(t--)
{
int n;
cin >> n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
int *arr2;
... | ALGO | 0.999895 | 4.962976 |
57b406b4-5adf-4d59-abdd-dc8d0d9bd9b1 | DnyaneshwarGaikwad849/Java-Projects | program489.cpp | #include<iostream>
using namespace std;
template <class T>
class ArrayX
{
public:
T *Arr;
int iSize;
ArrayX(int);
~ArrayX();
void Accept();
void Display();
void SelectionSort();
};
template <class T>
ArrayX<T>:: ArrayX(int iNo)
{
this->iSize = iNo;
... | ALGO | 0.999738 | 4.234313 |
0f53d504-54eb-4837-8955-b0440b5ca0e1 | lucasxia01/Competitive-Programming-Problems | Library/Suffix Array/main.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stdlib.h>
#include <time.h>
#include <complex>
#include <iterator>
#include <regex>
#include <fstream>
#include <utility>
#include <vector>
#include <string>
#include <cstring>
#include <stack>... | ALGO | 0.999908 | 3.601134 |
5730dd82-3335-4df9-af23-df44192cf4fd | Moazgamal/LeetCode-Problems | 3916-minimum-time-to-reach-destination-in-directed-graph/3916-minimum-time-to-reach-destination-in-directed-graph.cpp | class Solution {
public:
int minTime(int n, vector<vector<int>>& edges) {
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> q;
q.push({0,0});
vector<int> dist(n,INT_MAX);
int ans = -1;
vector<vector<pair<int,pair<int,int>>>> graph(n);
... | ALGO | 0.999961 | 5.82227 |
175ec10b-d1f7-43d4-a0f8-64d59d20ba75 | hasnain-cyber/competitive-programming | codeforces/decim_and_cobwebs.cpp | #include <bits/stdc++.h>
using namespace std;
bool check(int x, int y, int z) {
for (int value = 1; value <= min(x, min(y, z)); value++) {
priority_queue<int, vector<int>, greater<int>> pq;
pq.push(x);
pq.push(y);
pq.push(z);
bool flag = true;
int counter = 0;
... | ALGO | 0.999929 | 4.611382 |
3659f621-df97-418f-a18e-da1fb9ec491c | AsheeshSharma/C-C-InterviewPrograms | maxDiff.cpp | int maxDiff(int arr[], int n){
int maxDiff;
int i, j;
int *lmin = (int*)malloc(sizeof(int));
int *rmax = (int*)malloc(sizeof(int));
lmin[0] = arr[0];
for(i =1;i<n;i++){
lmin[i] = min(arr[i],arr[i-1]);
}
rmax[0]=arr[n-1];
for(j=n-2;j>=0;j--){
rmax[j] = max(arr[j],arr[j+1]);
}
i = 0;
j = 0;
while(i<n &&... | ALGO | 0.999893 | 5.490835 |
e653a5c7-4030-4ee0-8918-663c44b631dd | fahim1020/dimikOj-Solutions | problem50.cpp |
// dimikoj problem 50
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
string input;
cin >> input;
for (int i = 1; i < input.length() - 1; i++)
{
if (input[i] == 'R')
{
input[i] = input[i + ... | ALGO | 0.999886 | 4.186423 |
ee78f343-28d7-4d0a-a4ac-6e18faedf9d8 | ishandutta2007/codeforces | rednextcentury/normal/813/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define pb push_back
#define S second
#define pi pair<int,int>
#define pii pair<pi,int>
#define go ios::sync_with_stdio(0)
vector<int> adj[200100];
int distr[200100],dista[200100];
void BFS(int s,int dist[])
{
dist[s]=0;
queue<i... | ALGO | 0.998577 | 3.604317 |
2acb84d8-c59c-4609-8f7e-5139bea3afb4 | ritbikbharti/aps-2020 | chnum.cpp | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
int main()
{
int t;
cin>>t;
while(t--)
{
ull i,n,positive=0,negative=0;
cin>>n;
ull a[n];
for(i=0;i<n;i++)
{
cin>>a[i];
if(a[i]>0)
positive++;
if(a[i]<0)
negative++;
}
if(negative==0)
negative=positive;
... | ALGO | 0.999804 | 3.756029 |
b109d065-368a-4318-b144-0c26ddadaf01 | cdgiessen/AdventOfCode2021 | src/day3.cpp | #include <iostream>
#include <vector>
#include <math.h>
#include <string>
const char *input[] = {
#include "inputs/day3.txt"
};
std::string find_common_bitstring(char want_most_common)
{
std::string out = "";
for (int place = 0; place < 12; place++)
{
uint32_t one_count = 0;
uint32_t zero_... | ALGO | 0.999353 | 5.195547 |
a4c489e5-785f-4bdc-a3fc-9c8a46c805cd | r-lyeh-archived/crawler | libs/math/glm/test/gtx/gtx_simd_mat4.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... | TEST | 0.980155 | 6.514801 |
b37d0876-4fdb-4dce-8efd-fa1633daa8df | parth-1372/45-DSA | Day 32/Partstion Equal Subset.cpp |
class Solution {
public:
int equalPartition(int N, int arr[]) {
int totalSum = std::accumulate(arr, arr + N, 0);
if (totalSum % 2 != 0) {
return 0;
}
int target = totalSum / 2;
vector<bool> dp(target + 1, false);
dp[0] = true;
... | ALGO | 0.999992 | 5.700084 |
834699c8-8302-4961-b93a-2c6cd8c0222f | JanKolomaznik/gl_tutorials | 11_opencl/conway.cpp | #include <CL/cl.hpp>
//#include <CL/opencl.hpp>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <sstream>
#include <random>
#include "cl_utils.hpp"
#define STB_IMAGE_IMPLEMENTATION
#include "stb/stb_image.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb/stb_image_write.h"... | ALGO | 0.99168 | 6.238461 |
887b80b0-3fd9-488b-97ce-fda4a193c886 | arash-ha/Cpp | Complex Number Multiplication.cpp | /*
Complex Number Multiplication
A complex number can be represented as a string on the form "real+imaginaryi" where:
real is the real part and is an integer in the range [-100, 100].
imaginary is the imaginary part and is an integer in the range [-100, 100].
i2 == -1.
Given two complex numbers num1 and num2 as string... | ALGO | 0.998864 | 6.335992 |
ef7c6d08-3650-40c0-b615-a608d0e03cc8 | ericguan04/semaforr_ros2 | src/semaforr/src/FORRBarriers.cpp | #include<FORRBarriers.h>
using namespace std;
//----------------------//------------------------//
void FORRBarriers::CreateSegments(vector<LineSegment> &segments, vector<CartesianPoint> position_history, vector < vector <CartesianPoint> > laser_history) {
cout << "num of pos history " << position_history.size() <... | ALGO | 0.999028 | 4.04216 |
f066700b-eb9f-4500-991e-8a2c6c83073e | kmjp/procon | codeforce/701-750/714/c2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999398 | 4.820623 |
43f9cda7-43c8-4678-9898-d7932214aaab | infernus01/DSA | greatest of three.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if(a<b)
{
if(a<c)
{
cout<<"a is the smallest";
}
else
{
cout<<"c is the smallest";
}
}
else if(b<c)
{
cout<<"b is the smallest \n";
... | ALGO | 0.999473 | 3.324566 |
1d86777a-837d-413f-be47-5877589f17a9 | rayko04/EveythingCpp | PF/Functions/sum+avg array.cpp | #include <iostream>
using namespace std;
void getArray(int ar[], int SIZE)
{
for(int i = 0; i < SIZE; i++)
{
cout << "Input value: ";
cin >> ar[i];
}
}
float sumArray(int arr[], int size)
{
float sum1 = 0;
for(int i = 0; i < size; i++)
{
sum1 = sum1 + arr[i];
}
return sum1;
// cout << "\nSum is " << s... | TOOL | 0.948504 | 4.008197 |
f2d4d083-d4f9-4600-bd9a-46a475726a34 | allwinner-ics/platform_external_opencv | cv/src/cvadapthresh.cpp | #include "_cv.h"
static void
icvAdaptiveThreshold_MeanC( const CvMat* src, CvMat* dst, int method,
int maxValue, int type, int size, double delta )
{
CvMat* mean = 0;
CV_FUNCNAME( "icvAdaptiveThreshold_MeanC" );
__BEGIN__;
int i, j, rows, cols;
int idelta = type == CV_... | ALGO | 0.999289 | 6.834167 |
52cf4062-9781-4863-a222-54e8ced419bb | P09s/firebase_login | 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 |
d625d444-78ab-4d91-88e8-74ae22ed993a | minhvpham/codeblock | THI/TICHBASO.cpp | /*
🛸 🌎 ° 🌓 • .°• 🚀 ✯
★ * ° 🛰 °· 🪐
. • ° ★ • ☄
______________________________________________________
You are watching a brute force code
CODE IS WRITTEN BY 13MINUSONE
*/
#include<bits/stdc++.h>
using namespace std;
#define task "TICHBASO"
#define SZ(c)... | ALGO | 0.999493 | 3.886752 |
4efdc0d7-1b2b-4550-9f91-6f2e4803df74 | mrmh-code/My_problem_solution_different_OJ | 1.LeetCode/942. DI String Match.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> diStringMatch(string s) {
int c=0,ln=s.size();
vector<int>v;
for(int i=0; i<s.size(); i++){
if(s[i]=='I'){
v.push_back(c++);
}else{
v.push_back(ln--);
... | ALGO | 0.999419 | 4.385741 |
051570f0-8758-4c89-979e-249c4ee7c7d4 | kugorang/BaekjoonHub | 프로그래머스/0/181883. 수열과 구간 쿼리 1/수열과 구간 쿼리 1.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> arr, vector<vector<int>> queries)
{
for (const auto &query : queries)
for (int i = query[0]; i <= query[1]; ++i)
++arr[i];
return arr;
} | ALGO | 0.999369 | 5.940977 |
e4e20e5d-e3d7-4ea3-b3c0-e000d7eac08a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5468_12.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_M = 200000, MAX_N = 200000;
int n, m;
int a[MAX_N];
int t[MAX_M + 1], r[MAX_M + 1];
int b[MAX_N];
int bl, br;
int main() {
int s;
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++) {
scanf("%d", a + i);
}
s = 0;
for (int i = 0; i < m; i++) {
... | ALGO | 0.999999 | 3.834793 |
13f0213a-f8a3-4a8f-8fb6-82118b05082d | Rahul13022004/DSA-LEETCODE | 84-largest-rectangle-in-histogram/largest-rectangle-in-histogram.cpp | class Solution {
public:
int largestRectangleArea(vector<int>& heights) {
int n = heights.size();
vector<int> nse(n, 0);
vector<int> pse(n, 0);
stack<int> st;
for (int i = 0; i < n; i++) {
while (!st.empty() && heights[st.top()] >= heights[i]) {
st... | ALGO | 0.999969 | 6.701789 |
573162ac-8b28-4357-90b4-a8e103b13dd1 | RandomPolishNpC/prog-Informatyka | lekcja6/zadanie4.cpp | #include<iostream>
using namespace std;
int main(){
int b[10];
int z;
for(int i = 0;i != 10;i++){
cout <<"podaj liczbe nr "<<i+1<<": ";
cin >> b[i];
}
cout <<"liczby parzyste: ";
for(int g = 0;g != 10;g++){
if(0==(b[g]%2)){
cout <<b[g]<<", ";
z += b[g];
}
}
cout <<endl<<"suma liczb parzystych: "<<... | ALGO | 0.998728 | 4.036514 |
84e4b719-086e-48ac-9e03-b20a9653e061 | ishandutta2007/codeforces | wxhtzdy/normal/1393/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
map<int, int> cnt;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
cnt[a[i]]++;
}
int cnt2 = 0, cnt4 = 0;
for (int i = 1; i <= 1e5; i++) {
cnt4... | ALGO | 0.999905 | 4.463123 |
ea75cfd1-b503-47e0-a163-fbc27fca28c5 | dhruviagrawal/leetcode-practise | 103-binary-tree-zigzag-level-order-traversal/103-binary-tree-zigzag-level-order-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.999992 | 6.139262 |
683ea388-e073-421d-937c-1edeb6883534 | t-whiteley/ucl_rocket | airbrakes/control_system/archive/Cpp_model/thirdparty/eigen-3.4.0/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.997399 | 4.874496 |
3e29ccf7-fced-4750-9aeb-ad75cefd82b1 | LAZY-2001/lzy-px4-study | src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel/FlightTaskManualAltitudeSmoothVel.cpp | /**
* @file FlightManualAltitude.cpp
*/
#include "FlightTaskManualAltitudeSmoothVel.hpp"
#include <float.h>
using namespace matrix;
bool FlightTaskManualAltitudeSmoothVel::activate(const vehicle_local_position_setpoint_s &last_setpoint)
{
bool ret = FlightTaskManualAltitude::activate(last_setpoint);
// Check i... | ALGO | 0.974515 | 6.956182 |
ac0bda02-8344-4cb6-87e1-2937b4bd51cb | dwilson3859/riscySimulation | src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_signed/bits_to_bits/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.966945 | 5.590904 |
a7bc9096-ba4c-4872-b3d4-60869f17aa60 | ArcadeCookie/hello_cpp_libs | libs/boost/source/boost_1_79_0/libs/geometry/test/algorithms/closest_points/ar_ar.cpp | // Boost.Geometry
// Unit Test
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
#ifndef BOOST_TEST_MODULE
#define BOOST_TEST_MODULE test_closest_points_areal_areal
#endif
#include "common.hpp"
#include "empty_geometry.hpp"
namespace bg = boost::geometry;
//=============================... | TEST | 0.985525 | 7.627928 |
2b905925-2138-4d82-8f16-a8fa6fcb0b3e | Asa-to/c-prac | aoj/quickSort.cpp | #include <bits/stdc++.h>
using namespace std;
vector<pair<char, int> > A(100009);
vector<pair<char, int> > B(100009);
int n;
void merge(int left, int mid, int right){
int n1 = mid - left;
int n2 = right - mid;
vector<pair<char, int> > L(n1+1);
vector<pair<char, int> > R(n2+1);
for(int i = 0; i < ... | ALGO | 0.999933 | 4.18563 |
dbe98a4d-e105-4ec5-a4cf-cd3ac6f0ca9c | hieupham1103/TINHOC | OI/VOI/VOI 15/reform.cpp | #include"bits/stdc++.h"
#define int long long
#define double long double
#define ii pair <int,int>
#define fi first
#define se second
#define endl '\n'
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
using namespace std;
const int maxN = 2e5 + 10;
int n,m;
vector <int> adj[maxN];
int num[maxN];... | ALGO | 0.999789 | 4.633187 |
c6322be2-8a55-4350-9044-4148e996bb97 | dkupchyk/PP | 05Lab/functions.cpp | #include <stdlib.h>
#include <cassert>
#include <iostream>
using namespace std;
void fillArray(double* coeff, size_t size){
for (unsigned int i = 0; i < size; i++) {
coeff[i] = (double)(rand() / (double(RAND_MAX) + 1.0) - rand() % 2) * 10 ;
}
}
//Counting sum when x = -1 or x = 1
double sum(double* coeff, size_t ... | ALGO | 0.9997 | 3.876373 |
3f1695e7-1612-451f-85fa-0a25eed1149d | yuanyan/know-your-chrome | Blink/Source/core/platform/graphics/StringTruncator.cpp | #include "config.h"
#include "core/platform/graphics/StringTruncator.h"
#include "core/platform/graphics/Font.h"
#include "core/platform/graphics/TextRun.h"
#include "core/platform/text/TextBreakIterator.h"
#include <wtf/Assertions.h>
#include <wtf/unicode/CharacterNames.h>
#include <wtf/Vector.h>
namespace WebCore {... | TOOL | 0.944931 | 7.249536 |
7a73147e-bb15-4da0-8f4c-2209ce4d410d | jainakshay/codechef | Google Codejam 2016/codejam 1b/B.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
char c[20],j[20];
cin>>c>>j;
int i=0;
bool val=false;
while(c[i]=='?' && j[i]=='?')
{
c[i]='0';
j[i]='0';
i++;
val=true;
}
while(i<strlen(c))
{
int k=i;
int cou... | ALGO | 0.999978 | 3.195261 |
d4f80ebb-fe05-42d4-97f9-5c8adc49503d | JaeNew/Leetcode-MySubmit | 189.旋转数组.cpp | /*
* @lc app=leetcode.cn id=189 lang=cpp
*
* [189] 旋转数组
*
* https://leetcode-cn.com/problems/rotate-array/description/
*
* algorithms
* Easy (36.60%)
* Total Accepted: 40.4K
* Total Submissions: 109.6K
* Testcase Example: '[1,2,3,4,5,6,7]\n3'
*
* 给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。
*
* 示例 1:
*
* ... | ALGO | 0.99999 | 5.855935 |
80d5ccf5-e41f-4190-afb8-525c02d0aaae | rootbKim/planar_robot_pkgs | src/Eigen/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A ... | ALGO | 0.999387 | 3.846247 |
93a086d9-58db-4f38-a4aa-ef74a009185b | ReiAccept/Algorithm | cf/50A.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int m,n;
int main()
{
cin>>m>>n;
if(m%2==0) cout<<(m/2)*n<<endl;
else if(n%2==0) cout<<(n/2)*m<<endl;
else
{
if(n>m) swap(m,n);
int ans=m*((n-1)/2);
ans+=((m-1)/2);
cout<<ans<<endl;
}
return 0;
}
| ALGO | 0.999974 | 3.329822 |
914400ff-628c-4769-934f-164e8487b365 | HemaGarima/DSA-Cpp | Program1.cpp | #include<iostream>
using namespace std;
void func1(int array[] , int length ){
int sum = 0;
int product = 1;
for(int i = 0 ; i<length ; i++){
// cout<<array[i]<<endl;
sum += array[i];
}
for(int i = 0;i<length ; i++){
product *= array[i];
}
}
int main(){
int... | ALGO | 0.99867 | 4.046587 |
0fe59a22-a77c-46a5-9c49-4549ecfc4391 | unm7925/BaekJoon | 2920.cpp | #include <iostream>
#include <array>
using namespace std;
int main()
{
// 다장조는 c d e f g a b C, 총 8개 음으로 이루어져있다.
// 이 문제에서 8개 음은 다음과 같이 숫자로 바꾸어 표현한다.
// c는 1로, d는 2로, ..., C를 8로 바꾼다.
// 1부터 8까지 차례대로 연주한다면 ascending ... | ALGO | 0.999929 | 3.716764 |
e820db24-4207-4c91-b68e-2fd55957a3f5 | suxutao/LeetcodeList | cn/330-patching-array .cpp | #include "../../../stdc.h"
using namespace std;
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
public:
int minPatches(vector<int>& nums, int n) {
long long N=nums.size(),ans=0,sum=1;
for (int i = 0; i < N&&sum<=n; ++i) {
while (nums[i]>sum&&sum<=n){
... | ALGO | 0.999944 | 6.101282 |
8af33f13-d515-4fb1-b640-7301c925220c | aprgproject/aprg_sandbox | CodingCompetitions/GoogleCodeJam/GoogleCodeJam/tst/2019/Round2/CodeJam_2019_Round2_P2_PotteryLottery_unit.cpp | #include "CodeJam_2019_Round2_P2_PotteryLottery.hpp"
#include <Fake/FakeObjects.hpp>
#include <gtest/gtest.h>
using namespace alba;
using namespace std;
namespace CodeJam_2019_Round2_P2_PotteryLottery {
TEST(CodeJam_2019_Round2_P2_PotteryLotteryTest, Test1) {
stringstream& inputStringStream(FakeObjects::getInst... | TEST | 0.968144 | 3.368199 |
731dd237-1b7b-4795-8fc4-0fe96e4a6b93 | ishandutta2007/codeforces | chenkuowen/normal/1305/F.cpp | //by chenkuowen01
/*-------------------Intialize Module--------------------*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
/*-------------------Basis Functions----------------------*/
template<class T> inline void dmin(T& x... | ALGO | 0.999882 | 3.576379 |
1f738c00-7408-4189-ae3c-47bb627834c0 | ericliuu/flux | FLUX/flang/runtime/extrema.cpp | // Implements MAXLOC, MINLOC, MAXVAL, & MINVAL for all required operand types
// and shapes and (for MAXLOC & MINLOC) result integer kinds. Also implements
// NORM2 using common infrastructure.
#include "reduction-templates.h"
#include "flang/Runtime/character.h"
#include "flang/Runtime/float128.h"
#include "flang/Ru... | ALGO | 0.996809 | 6.985521 |
bc6d5218-e4ae-48b3-a67b-1ae14c25c874 | abhi-pandey6/Coding-Practice-with-C-- | Practice Problems/53calcu10!.cpp | // 53: Calculate 70! with High Precision
#include<iostream>
using namespace std;
int main (){
int n;
cout<<"Enter a number: ";
cin>>n;
int factorial = 1;
for(int i=1; i<=n; i++){
factorial = factorial * i;
}
cout<<factorial<<endl;
return 0;
}
| ALGO | 0.999811 | 3.975626 |
af2e4864-a247-4e3c-9804-f070fb90801e | tar3q-az1z/Codeforces-solutions | 1194A.cpp | #include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<stack>
#include<queue>
#include<cstdio>
#include<set>
#include<unordered_set>
#include<cmath>
#include<algorithm>
#include<functional>
#include<utility>
#include<cstdlib>
using namespace std;
typedef long long int lli;
typedef size_t idx;
#... | ALGO | 0.99596 | 3.75628 |
70caf0d9-fcd5-47a9-9d31-374998725773 | jo3-l/cp-practice | src/main/cpp/ccc/2013/time_on_task.cpp | #include <bits/stdc++.h>
using namespace std;
constexpr int MC = 100;
int chores[MC];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t, c;
cin >> t >> c;
for (int i = 0; i < c; i++) cin >> chores[i];
sort(begin(chores), begin(chores) + c);
int i, s = 0;
for (i = 0; ... | ALGO | 0.999979 | 4.695416 |
d3b6384f-7069-47df-b040-b8c4d1d9a899 | Maheer1207/LeetCode-Problems | Intersection of Two Linked Lists/Solution.cpp | // Question:
#include <iostream>
#include <iterator>
#include <list>
using namespace std;
class ListNode {
public:
int val = 1;
ListNode* next;
};
void push(ListNode** head_ref, int new_data)
{
/* allocate node */
ListNode* new_node = new ListNode();
/* put in the val */
new_node->val = ... | ALGO | 0.999697 | 4.990133 |
a1f8c1e1-8af4-4746-8abc-876e56746b3c | ubports/ubuntu-app-launch | libubuntu-app-launch/application-icon-finder.cpp | #include "application-icon-finder.h"
#include <regex>
namespace ubuntu
{
namespace app_launch
{
namespace
{
constexpr auto ICONS_DIR = "/icons";
constexpr auto HICOLOR_THEME_DIR = "/icons/hicolor";
constexpr auto HUMANITY_THEME_DIR = "/icons/Humanity";
constexpr auto THEME_INDEX_FILE = "index.theme";
constexpr auto AP... | TOOL | 0.913055 | 6.635756 |
c8b7ee99-5828-4b22-8465-befc11433c2d | siddharthtashildar/CodeFiles | cpp/mergeSort.cpp | #include <bits/stdc++.h>
using namespace std;
void merge(vector<int> &arr, int low, int mid, int high) {
vector<int> temp;
int left = low;
int right = mid + 1;
while (left <= mid && right <= high) {
if (arr[left] <= arr[right]) {
temp.push_back(arr[left]);
left... | ALGO | 0.999973 | 5.023468 |
89fc0792-0cf0-45ef-bbe1-0009c48fbbad | naman-ked/codeit | Arrays/pairs-With-Difference-K.cpp | class Solution {
public:
/* Returns count of pairs with difference k */
int countPairsWithDiffK(vector<int>& arr, int k) {
// code here
int n = arr.size();
int count=0;
unordered_map<int,int> s;
s.insert({arr[0],1});
for(int i=1;i<n;i++){
int diff =... | ALGO | 0.999746 | 5.681354 |
4110e88a-0ac1-4388-b0d6-b37a32c05123 | abhishek18124/LVCPPJan2025 | LVCPPJan2025/Lecture 19/01 - String Problem Solving/006Strings_Optimised2.cpp | #include<iostream>
#include<string>
using namespace std;
int main() {
string str = "ababbaab";
int n = str.size();
// time : O(n)
// space: O(1)
int rudeness = 0;
int cnt_b = 0; // to track no. of b's we've seen in the suffix scanned so far
for (int i = n - 1; i >= 0; i--) {
char ch = str[i];
if (ch == ... | ALGO | 0.995177 | 4.75503 |
2e48b009-25db-473c-9432-061ed3ce4d20 | Nakib-Arman/CSE318---ArtificialIntelligence | 2105128/.history/2105128_20250722121519.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
int column_num;
string label;
unordered_map<string,Node*> children;
float threshold;
public:
Node(int column_num){
this->column_num = column_num;
this->label = "";
this->threshold = 0;
}
Node(string labe... | ALGO | 0.996848 | 4.930734 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.