uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
958df8c0-69ef-4d5c-a282-890f82d824b4 | AbdulGh/synth-project | synth/stk/BlitSquare.cpp | /***************************************************/
/*! \class BlitSquare
\brief STK band-limited square wave class.
This class generates a band-limited square wave signal. It is
derived in part from the approach reported by Stilson and Smith in
"Alias-Free Digital Synthesis of Classic Analog Wavefo... | TOOL | 0.973469 | 6.196723 |
a2f7c33d-f673-468e-ae68-bee2d42d341b | hrushikesht/CompetitiveProgramming | old/cf395/cube.cpp | #include <bits/stdc++.h>
#include <unordered_map>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define i64 long long int
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(i64 i=0;i<(n);i++)
#define FOR(i,a,b) for(i64 i=(a);i<=(b);i++)
#define FORD(i,a,b) for(i6... | ALGO | 0.999977 | 3.505554 |
1e49fd3e-3fcf-4931-83ed-a99c1a939bf3 | tvnikhil/LeetCode_Solved_Problems | DiameterOfTree_sol1.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <iterator>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
usi... | ALGO | 0.999868 | 5.682319 |
ea8fc085-5ab4-4308-ac15-a0d930e4984f | tanvisaxena1901/leetcode | Topological sort - GFG/topological-sort.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to return list containing vertices in Topological order.
// vector<int> ans;
// vector<int> inorder(V, 0);
// for(int i=0; i< V; i++){
// for(auto c: adj[i]){
// ... | ALGO | 0.999937 | 6.791318 |
efced801-2506-4688-a2eb-0b222894d356 | abdelaleem024/LeetCode-Problems-Solutions | 2509-cycle-length-queries-in-a-tree/2509-cycle-length-queries-in-a-tree.cpp | class Solution {
int lvl(int u) {
return 31 - __builtin_clz(u);
}
int LCA(int u, int v) {
int a = lvl(u), b = lvl(v);
while (a > b)u >>= 1, --a;
while (a < b)v >>= 1, --b;
while (u != v) u >>= 1, v >>= 1, --a;
return u;
}
public:
vector<int> cycleLengthQueries(int n, vector<vector<in... | ALGO | 0.99929 | 5.274025 |
0d45c38c-5d81-47fc-95c8-1b8409f3ee06 | joojae02/Algorithm | BaekJoon/다이나믹플밍/1463.cpp | #include<iostream>
#include<vector>
#include <algorithm>
#include<cmath>
#define _CRT_SECURE_NO_WARNINGS
using namespace std;
int N;
int P[1000001] = {0,};
int main(void){
scanf("%d", &N);
P[2] = 1;
P[3] = 1;
for(int i=4; i<=N; i++){
int tmp = 0;
P[i] = P[i - 1] + 1;
if(i%2 ==... | ALGO | 0.999985 | 3.928516 |
11b00598-df97-4dfd-ba4a-98135ffb80af | varvelworld/PAT-Solution | PAT-Advanced-Level-Practise/1081/1081.cpp | #include <cstdlib>
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <cmath>
using namespace std;
long compute_gcd(long a, long b)
{
if(a > b)
swap(a, b);
long c = b % a;
while(c != 0)
{
b = a;
a = c;
c = b % a;
}
return a;
}
i... | ALGO | 0.999839 | 5.210593 |
ff751461-0e5c-402b-bfec-8e8be7889b19 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt4/Codenet/p00711/185975921/response_6.cpp | #include <cstdio>
#include <stack>
using namespace std;
#define rep(i, x) for (int i = 0; i < (int)(x); ++i)
int dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, -1, 1};
char mp[20][22];
int H, W;
void dfs(int y, int x) {
stack<pair<int, int>> stk;
stk.push({y, x});
while (!stk.empty()) {
auto [cy, cx] = stk.top();
s... | ALGO | 0.999005 | 3.98903 |
31e6d8ab-3f17-415e-bfaa-772b7f0dfe83 | Deepak-Jha-2025/LeetCode_Practice | 1677-matrix-diagonal-sum/matrix-diagonal-sum.cpp | class Solution {
public:
int diagonalSum(vector<vector<int>>& mat) {
// Straight away implementation based
// Only one solution => Optimal solution
// T.C: O(n)
// S.C: O(1)
int n = mat.size();
int diagSum = 0;
for(int i=0; i<n; i++) {
diagSum += ... | ALGO | 0.999968 | 6.267468 |
286e81ca-8363-4814-9380-602c8771e1ed | StudyingFather/my-code | luogu/6623.cpp | // Problem : P6623 [省选联考 2020 A 卷] 树
// Contest : Luogu
// URL : https://www.luogu.com.cn/problem/P6623
// Memory Limit : 512 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <iostream>
#include <vector>
using namespace std;
int v[600005],n;
int a[2500005][25];
vector<... | ALGO | 0.999918 | 4.030344 |
f23b46db-9aa8-44ea-9c04-115da2bf2ddb | qiyancos/gem5-with-chinese-comment | src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_unsigned/promote/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.957461 | 5.756129 |
325a0bef-1e70-4508-8ba5-c960335a50e9 | Dibyajyoti-13/Assignment | Day_41/2.cpp | #include <iostream>
using namespace std;
int fibonacci(int n) {
if (n <= 1) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
int main() {
int n;
cout << "Enter a number: ";
cin >> n;
cout << "Fibonacci number at position " << n << " is " << fibonacci(n) << endl;
return 0;
}
| ALGO | 0.999451 | 5.338978 |
547d0959-0fbc-43f1-aca5-f78d89059a1a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_2074_0.cpp | #include <iostream>
using namespace std;
int josephus(int n, int k){
if(n==1) return 0;
return (josephus(n-1,k)+k)%n;
}
int main(){
while(1){
int n,k,m;
cin >> n >> k >> m;
if(n==0) break;
cout << (josephus(n-1,k)+m)%n + 1 << endl;
}
return 0;
} | ALGO | 0.999989 | 3.653696 |
7c1ca369-327c-4489-9e4e-c0d415e0228e | yaap/frameworks_av | media/module/codecs/amrnb/enc/src/cbsearch.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/cbsearch.c
Functions: D_plsf_3
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description:
(1) Removed "count.h" and "basic_op... | ALGO | 0.999985 | 6.073621 |
125ed9c9-57a7-4cb0-93d3-52549f779eb1 | AYUSHRAJ6623/MyCodes | Func_prime.cpp | #include<iostream>
#include<math.h>
using namespace std;
bool isprime(int num){
for(int i=2;i<=sqrt(num);i++){
if(num%i==0){
return 0;
}
}
return 1;
}
int main(){
int n;
cout<<"Enter a number :-";
cin>>n;
cout<<(isprime(n)?"PRIME":"NON-PRIME");
return 0;
} | ALGO | 0.999343 | 3.661052 |
619edbac-4c6e-4dcf-a257-2055f14c3e75 | shokuyansh/codeforces | drinks200B.cpp | #include<iostream>
#include<vector>
using namespace std;
int main()
{
int n;
cin>>n;
vector <int> p;
for(int i=0;i<n;i++)
{
int input;
cin>>input;
p.push_back(input);
}
double result=0;
double sum=0;
for(int i=0;i<n;i++)
{
sum+=p[i];
}
... | ALGO | 0.997018 | 3.689928 |
45778ba9-abf0-4a02-ac8a-6b89afd9b9e0 | amarjilani/chem279_final | qr.cpp | #include "qr.h"
/// @brief Performs Householder tridiagonalization on a symmetric matrix A inplace
/// @param A symmetric matrix
void householder(arma::mat& A) {
int n = A.n_rows;
for (int k = 0; k < n - 2; k++) {
arma::vec x = A.submat(k + 1, k, n - 1, k);
double alpha;
... | ALGO | 0.999933 | 6.139365 |
599259c8-e7fc-4379-acce-1a27eca5c3a5 | Eeman1113/Leetcode | Problems/2284.cpp | class Solution {
public:
int rearrangeCharacters(string s, string target) {
int ans = s.length();
vector<int> countS(128);
vector<int> countT(128);
for (const char c : s)
++countS[c];
for (const char c : target)
++countT[c];
for (const char c : target)
ans = min(ans, coun... | ALGO | 0.999297 | 6.43102 |
05adf686-cd8f-4839-afd4-91efcb642a86 | raincross7/code-similarity | codes/train_code/problem030/problem030_456.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int64_t N, A, B;
cin>>N>>A>>B;
int64_t ans=N/(A+B)*A;
int64_t amari = N%(A+B);
if(amari<=A){
ans += amari;
}
else{
ans += A;
}
cout<<ans<<endl;
} | ALGO | 0.999902 | 3.668323 |
2a78eb42-957b-4193-8f4b-81da28ae9663 | Keaton11/Graphical-Sorting | Graphical Sorting/playFunctions.cpp | /* Name: Keaton Lee
* Date: June 18, 2021
* Title: Graphical Sorting
*
* Description: Contains the main play function which allows users to select
* which algorithm they would like to run
*/
// imports header files
#include "header.h"
#include <allegro5/allegro.h>
#include <allegro5/allegro_font.h>
#include ... | ALGO | 0.983832 | 4.269576 |
ead40dbf-3952-4fd9-9bf9-e8861c90bbc9 | huudung0607/Tham-lam | Sắp đặt xâu ký tự.cpp |
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <climits>
#include <iomanip>
#include <string>
#include <sstream>
#include <queue>
#include <stack>
#include <unordered_map>
using namespace std;
int main()
{
string s; cin >> s;
map... | ALGO | 0.999992 | 4.092361 |
bb3ecf29-8ead-4d87-81ac-b25324bb1e9e | maybegreat48/SC-CL | llvm-14.0.0.src/tools/clang/test/SemaCXX/constexpr-factorial.cpp | // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s
constexpr unsigned oddfac(unsigned n) {
return n == 1 ? 1 : n * oddfac(n-2);
}
constexpr unsigned k = oddfac(123);
using A = int[k % 256];
using A = int[43];
| ALGO | 0.987379 | 6.445701 |
10bc8065-8b40-40f0-a52c-435b84192bef | deeckowy/II-UWr | AnalizaNumerycznaL/lista4/zadanie4/zadanie4.cpp | #include <iostream>
#include <cmath>
double fun(double x)
{
return pow(x,2.0)-2.0*cos(3.0*x-1.0);
}
double bisection(double abound,double bbound,int desc)
{
if(desc)
{
double help=abound;
abound=bbound;
bbound=help;
}
double m=0.0;
for(int i=0;i<16;i++)
{
m=... | ALGO | 0.99999 | 4.627587 |
e442807d-bdfe-4479-9a77-2bcaf2268f57 | abhisheksuman413/A2Z_DSA_Course_Sheet | 01_Learn the basics/Lec_01_02_Patterns/Question_16.cpp |
#include <bits/stdc++.h>
using namespace std;
/*
A
BB
CCC
DDDD
EEEEE
FFFFFF
GGGGGGG
*/
void print1(int n)
{
for (int i = 0; i < n; i++)
{
char a = 65+i;
for (int j = 0; j < i + 1; j++)
{
cout << a;
}
cout << endl;
}
// Striver code
// for... | ALGO | 0.999933 | 4.40012 |
931b9e09-e956-4668-99e4-6106c929089b | mohitdtumce/Competitive-Coding | InterviewBit/Arrays/merge-intervals.cpp | #include <bits/stdc++.h>
using namespace std;
struct Interval
{
int start;
int end;
Interval() : start(0), end(0) {}
Interval(int s, int e) : start(s), end(e) {}
};
bool overlapping(Interval a, Interval b)
{
if (a.start > b.end || a.end < b.start)
return false;
return true;
}
Interval... | ALGO | 0.999887 | 5.137746 |
368cfe41-39aa-441a-9997-62e0f0adae3b | esl000/CustomUE4VolumeRaymarching | Engine/Source/ThirdParty/PhysX3/PhysX_3.4/Source/PhysXExtensions/src/ExtSphericalJointSolverPrep.cpp | #include "ExtSphericalJoint.h"
#include "ExtConstraintHelper.h"
#include "CmConeLimitHelper.h"
#include "CmRenderOutput.h"
namespace physx
{
namespace Ext
{
PxU32 SphericalJointSolverPrep(Px1DConstraint* constraints,
PxVec3& body0WorldOffset,
PxU32 /*maxConstraints*/,
PxConstraintInvMassScale &invMassScale,
c... | TOOL | 0.905174 | 6.193104 |
ab60d5b8-e6b2-4b1c-b671-3e96ca27415f | andejerv/bb_mpc | src/object.cpp | #include "object.h"
#include <iostream>
#include <cmath>
namespace sbmpc{
Object::Object(double _x, double _y, double s, double collisionDist, double safeDist)
:type(object_type::STATIC), x(_x), y(_y), size(s), collisionDistance(collisionDist), safeDistance(safeDist), velocity(0), heading(0)
{
// Constructor
}
O... | TOOL | 0.922964 | 5.700851 |
c2aa28d0-db3f-45e8-85fb-b92427a133ef | savirsingh/dmoj-solutions | ccc22j1.cpp | // code by savir singh
#include <iostream>
using namespace std;
int main(){
int x;
int y;
int z;
cin >> x;
cin >> y;
z = 8*x+3*y;
cout << z-28;
return 0;
}
| ALGO | 0.999192 | 3.054957 |
46532e16-d6ab-454b-b65e-1cdd0830aa80 | le-incroyable1-dev/dsa_archive | sar_phod_lo_apna_idhar/bit/stacks_and_queues/hotelService.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
typedef long long ll;
typedef long double ld;
#define pii pair<ll,ll>
#define vi vector< int >
#define vvi vector< vi >
#define vpi vector< pii >
#define vvpi vector< vpi >
... | ALGO | 0.99935 | 3.688648 |
bc4e97ec-1c9c-4d83-b2dd-4d7b498fd969 | heiyanbin/leetcode | 347 Top K Frequent Elements_2.cpp | // 347
// Top K Frequent Elements
// https://leetcode.com//problems/top-k-frequent-elements/
class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
unordered_map<int, int> m;
for (auto num : nums) m[num]++;
priority_queue<pair<int, int>> pq;
for (auto ... | ALGO | 0.999974 | 6.128806 |
d851ea19-2f95-4b0e-a208-17d30f5fbfd6 | salma234-del/leet-code | 2191-sort-the-jumbled-numbers/2191-sort-the-jumbled-numbers.cpp | class Solution {
static bool comp(pair<int, pair<int, int>>& a, pair<int, pair<int, int>>& b){
if(a.second.second == b.second.second) return a.second.first < b.second.first;
return a.first < b.first;
}
public:
vector<int> sortJumbled(vector<int>& mapping, vector<int>& v) {
v... | ALGO | 0.999992 | 5.826048 |
09930a6c-a211-42ad-b0cb-df1e01c28ebd | Danielafe7GitHub/AlgoritmosParalelos | Capitulo 5/OPenHistogram.cpp | #include <iostream>
#include <vector>
#include <omp.h>
using namespace std;
int threads = 3;
int a,b,c = 0;
vector<int> doChunks(string subCadena)
{
int a,b,c;
vector<int> numCaracteres;
for(int i=0; i<subCadena.size();i++)
{
if(subCadena[i] == 'a')
a++;
if(subCadena[i] == '... | ALGO | 0.9992 | 3.579418 |
39d269e4-ea94-43f7-8b53-1603cd49a481 | skwerner/blender | source/blender/physics/intern/BPH_mass_spring.cpp | /** \file blender/physics/intern/BPH_mass_spring.cpp
* \ingroup bph
*/
extern "C" {
#include "MEM_guardedalloc.h"
#include "DNA_cloth_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_force.h"
#include "DNA_object_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "BLI_math... | ALGO | 0.998413 | 7.045506 |
3c824546-bb9f-4947-9418-750f06f22dc7 | wangwwno1/Project-VIMU | src/lib/controllib/BlockLowPass2.cpp | /**
* @file blocks.cpp
*
* Controller library code
*/
#include <math.h>
#include <float.h>
#include "blocks.hpp"
namespace control
{
float BlockLowPass2::update(float input)
{
if (!PX4_ISFINITE(getState())) {
setState(input);
}
if (fabsf(_lp.get_cutoff_freq() - getFCutParam()) > FLT_EPSILON) {
_lp.set_c... | ALGO | 0.887973 | 5.698451 |
dd9370de-4667-4ac8-86a7-3fae5622743d | piotr-nogalski/basics | loop/src/312.cpp | #include <iostream>
int main()
{
int x=1,sum=0;
while(x<=100)
{
if(x%2==0){sum+=x;}
x++;
}
std::cout<<sum<<std::endl;
return 0;
} | ALGO | 0.998587 | 4.24498 |
79db27b6-be22-4267-990d-5b94c5a0439c | Ashutosh-Karmakar/DSA | PRACTICE_DSA/GRAPH/BFS.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
class Graph{
vector<int> *adj;
bool *vis;
int V;
public:
Graph(int V);
void addEdge(int from,int to);
void printEdge();
void BFS(int s);
};
Graph::Graph(int V){
this->V = V;
adj = new vector<int>[V+1];
v... | ALGO | 0.999889 | 4.645298 |
ec39f9e6-17c8-4c5f-8dac-4a8572e6ff29 | EmonZaman/CODEFORCES | A - I'm bored with life.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
scanf("%d %d", &a, &b);
int minimum=min(a,b);
int ans=1;
for(int i=1;i<=minimum;i++)
ans=ans*i;
cout<<ans<<endl;
return 0;
}
| ALGO | 0.999939 | 4.179323 |
982e473c-c3cc-4dac-b910-bfcc50e78f7f | areian13/PS_BOJ | 1. Bronze/Bronze 3/[B3] 25246 Brexiting and Brentering.cpp | #include <iostream>
#include <string>
#define FastIO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
using namespace std;
bool IsMo(char c)
{
return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
string Ntrylize(string& s)
{
int n = s.size();
string result = s;
for... | ALGO | 0.998282 | 3.774832 |
130a42d6-a400-4303-b2a0-779b618ed65c | amitkumar3968/box2d | Box2D/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp | #include <Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <new>
b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->Allocate(... | TOOL | 0.951836 | 6.885304 |
e7f2be37-198f-4c10-8856-075b5d666d3b | RutvikRJ6800/DSandAlgo | Leetcode/134_Gas_Station.cpp | class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int n = gas.size();
vector<int> diff(n, 0);
int totalGas = 0, totalCost=0;
for(int i=0; i<n; i++){
diff[i] = gas[i] - cost[i];
totalGas += gas[i];
totalCost += c... | ALGO | 0.999988 | 5.962035 |
653ca04a-2726-4b17-9158-bab335db3508 | geckobike/otp2 | gluts/terrain/terrain.cpp | #include <time.h>
#include <sys/time.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "engine/engine.h"
#include <GL/gl.h>
#include <GL/glut.h>
#ifdef _MSC_VER
#pragma warning(disable:4244 4305) // for VC++, no precision loss complaints
#endif
#define rnd rand
#define MAX(x,y... | TOOL | 0.866637 | 3.149832 |
9c62ada0-fa85-4617-8177-0e65b23cd368 | OLR-xray/OLR-3.0 | src/3rd party/nvtt/src/nvmath/SphericalHarmonic.cpp | // This code is in the public domain -- <EMAIL>
#include <nvmath/SphericalHarmonic.h>
using namespace nv;
namespace
{
// Basic integer factorial.
inline static int factorial( int v )
{
if (v == 0) {
return 1;
}
int result = v;
while (--v > 0) {
result *= v;
}
return result;
}
// Double fa... | TOOL | 0.999169 | 6.800396 |
0e3b8f5c-66c5-46b8-a4f8-c716603ea090 | eshernan/parallel_course | cuda/cpu.cpp | #include "mmult.h"
void mmult(int m, int n, int k, const float * a, const float * b, float * c)
{
for (int i = 0; i < m; ++i)
{
for (int j = 0; j < k; ++j)
{
c[i * k + j] = 0;
for (int l = 0; l < n; ++l)
c[i * k + j] += a[i * n + l] * b[l * k + j];
... | ALGO | 0.999003 | 3.340358 |
8426535d-83e1-4024-99bc-28392310bc89 | donaldcolin/currency | 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 |
27204581-b225-4bf1-8a5b-57ae7026884e | ChoiJangSeop/codenet-c-cpp-codeql-test | cpp/s177569730.cpp | #include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int N, r;
scanf("%d", &N);
int A[N];
int B[N];
for(r=0; r<N; r++){
scanf("%d", &B[r]);
A[r] = B[r];
}
sort( A, A+N );
for(r=0; r<N; r++){
if(B[r] == A[N-1]) printf("%d\n", A[N-2]);
else printf("%d\n", A[N-1]);
}
retur... | ALGO | 0.999956 | 3.27362 |
42815a2f-f0f8-4cfd-8c47-0bae8e8bfdcd | joseph-seph88/CppJoseph88 | practice/ch04/Joseph88/joseph_4-14.cpp | // #include <iostream>
// #include <string>
// #include <cstdlib>
// using namespace std;
// class Player{
// string name;
// public:
// Player(string name) {this->name = name;}
// string getName() {return name;}
// void setName(string& name) {this->name = name;}
// };
// class GamblingGame{
// Pl... | ALGO | 0.987025 | 4.757054 |
6cf401db-a5cc-467d-8bfe-1623c26c38a9 | CharlesSaya/rayTracingEngine-Cpp | lib/glm/test/core/core_func_integer_find_msb.cpp | #include <glm/glm.hpp>
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
int pop(unsigned x) {
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0... | ALGO | 0.998192 | 3.533907 |
b970d98b-6813-49a9-b9a2-763e26f65a47 | ParabolicMinds/ParaJK | codemp/sys/snapvector.cpp | #include <math.h>
#if _MSC_VER
# include <float.h>
# pragma fenv_access (on)
#else
# include <fenv.h>
#endif
#if _MSC_VER
static inline float roundfloat(float n)
{
return (n < 0.0f) ? ceilf(n - 0.5f) : floorf(n + 0.5f);
}
#endif
extern "C"
void Sys_SnapVector(float *v)
{
#if _MSC_VER
unsigned int oldcontrol;
unsig... | ALGO | 0.989873 | 5.580644 |
51e3795d-d266-4ae3-9a4f-5b496e807f59 | emilan/hockey.server | Puck.cpp | #include "Puck.h"
#include "ObjectTracker.h"
#include "CamCapture.h"
#include "Limits.h"
#include "HockeyGame.h"
#include "Gametime.h"
#include "cv.h"
#include <process.h>
#include <vector>
using namespace std;
#define DISTANCETOGOAL 315
#define PUCKHISTORY 100
namespace puck_private {
CamCapture *capture;
Obj... | TOOL | 0.872124 | 4.872281 |
237e402c-8c7b-47d7-9d31-ea6ed6a5d31b | Apurva-tech/LeetCode | swapping-nodes-in-a-linked-list/swapping-nodes-in-a-linked-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) {}
* };
*/
#include <bits/stdc++.h>
class Solution {
public:
... | ALGO | 0.999999 | 5.74481 |
4aa51d77-1df3-44d5-a957-36dadefd51ab | pnthi160403/compettive_programming | algo/string/trie.cpp | #include <bits/stdc++.h>
#define ll long long
#define infInt (int)1e9 + 1
// #define infLL 0x3f3f3f3f3f3f
#define infLL (int)1e17
#define vt vector<int>
#define vtt vector<vt>
#define vttt vector<vtt>
#define vtttt vector<vttt>
#define pii pair<int, int>
#define vpii vector<pii>
#define endl '\n'
#define all(a) a.begin... | ALGO | 0.999731 | 4.856621 |
4f28d58b-1b73-4c15-b939-8d0ed02f01fb | NilsonCesar/cp_solutions | cses/graph_algorithms/building_roads.cpp | #include <bits/stdc++.h>
using namespace std;
void mainIO(string s = "") {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
if (s.size()) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
}
int n, m;
vector<vector<int>> g;
vector<int> sg;
vector<int> labels, vis... | ALGO | 0.999988 | 4.51181 |
36527458-109f-4225-a975-73343d636811 | virpariyamalay/DSA | basic math/isprime.cpp | #include<iostream>
#include<bits/stdc++.h>
#include<vector>
using namespace std;
class Solution {
int count=0;
public:
bool isPrime(int x) {
for(int i=1;i<=x;i++)
{
if(x%i==0)
{
count++;
}
}
if(count==2)
{
... | ALGO | 0.999801 | 4.423077 |
73bb1c2b-7f8c-429f-a19b-6e8b8481332d | E-O-H/OpenGL-interactive-physics-simulation-old-version | ext/eigen/bench/benchVecAdd.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
#ifndef SIZE
#define SIZE 50
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef float Scalar;
__attribute__ ((noinline)) void benchVec(Scalar* a, Scalar* b, Scalar* c, int size);
__attribute__ ((noinline)) void be... | TOOL | 0.888471 | 5.111393 |
d28b4992-d2ec-4fcd-bffc-0ffbfb5171c2 | gagandeepahuja09/Greedy-Algorithm | Codeforces/372A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; i++)
cin >> a[i];
sort(a.begin(), a.end());
int j = n / 2, ans = n;
int pos = -1;
for(int i = 0; i < n / 2; i++) {
while(j ... | ALGO | 0.999733 | 4.073576 |
e61d2f10-6a6a-4190-aa45-fb77e85c54f1 | metamong123/2022Capstone_AutoDriving | robot_pose_ekf/src/odom_estimation.cpp | /* Author: Wim Meeussen */
#include <robot_pose_ekf/odom_estimation.h>
using namespace MatrixWrapper;
using namespace BFL;
using namespace tf;
using namespace std;
using namespace ros;
namespace estimation
{
// constructor
OdomEstimation::OdomEstimation():
prior_(NULL),
filter_(NULL),
filter_initiali... | ALGO | 0.991469 | 4.636261 |
65cd3a4a-5deb-4675-9030-17e2d6fe8b57 | EPMatt/competitive-programming | coci/2019-2020/round4/pod_starim_krovovima.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct {
int t;
int z;
int i;
} glass_t;
vector<glass_t> v;
long int totT=0;
bool compZ(glass_t g1, glass_t g2){
return g1.z>g2.z;
}
bool compI(glass_t g1, glass_t g2){
return g1.i<g2.i;
}
void output(){
... | ALGO | 0.999886 | 3.709041 |
bde8ee8e-ee16-4ae5-9a42-169360eb2488 | dc356/quake4sourcemidterm | mpgame/ai/Monster_Fatty.cpp | /*
================
Monster_Fatguy.cpp
AI for the fat guy on the putra level
================
*/
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
#include "../Projectile.h"
typedef struct monsterFattyChain_s {
jointHandle_t orientationJoint;
jointHandle_t attackJoint;
bool ... | TOOL | 0.868932 | 5.504882 |
9c6b04ca-604b-486b-b14b-409800a90ae5 | LeiGan0215/Interview | Data Structures and Algorithms/summarize/InsertSort.cpp | template <class Record>
void InsertSort(Record Array[],int n)
{
int i,j;
Record Tem;
for(i=1;i<n;i++)
{
Tem=Array[i];
j=i-1;
while(j>=0&&Tem<Array[j])
{
Array[j+1]=Array[j];
j=j-1;
}
Array[j+1]=Tem;
}
}
| ALGO | 0.999972 | 4.325305 |
b09b8113-9089-4568-a358-eceb76f05b8a | shajunguang/Algorithm_competition | LuoGu_competition/Math/p1045.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAXN=1001; //乘法开两倍,吃大亏一开始
int sum[MAXN]={1,1},temp1[MAXN],temp[MAXN];
void add(int temp[]){
int t=0,i;
for(i=1;i<=temp1[0] || t || i<=temp[0];i++){
if(i>500) break;
t+=temp1[i];
if(i<=temp[0]) t+=temp[i];
temp1[i]=t%10;
... | ALGO | 0.999957 | 3.718956 |
0043c177-95fd-49cc-823a-5588a4824135 | Gourav-Makkar/Data-Structures-and-Algorithms | 0450-delete-node-in-a-bst/0450-delete-node-in-a-bst.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.241028 |
121d451c-f850-401d-bb64-fc36b874e713 | feiyehua/Winter-2024 | CSP35/communicate.cpp | /***
* @Author : FeiYehua
* @Date : 2025-03-03 23:11:28
* @LastEditTime : 2025-03-03 23:39:26
* @LastEditors : FeiYehua
* @Description :
* @FilePath : communicate.cpp
* @ © 2024 FeiYehua
*/
#include<bits/stdc++.h>
using namespace std;
template<typename T>
void fr(T& num)
{
char ch;... | ALGO | 0.999933 | 5.331407 |
c3cabd3d-ad2a-4fd9-8de9-6ac3b4da4b04 | agrmadhav/datasSructuresAndAlgo | competitiveProgramming/codeforces/garland.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
string s;
cin >> s;
unordered_map<int,int>mp;
for(auto i:s){
mp[i]++;
}
if(mp.size() == 1) cout<<-1<<endl;
else{
bool flag = false;
... | ALGO | 0.99975 | 4.122484 |
939e743d-5254-4b41-9de5-ca9305b8cf01 | tomasgomez/Physics-simulation | Tarea-3/etapa1/PhysicsLab1.cpp | #include <iostream>
#include <cstdlib> // c++ exit
#include "MyWorld.h"
#include "Ball.h"
#include "CVector.h"
#include "PhysicsElement.h"
using namespace std;
int main(int argvc, char * argv[]) {
if (argvc != 4) {
cout << "usage: "<< argv[0] << " <delta_time[s]> <end_time[s]> <sampling_time[s]>" << e... | ALGO | 0.896513 | 4.226904 |
ed922da4-79bd-49b5-ab30-5f94b0331182 | SongJunYoung7563/ProgrammingCJUAE101-2023 | Practice(pp206c)/main.cpp | #include <stdio.h>
int rec_func(int n);
int rec_func(int n)
{
if (n <= 1) return n;
else return n + rec_func(n - 1);
}
int main()
{
int integer = 0;
int total = 0;
printf("1 Է մϴ.");
scanf_s("%d", &integer);
total = rec_func(integer);
printf("%d\n", total);
return 0;
} | ALGO | 0.999911 | 3.27999 |
78fe249e-46c9-458f-9758-18910d3bb36c | nickgaur/leetcode | 232-implement-queue-using-stacks/232-implement-queue-using-stacks.cpp | class MyQueue {
public:
vector<int> st1;
vector<int> st2;
MyQueue() {
}
void push(int x) {
st1.push_back(x);
while(!st2.empty()){
st2.pop_back();
}
for(int i=st1.size() - 1; i>=0; i--){
st2.push_back(st1[i]);
... | ALGO | 0.998808 | 5.473422 |
9de589e8-7883-489a-9f47-f4e6c05ccb54 | ishandutta2007/codeforces | abc864197532/normal/1744/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
void abc() {cout << endl;}
template <typename T, typena... | ALGO | 0.999944 | 4.602782 |
40d45f21-b064-418c-81a3-69d60f5396de | Tim-Choi75/SWCert | BOJ/18352_PQ.cpp | //https://www.acmicpc.net/problem/18352
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> pii;
#define MAX_N 300001
#define 1e9 1e9
int main() {
//freopen("/Users/timchoi/Git/SWCert/input/BOJ_18352.txt", "... | ALGO | 0.999983 | 4.053443 |
bcab6ab0-a0ae-4683-9fbc-15f9e8300f57 | Dhiru12321/DSA-GFG | sorting/quickSort.cpp | #include <iostream>
using namespace std;
void swap(int *a, int *b) {
int t = *a;
*a = *b;
*b = t;
}
void printArray(int array[], int size) {
int i;
for (i = 0; i < size; i++)
cout << array[i] << " ";
cout << endl;
}
int partition(int array[], int low, int high) {
int pivot = array[high];
int... | ALGO | 0.999975 | 5.614447 |
2f9d88ec-3f99-41d6-bc54-e7f5f3a94494 | soniashutosh/InterviewBit-Solutions | Dynamic Programming/Stairs.cpp | int Solution::climbStairs(int A) {
vector<int> dp(A+1,0);
//base case
dp[0] = 0;
dp[1] = 1;
dp[2] = 2;
// dp[i] represents number of ways to reach to i
// so it will be sum number of ways to reach to i-1 and number of ways to reach i-2
for(int i=3;i<=A;i++) {
dp[i] = dp[i-... | ALGO | 0.999976 | 5.097466 |
b71ed112-4b01-4916-a88d-07d7e79defb5 | persja40/mgr | tex/code/impl_cuda.cpp | __global__ void g_h_sum(float *data, int m, int n, int kth, float h, float *answer)
{
__shared__ float rr;
if (threadIdx.x == 0)
rr = 0;
__syncthreads();
float part = 0;
for(int i= blockIdx.x; i<m; i+=gridDim.x)
for(int j= threadIdx.x; j<m; j+= blockDim.x){
float xTx = p... | ALGO | 0.999982 | 3.445767 |
ea054e13-7d8c-4e77-b296-ee3ae3a8538f | KhronosGroup/LLVM-SPIRV-Backend | llvm/lib/CodeGen/LiveRegMatrix.cpp | #include "llvm/CodeGen/LiveRegMatrix.h"
#include "RegisterCoalescer.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervalUnion.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#includ... | ALGO | 0.938393 | 7.668299 |
0034e370-23e0-4790-992e-038782647b9b | KushagraSinha2002/CodingNinja_DSA_CPP | Recursion 1/SumOfDigits(recursive).cpp | #include <iostream>
using namespace std;
int sumOfDigits(int n) {
if(n==0){
return 0;
}
return n%10+sumOfDigits(n/10);
}
int main() {
int n;
cin >> n;
cout << sumOfDigits(n) << endl;
}
| ALGO | 0.999849 | 5.259634 |
3e4f462f-10b7-46e0-8e2f-626fc391af5f | kurumishka/problems | 509/509B.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
string ans(int n, int k)
{
string res = string();
int st = 1;
for (int i = 0; i < n; i++)
{
if (st > k) st = 1;
res = res + to_string(st) + " ";
st++;
}
return res;
}
main()
{
int n, k; cin >> n >> k;
... | ALGO | 0.999996 | 3.866679 |
a75c3b6c-2504-4308-ad7d-ce2af8c6eb3a | Utkagr/AlgoCodes | AlgoCodes/str_consecutive.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <stack>
using namespace std;
int main()
{
string s;
cin >> s;
int n = s.length();
int i;
stack<char> st;
i = 0;
st.push(s[0]);
char temp = s[0];
i = 1;
char k;
while(i<n)
{
if(st.empty())
{
st.push(s[i]);
}
else
{
k = temp;
... | ALGO | 0.999992 | 4.143122 |
14542ea9-d4ec-44a6-8e20-17061e351c18 | cryptovecom/mongoDBSource | src/mongo/db/pipeline/change_stream_rewrite_helpers.cpp | #include "mongo/db/pipeline/change_stream_rewrite_helpers.h"
#include <absl/container/flat_hash_map.h>
#include <boost/algorithm/string/replace.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/none.hpp>
#include <boost/optional/optional.hpp>
#include <boost/smart_ptr.hpp>
#include <cstddef>
#include <fmt/fo... | TOOL | 0.955969 | 3.871162 |
9dd58e2c-72c8-4435-815c-9e7e92652c67 | Dokone00/Data-Structures-and-Algo | 2483-minimum-penalty-for-a-shop/2483-minimum-penalty-for-a-shop.cpp | class Solution {
public:
int bestClosingTime(string customers) {
int n = customers.length();
int cnt = 0;
int cnt1 = 0;
int ans = 0;
int max = 0;
for(int i=0;i<n;i++){
if(customers[i]=='Y'){
cnt++;
}
}
if(cnt == ... | ALGO | 0.999916 | 5.60782 |
401f9ce2-bd31-4b4a-83ff-e9b06291c111 | KateDetsyk/myls | comparators.cpp | #include "comparators.h"
bool dir_sort(MyStats& a, MyStats& b, bool reversed) {
if (reversed) {
return (!S_ISDIR(a.file_stats.st_mode) && S_ISDIR(b.file_stats.st_mode));
}
return (S_ISDIR(a.file_stats.st_mode) && !S_ISDIR(b.file_stats.st_mode));
}
bool special_files_sort(MyStats& a, MyStats& b, bo... | ALGO | 0.954979 | 5.148863 |
8402a74a-fc73-408a-98c1-909b66f7ad32 | kiyounkim/codingPractice | 프로그래머스/0/120909. 제곱수 판별하기/제곱수 판별하기.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int n) {
int answer = 2;
for(int i=1;i*i<=n;i++)
if(i*i==n) answer-=1;
return answer;
} | ALGO | 0.999519 | 4.216963 |
62604941-3f28-486a-b0e5-72683b6b47a1 | harshitsuthar77731/striverSheet | Binary Search/Matrix Median.cpp | int Solution::findMedian(vector<vector<int> > &A) {
int r = A.size();
int c = A[0].size();
int k = (r*c+1)/2;
int minm = INT_MAX;
int maxm = INT_MIN;
for(int i=0;i<r;i++){
minm = min(A[i][0],minm);
maxm = max(A[i][c-1],maxm);
}
while(minm<maxm){
int mid ... | ALGO | 0.999821 | 5.147092 |
e59953f5-be9d-4941-bf6f-0d0ed080212f | ujjawal-kumar17/CPS-srm-ccc-HackerRankSolution | 3.minimalOperations.cpp | int check(string s) {
int count = 0;
for (int i = 0; i < s.length() - 1; i++) {
if (s[i] == s[i + 1]) {
count++;
i++;
}
}
return count;
}
vector<int> minimalOperations(const vector<string>& words) {
vector<int> result;
f... | ALGO | 0.999594 | 6.045315 |
80cce737-41b9-474c-9cf9-7935e2b12668 | quochao09/Cpp_Loop-Exercises | buoi4_5_bai6.cpp | #include <iostream>
#include <math.h>
using namespace std;
int check(int n){
int k=0, cnt=0;
for(int i=2; i<=n; i++){
while (n%i != 1){ // Điều kiện dừng cho đến khi n chia hết cho i
if(n % i == 0){
k++;
cout<<i<<"\t";
n = n/i; // n chia tiếp cho i
}
else{
i++;
}
} if(k > 0){ // đ... | ALGO | 0.999267 | 4.099647 |
7e75141a-30af-42a0-8d96-5c5de6182cc0 | dmmorozo/gromacs2018-cp2k | src/gromacs/gmxana/gmx_do_dssp.cpp | #include "gmxpre.h"
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include "gromacs/commandline/pargs.h"
#include "gromacs/commandline/viewit.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/matio.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/file... | TOOL | 0.867599 | 3.815066 |
8420046f-d04d-4f9c-98b8-a311f1abeb80 | MBernart/pprog | klasa3/2021_06_10/Polygon.cpp | /** @file Polygon.cpp
*
* @brief Implementacja metod klasy Polygon
*
* @author Patryk Janiak 3D
* @date 2021.03.18
* @version 1.0
*/
#include "Polygon.h"
#include<iostream>
#include<math.h>
unsigned int Polygon::number{0};
Polygon::Polygon()
{
std::cout << "\033[0;32mPolygon\033[0m Konstruktor domyślny\n";... | TOOL | 0.866462 | 5.305906 |
d2ae9aed-57cb-4515-8a77-60726ba3f754 | omkaranu04/CP_DSA | Codeforecs/1-1998/1932C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
void solve()
{
ll n, m;
cin >> n >> m;
vector<ll> a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
string s;
cin >> s;
ll left = 0;
ll right = n - 1;
for (int i = 0; i < s.length() - 1; i++)
... | ALGO | 0.999982 | 3.791805 |
d6e92a4f-3918-43cc-a21e-58509d513965 | PoisWu/coding | lc/0049. Group Anagrams/solution_v0.cpp | #include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using lli = long long int;
template... | ALGO | 0.999998 | 5.998094 |
e3ea77f4-2d30-4de7-984e-3dc702cb8846 | navitohighbury/cjj_px4_workspace | src/modules/ekf2/EKF/baro_height_control.cpp | /**
* @file baro_height_control.cpp
* Control functions for ekf barometric height fusion
*/
#include "ekf.h"
void Ekf::controlBaroHeightFusion()
{
static constexpr const char *HGT_SRC_NAME = "baro";
auto &aid_src = _aid_src_baro_hgt;
HeightBiasEstimator &bias_est = _baro_b_est;
bias_est.predict(_dt_ekf_avg);... | ALGO | 0.941176 | 5.826965 |
b6126723-5601-46fd-80c6-0d10565d206f | Nester778/Distributed-Lab-LR6 | LR_6/lib/cryptopp-master/pssr.cpp | // pssr.cpp - originally written and placed in the public domain by Wei Dai
#include "pch.h"
#include "pssr.h"
#include "emsa2.h"
#include "ripemd.h"
#include "whrlpool.h"
#include "misc.h"
#include <functional>
NAMESPACE_BEGIN(CryptoPP)
template<> const byte EMSA2HashId<RIPEMD160>::id = 0x31;
template<> const byte... | ALGO | 0.975375 | 7.454227 |
9af66151-ef6c-4cc7-887e-468c806f684a | bishalbhat2002/OOPs-with-CPP | C++ Notes/A 5 Function overloading & recursion/4 Recursion function for factorial of a number.cpp | // Recursion in C++
// Program to calculate the factorial of a number and display it.
#include <iostream>
using namespace std;
long fact(int n)
{
if (n == 0 || n == 1) // Base condition
return 1;
return (n * fact(n - 1)); // Recursive function call
}
int main()
{
int num;
cout << "Enter a posit... | ALGO | 0.998819 | 4.797779 |
b88c2444-0cc5-410a-a82b-9e16b7d26794 | Abhi52811/Cpp-Java | C++/DSA/Week 18 - Graphs/Class 8/PQ2.cpp | #include <bits/stdc++.h>
using namespace std;
void findBridges(int src, int parent, int &timer, vector<int> &tin, vector<int> &low, unordered_map<int, bool> &vis, vector<vector<int>> &ans, unordered_map<int, list<int>> &adjList)
{
vis[src] = true;
tin[src] = timer;
low[src] = timer;
timer++;
for ... | ALGO | 0.999907 | 5.371582 |
4a5393cb-23ff-4b21-81e1-416a529a3ab3 | protarie125/BOJ_18408 | BOJ_18408/src/main.cpp | #include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int x;
auto n1 = int{ 0 };
auto n2 = int{ 0 };
for (int i = 0; i < 3; ++i) {
cin >> x;
if (1 == x) {
n1 += 1;
if (2 == n1) {
cout << 1;
return 0;
}
}
else {
n2 += 1;
if (2 =... | ALGO | 0.999531 | 3.773816 |
c05fc5bd-681b-4653-8673-ab170eeaead2 | ankitrajlogin/Cpp-Algorithm | Pointer in c and c++/05_1_function_as_pointer.cpp |
// pointer as function arguments --> call by reference ;
#include<stdio.h>
#include<iostream>
void Increase(int a){ // call by value ;
a = a+1 ;
printf("Address of a in increase funciton : %d \n" , &a) ;
}
/* --------------------------------------------------------------------------
application memor... | TOOL | 0.986912 | 4.852273 |
3b27e6a3-c4f8-4d69-aae6-e5e943fba57d | RiseOS/platform_hardware_qcom_sdm845_gps | msm8996/utils/LocHeap.cpp | #include <LocHeap.h>
class LocHeapNode {
friend class LocHeap;
// size of of the subtree, excluding self, 1 if no subtree
int mSize;
LocHeapNode* mLeft;
LocHeapNode* mRight;
LocRankable* mData;
public:
inline LocHeapNode(LocRankable& data) :
mSize(1), mLeft(NULL), mRight(NULL), mDa... | ALGO | 0.997657 | 6.413697 |
72c897ed-423f-48d4-9596-ac34aba05f2f | Aakash7838/cpp-dsa | Pattern Printing/i.cpp | #include<iostream>
#include<conio.h>
using namespace std;
int main(){
int n;
char ch = 'A';
cout<<"enter n";
cin>>n;
int num =1;
for(int i=1;i<=n;i++){
for (int j=1;j<=i;j++){
if(i%2==0){
if(j==0)
if(j==0)
cout<<ch;
else
... | ALGO | 0.999602 | 3.004304 |
243ffd6c-cd96-44fe-ba1c-95a38e8d8174 | nemurinda/procon-archive | atcoder.jp/code-festival-2017-quala/code_festival_2017_quala_c/Main.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#incl... | ALGO | 0.999977 | 4.073131 |
12d26950-cf00-493e-a2ff-e9ff304c8712 | rootkonda/LeetCode | 371. Sum of Two Integers.cpp | /**
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.
1. Usage of unsigned integer to keep the carry when doing left shift.
2. AND both a and b to get the carry bits.
3. XOR a and b means like addition.
4. << left shift the carry bit so that it becomes a carry for the next... | ALGO | 0.999949 | 5.81811 |
894832f5-f3c1-4933-8158-96e607f60a3f | TeamViperOS/android_frameworks_av | media/libstagefright/MediaCodecList.cpp | //#define LOG_NDEBUG 0
#define LOG_TAG "MediaCodecList"
#include <utils/Log.h>
#include "MediaCodecListOverrides.h"
#include <binder/IServiceManager.h>
#include <media/IMediaCodecList.h>
#include <media/IMediaPlayerService.h>
#include <media/IResourceManagerService.h>
#include <media/MediaCodecInfo.h>
#include <medi... | TOOL | 0.881716 | 6.390588 |
24069a98-99da-4dce-9703-c70ac59b93a8 | ErebusAJ/DSA | rotateImage.cpp | # include<bits/stdc++.h>
using namespace std;
int main(){
vector<vector <int>> mat{{1,2,3},{4,5,6},{7,8,9}};
for(int i = 0; i < mat.size(); i++){
for(int j = i; j < mat.size(); j++){
swap(mat[j][i],mat[i][j]);
}
reverse(mat[i].begin(), mat[i].end());
}
for(int i =... | ALGO | 0.99998 | 3.39171 |
256f4875-5e81-4309-bf8b-00609f5465f1 | nyakole/DataStructures_and_Algorithms | LeetCode/Dp/518.cpp | //https://leetcode.com/problems/coin-change-ii/description/
#include <bits/stdc++.h>
using namespace std;
// Function to count the number of ways to make change for a given target sum
long countWaysToMakeChange(vector<int>& arr, int n, int T) {
vector<long> prev(T + 1, 0); // Create a vector to store the previous... | ALGO | 0.999979 | 6.659581 |
e8f4fb9a-0ae1-4005-a9a5-a3c3296bf9cd | SaneaV/CEITI-Projects | C++ Labs/23.11.2017.2.cpp | //Количество нечётных чисел в матрице
#include <iostream>
using namespace std;
main()
{
setlocale (LC_ALL,"Rus");
cout<<"Введите n: ";
int n, a[20][20],m;
cin>>n;
cout<<"Введите m: ";
cin>>m;
for (int i=0;i<n;i++)
{
for (int j=0;j<m;j++)
{cout<<"Введите число: ";
... | ALGO | 0.999527 | 3.601499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.