uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0df6bf14-c3e7-4c58-a960-1d15ba7bf31a | coder-Fm/HackerRank_Solutions | dynamicArray.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* 'dynamicArray' function below.
*
* The function is expected to return an INTEGER_ARRAY.
* The function accepts following parameters:
* 1. INTEGER n
* 2. 2D_INTE... | ALGO | 0.999931 | 4.792728 |
3d6e66b3-bc47-4575-97ec-7426717392b6 | TyLauriente/Algorithms | Algorithms/LinkedList/main.cpp | #include"Node.h"
#include"LinkedList.h"
#include"DoubleLinkedList.h"
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
DoubleLinkedList<int> linkList;
struct Number
{
bool operator==(Number& other) { return (this->number == other.number); }
int number;
int count = 1;
};
void TryLeak()... | ALGO | 0.997757 | 4.9145 |
287a2f90-3a01-4357-bb01-5156a6bd1065 | eecrazy/ACM | 比赛/20130504New Training 3 for HIT 11/B.cpp | #include<stdio.h>
#include<string.h>
#include<math.h>
using namespace std;
#define maxn 305
#define eps 1e-7
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
struct point_float
{
float x,y;
};
bool used[maxn][maxn];
int ans;
int Len(int x1,int y1,int x2,int y2)
{
return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
voi... | ALGO | 0.997809 | 3.13703 |
12a41179-d4cc-4401-b01f-0646042229cd | Sunandha1805/DSA | Tree/Traversal.cpp | // ---------------------------------PRE-ORDER---------------------------
vector<int> preorderTraversal(Node* root){
vector<int> arr;
preOrder(root, arr);
return arr;
}
void preOrder(Node* root, vector<int> &arr){
if(root == nullptr) return;
arr.push_back(root->val, arr);
preOrder(root->left, ... | ALGO | 0.999935 | 6.10167 |
c441d804-c29c-483a-9b7a-a8559f3ccd9a | Giantpizzahead/comp-programming | Codeforces/Virtual/1466 - Goodbye 2020/G.cpp | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x.size())
using namespace std;
using ll = long long;
using vi = vector<int>;
const int MAXN = 1e6+20;
const int MAXC = 1e6+20;
const int HASHC = 4;
const int HASHM[HASHC] = {1000000007,... | ALGO | 0.999797 | 4.081201 |
066c1460-de5d-4b20-a478-98d7c247b64e | BrilliantAdam/Codeforces | 699A.cpp | //brilliantadam
//16/6/2024
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n , x, R = {0}, diff= INT_MAX;
bool flagR {0}, flagL{0}, chR {0};
string s;
cin >> n;
cin >> s;
for(int i=0; i<n; i++){
cin >> x;
if(s[i] == 'R'){
R = x;
flagR = 1;
... | ALGO | 0.999957 | 4.187611 |
10d23e16-0c36-44a9-ad52-445d47a37e12 | raincross7/code-similarity | codes/train_code/problem250/problem250_349.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
double n; cin >> n; n /= 3;
cout << fixed << setprecision(12) << n * n * n << endl;
} | ALGO | 0.999673 | 3.447384 |
7c8f8be6-7cb5-47ff-bd63-0295ff177123 | jdoerfert/cudaomp | clang/utils/TableGen/ClangSyntaxEmitter.cpp | #include <deque>
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
namespace {
using llvm::formatv;
// The class hierarchy of Node types.
// We assemble this in order to be abl... | TOOL | 0.884686 | 7.919489 |
28ef7d30-7ed3-4af6-b78a-6e5a600c97b2 | bdsadeq/uva-problem-solutions | Accepted (386)/V-107 (6)/10783.cpp | //Odd Sum (#10783)
//Sadeq
#include<iostream.h>
int main()
{
int a,b,sum,i,j,n;
cin>>n;
for(j=0;j<n;j++)
{
cin>>a>>b;
sum=0;
if((a%2)==0) a=a+1;
if((b%2)==0) b=b-1;
for(i=a;i<=b;i=i+2)
{
sum=sum+i;
}
cout<<"Case "<<j+1<<": "<<sum<<endl;
}
return 0;
} | ALGO | 0.999749 | 3.952672 |
920edc6a-d4ae-4360-895e-d6f9ca88aaeb | igateno/cs161-Project | Path.cpp | #include "Path.h"
using namespace std;
Path::Path(int n)
{
nodes = vector<int>();
nodes.push_back(n);
hops = 1;
}
void Path::addNode(int n)
{
nodes.push_back(n);
hops++;
}
bool Path::operator> (Path &p)
{
return hops > p.hops;
}
bool Path::operator< (Path &p)
{
return hops < p.hops;
}
| ALGO | 0.897188 | 3.33689 |
713ebc1b-a870-4869-bdf8-3f0cd7743c24 | Alex-Criwer/Algorithms | RM(S)Q/F_the_best_soldier.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
template<class T>
class MAX {
public:
std::pair<T, int> operator()(const std::pair<T, int> &lhs, const std::pair<T, int> &rhs) {
if ( lhs.first > rhs.first){
return lhs;
} else {
r... | ALGO | 0.999895 | 5.38353 |
021c7ba2-eed7-41ea-a361-f1f8868884c8 | Italia2407/Mackerel-Engine | Mackerel-Core/ext/bullet3-master/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp | #define CLEAR_MANIFOLD 1
#include "btSphereSphereCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionDispatch/btCollision... | ALGO | 0.998682 | 6.651726 |
aebc4244-f4e4-4da1-9e69-ec6e609fa6df | patrykniedzwiecki/global_resmgr_standard | frameworks/resmgr/src/utils/hap_parser.cpp | #include "hap_parser.h"
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <unzip.h>
#include <zip.h>
#include <zlib.h>
#include "hilog_wrapper.h"
#include "locale_matcher.h"
#if defined(__WINNT__)
#include <cstring>
#else
#include "securec.h"
#endif
#include "utils/common.h"
#incl... | TOOL | 0.864855 | 4.920983 |
e3553a23-5b57-4ada-82ae-1142db4f662c | EvansUniverse/daisy-projects | DaisySP/Source/Effects/autowah.cpp | #include "autowah.h"
#include <math.h>
using namespace daisysp;
void Autowah::Init(float sample_rate)
{
sampling_freq_ = sample_rate;
const1_ = 1413.72f / sampling_freq_;
const2_ = expf(0.0f - (100.0f / sampling_freq_));
const4_ = expf(0.0f - (10.0f / sampling_freq_));
wet_dr... | ALGO | 0.988038 | 3.957739 |
59652a24-1658-4940-95d3-8ea0e88dab21 | SequoiaDB/SequoiaDB | thirdparty/icu4c/source/common/dictbe.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_BREAK_ITERATION
#include "brkeng.h"
#include "dictbe.h"
#include "unicode/uniset.h"
#include "unicode/chariter.h"
#include "unicode/ubrk.h"
#include "uvectr32.h"
#include "uvector.h"
#include "uassert.h"
#include "unicode/normlzr.h"
#include "cmemory.h"
#include "dictionary... | TOOL | 0.909199 | 5.664678 |
fdc10b9d-8145-4b88-b5c3-cfea9b470238 | grkem1/leetcode | src/remove-duplicates-from-sorted-array/Solution.cpp | // https://leetcode.com/problems/remove-duplicates-from-sorted-array
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int current = INT_MAX;
for(int i = 0; i < nums.size();){
if(nums[i] != current){
current = nums[i];
++i;
}e... | ALGO | 0.999323 | 6.478461 |
94045cb0-a2dd-46e3-a1e8-da4a71d72dd7 | Shubh08am/Leetcode_DSA_Problems-Solutions | Number of Common Factors.cpp | class Solution {
public:
int commonFactors(int a, int b) {
int cnt=0;
int x = max(a,b) ;
for(int i=1;i<=x;i++){
if(a%i==0 and b%i==0) cnt++;
}
return cnt;
}
};
| ALGO | 0.999863 | 5.802055 |
66cf38cd-d45e-40b8-868f-419b3f2668c1 | aliemre2023/algorithm | leetcode/medium/1020_number-of-enclaves.cpp | class Solution {
public:
void dfs(int i, int j, vector<vector<int>>& adj, vector<vector<int>>& vis, int& counter, bool& isOut){
int n = adj.size();
int m = adj[0].size();
vis[i][j] = 1;
counter += 1;
vector<pair<int, int>> directions = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
... | ALGO | 0.999961 | 6.412479 |
b00f2343-449d-4a9a-961a-a15dbdca1f55 | niharika2k00/Compititive_Programming_and_LeetCode-problem-solutions | Leet_Code_Problems/452.minimum-number-of-arrows-to-burst-balloons.cpp | /*
* @lc app=leetcode id=452 lang=cpp
*
* [452] Minimum Number of Arrows to Burst Balloons
*/
// @lc code=start
bool comparator(vector<int> &x, vector<int> &y)
{
return x[1] < y[1];
}
class Solution
{
public:
int findMinArrowShots(vector<vector<int>> &points)
{
if (points.size() == 0)
... | ALGO | 0.999944 | 6.613873 |
28d78a5e-bbf1-41cf-9b47-89eeb5f988de | argyrogounari/GRO-Ivestments | 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 |
a53ed84a-807b-4384-adb9-b88c5e6065eb | tungvuong2004/Travis- | question2.cpp | /*
Name: Travis
Student ID: 1113545
Date of Submission: 2024-12-12
Description:
Given a connected undirected graph represented by an adjacency list `adj`,
perform a Breadth First Search (BFS) traversal starting from vertex 0.
The adjacency list `adj` is given as a vector of vectors, where each adj[i]... | ALGO | 0.999981 | 6.657906 |
ff8baa2f-d3da-4c30-ba43-c8822d82195c | KIMJUHEEEEE/codetree-TILs | 240502/요일 맞추기/guess-day-of-week.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int m1, m2, d1, d2;
string week[7] = { "Mon","Tue","Wed","Thu","Fri","Sat","Sun" };
int date[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
cin >> m1 >> d1 >> m2 >> d2;
int sum = 0;
if(m1==m2)
{... | ALGO | 0.999992 | 4.207597 |
0ed7f12e-b5fd-4bfd-94c4-16f9ececc2b7 | yenhao-huang/zsim_ramulator | zsim-ramulator/pin/source/tools/Insmix/insmix.cpp | /* ===================================================================== */
/*
@ORIGINAL_AUTHOR: Robert Muth
@Modified by: Ramesh Peri
*/
/* ===================================================================== */
/*! @file
* This file contains a static and dynamic instruction mix profiler
*/
#include "pin.H"
... | TOOL | 0.969786 | 5.703954 |
f0ed1f56-caec-44a7-973a-d3109c183e79 | eder-repository/instagram_clone | 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.998693 | 6.797273 |
88d98715-3ffb-4e20-a08d-2b42cec17a7f | superchee/C-Primer | VisualStudio2012/17/findbook.cpp | #include <cassert>
#include <utility>
using std::pair;
#include <string>
using std::string;
#include <tuple>
using std::tuple; using std::get;
using std::make_tuple;
#include <vector>
using std::vector;
#include <numeric>
using std::accumulate;
#include <algorithm>
using std::equal_range;
#include <exception>... | TOOL | 0.938341 | 4.888319 |
d232d05a-2609-4a29-9d51-f9266a6aed52 | wuyuhang05/My-OI-Code | ZROI/1112.cpp | /*
* Author: RainAir
* Time: 2019-10-05 16:43:35
*/
#include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <bitset>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <map>
#include <set>
#define fi fir... | ALGO | 0.998934 | 4.213568 |
59fc8337-23ad-4cc4-90f3-129372898311 | sarvex/leetcode-s | solution/0300-0399/0309.Best Time to Buy and Sell Stock with Cooldown/Solution.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int f1 = -prices[0], f2 = 0, f3 = 0;
for (int i = 1; i < prices.size(); ++i) {
int pf1 = f1, pf2 = f2, pf3 = f3;
f1 = max(pf1, pf3 - prices[i]);
f2 = max(pf2, pf1 + prices[i]);
f3 = max(pf3,... | ALGO | 0.999938 | 5.905334 |
8b959c2f-aacb-4b26-a6da-33d4576af1a3 | ankushdhanda/LeetcodeAndGFG | 2. Add Two Numbers.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* addTwoNumbe... | ALGO | 0.999942 | 5.990513 |
72eafc75-5ed4-46b9-991b-3eca9c34c8ac | andrejjakovljevic/llvm-project-morello | llvm/examples/ParallelJIT/ParallelJIT.cpp | #include "llvm/ADT/APInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes... | TOOL | 0.97753 | 7.219667 |
219545e3-2c70-468a-aa23-47ceb205bdca | BerlinObel/hppc | assignment_2/Water_sequential.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <cassert>
#include <math.h>
#include <chrono>
const double deg2rad = acos(-1)/180.0; // pi/180 for changing degs to radians
double accumulated_forces_bond = 0.; // Checksum: accumulated size of forces
double accumulated_forces_an... | ALGO | 0.991861 | 3.720938 |
976f6662-1883-463b-923b-650256dc47a1 | yingling-group/lammps-mspin | src/EXTRA-COMPUTE/compute_stress_spherical.cpp | #include "compute_stress_spherical.h"
#include "atom.h"
#include "citeme.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "lattice.h"
#include "math_const.h"
#include "math_special.h"
#include "memory.h"
#include "modify.h"
#include "neigh_list.h"
#include "neigh_request.h"
#incl... | ALGO | 0.99878 | 6.471193 |
13d558ec-fb1f-41a4-9e9d-33e7c209637e | sujay000/dsa | CSES/dp/Removing_Digits.cpp | #include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
//sujay sapkal
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define nline "\n"
#define pb push_back
#... | ALGO | 0.999732 | 4.913521 |
c88e3bb0-5225-4437-8926-ca860827ccc5 | axwlac/Competitive | 5._Mathematics/Java_BigInteger_Class/Bonus_Features_Primality_Testing/10235_Simply_Emirp.cpp | #include <iostream>
#include <algorithm>
#include <sstream>
using namespace std;
namespace patch{
template < typename T > std::string to_string(const T& n){
std::ostringstream stm;
stm << n ;
return stm.str() ;
}
}
using u64 = uint64_t;
using u128 = uint64_t;
u64 binpower(u64 base, u... | ALGO | 0.999587 | 4.121768 |
8ffe7c4f-b5af-42d9-9176-aaedc0b429f8 | FishWoWater/ARCSim-For-SMPL | dependencies/eigen/unsupported/test/BVH.cpp | #include "main.h"
#include <Eigen/StdVector>
#include <Eigen/Geometry>
#include <unsupported/Eigen/BVH>
namespace Eigen {
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
}
template<int Dim>
struct Ball
{
EIGEN_MAKE_ALIGN... | TEST | 0.990804 | 6.376149 |
4d323c8d-8ec8-4baf-9972-315751dd70e6 | jjesswan/3d-game-engine | Game/Systems/CollisionSystems/BVH/bvhtree.cpp | #include "bvhtree.h"
#include "Game/Components/CollisionComponents/CollisionComponent.h"
#include "Game/Components/CollisionComponents/boundingtriangle.h"
#include "Game/GameObjects/GameObject.h"
#include "Game/Systems/CollisionSystems/ellipsoidtrianglecollisionsystem.h"
#include <map>
BVHTree::BVHTree(std::map<std::s... | ALGO | 0.999035 | 7.167607 |
19ac51e3-5eb0-4fd6-b341-36da1a4c2de0 | i2p/i2p-browser | modules/fdlibm/src/s_fabs.cpp | /* @(#)s_fabs.c 5.1 93/09/24 */
/*
* fabs(x) returns the absolute value of x.
*/
#include "math_private.h"
double
fabs(double x)
{
u_int32_t high;
GET_HIGH_WORD(high,x);
SET_HIGH_WORD(x,high&0x7fffffff);
return x;
}
| TOOL | 0.934963 | 5.748159 |
ac43e9be-54f7-4225-8966-5c7a8db888ad | NCommander/openbsd-src-with-branches | gnu/llvm/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp | #include "llvm/Transforms/Utils/SSAUpdaterBulk.h"
#include "llvm/Analysis/IteratedDominanceFrontier.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/Value.h"
using namespace llvm;
#define DEBU... | ALGO | 0.999803 | 8.038125 |
3ab1be55-0805-42be-ae96-6c5cfd3066a2 | ThevinduFernando2003/githubproject1 | CSES Problems/29missingCoinSum.cpp | #include <bits/stdc++.h>
using namespace std;
//missing coin sum
int main(){
int n;
cin >> n;
vector<int> coins(n);
for(int i = 0; i < n; i++){
cin >> coins[i];
}
sort(coins.begin(), coins.end());
long long small = 1;
for(int i = 0; i < n; i++){
if(coins[i] > small){
... | ALGO | 0.999928 | 3.673629 |
d826d1b8-0e4a-4f6b-8ae7-a970068c396f | sarvex/leetcode-basic | solution/0800-0899/0827.Making A Large Island/Solution.cpp | class Solution {
public:
const static inline vector<int> dirs = {-1, 0, 1, 0, -1};
int largestIsland(vector<vector<int>>& grid) {
int n = grid.size();
vector<int> p(n * n);
vector<int> size(n * n, 1);
iota(p.begin(), p.end(), 0);
function<int(int)> find;
find = ... | ALGO | 0.999902 | 6.189507 |
fa6205d3-d1cf-40f4-98f0-dca90047c57a | DPS0340/DoItDataRithm | 03/Q9.cpp | #include <iostream>
using namespace std;
int compar(const void *a, const void *b) {
if(*(int *)a < *(int *)b) {
return -1;
} else if(*(int *)a > *(int *)b) {
return 1;
} else {
return 0;
}
}
// char는 1바이트!
void* bsearchx(const void* key, const void* base, size_t nmemb,
size_t size, int(*compar)(const void... | ALGO | 0.999723 | 4.002871 |
1f9e4d0a-9ea2-4b45-a19a-86aec9e8b9a4 | gustavomuller99/Algo | zOld/min max swap/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t; cin>>t; while(t--) {
int n; cin>>n;
vector<int> a(n), b(n);
int ma = 0, mb = 0;
for (int i = 0; i < n; ++i) cin>>a[i];
for (int i = 0; i < n; ++i) cin>>b[i];
for (int i = 0; i < n; ++i) ma = max(ma, mi... | ALGO | 0.999976 | 3.766224 |
93f47bd5-711a-49bf-8ef0-92ce0f2f0dc2 | Prayash007/All_my_codes | codeforces/DistColor.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t-->0)
{
int a,b,c;
cin>>a>>b>>c;
int ans=0;
if(c>=a && c>=b)
{
ans = a*b;
}
else if(c<a && c<b)
{
ans = c*c;
}
else if(c>=a && c<=b)
{
ans = c*a;
... | ALGO | 0.999864 | 3.970442 |
5d6710a0-3784-4bf8-a349-1679f3a9aa17 | hung1605/DSA_PTIT | CTDL_005.cpp | #include <bits/stdc++.h>
using namespace std;
void testCase() {
int n; cin >> n;
int a[n];
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
int x; cin >> x;
for (int i = 0; i < n; ++i) {
if (a[i] != x) cout << a[i] << " ";
}
}
int main() {
ios_base::sync_with_stdio(false);
... | ALGO | 0.999465 | 3.659385 |
67b9d90d-2323-4cb0-8557-352730f9767d | anuragji111/cpp-solutions-leetcode-top-150 | find_peak_element.cpp | **Find Peak Element**
Problem Statement 115) You are given an m x n integer matrix matrix with the following two properties:
Each row is sorted in non-decreasing order.
The first integer of each row is greater than the last integer of the previous row.
Given an integer target, return true if target is in matrix or fa... | ALGO | 0.999992 | 7.141408 |
c48e0a74-254e-475d-8e58-a8108de06ea3 | Injarapugc/cpcodes | B_Stalin_Sort.cpp |
#include <iostream> // For input/output operations
#include <vector> // For vector container
#include <string> // For string operations
#include <algorithm> // For algorithms like sort, binary_search, etc.
#include <cmath> // For mathematical functions
#include <map> ... | ALGO | 0.999822 | 4.701283 |
e8f2e2df-214b-49bf-ae89-22f805180772 | zxyDEDIRE/ACM_CODE | 多校/The 2nd Universal Cup. Stage 4 Taipei/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pp(x) array<int,x>
using ull=unsigned long long;
using ll=long long;
using pii=pair<int,int>;
using pdd=pair<double,double>;
const int dx[]={0,0,1,-1,1,-1,1,-1};
const int dy[]={1,-1,0,0,1,-1,-1,1};
const int mod=998244353;
const int inf=0x3f3f3f3f;... | ALGO | 0.99962 | 4.127804 |
5fac1aef-a962-4825-b168-77f8677ce8e6 | Mohamed-Ahmed-Esmat/Clinic-Website | docs/test.cpp |
#include <iostream>
using namespace std;
//program that prints pattern of stars
int main()
{
int i, j, k, n;
cout << "Enter the number of rows: ";
cin >> n;
for (i = 1; i <= n; i++)
{
for (j = 1; j <= n - i; j++)
{
cout << " ";
}
for (k = 1; k <= i; k++)
... | ALGO | 0.972543 | 3.882721 |
4fcef880-b864-4c0e-8fbb-2f41c75241e7 | jinhachung/CodeSnippets | cpp/aggregate-duplicates.cpp | #include <iostream>
#include <cstdlib>
#include <vector> // std::vector
#include <map> // std::map
#include <utility> // std::pair
//#include <algorithm>
struct coordinate {
int x;
int y;
int z;
};
typedef struct coordinate coordinate;
// only operator< is required
// but let's also define operator... | ALGO | 0.99545 | 4.631479 |
8cfc9991-8ac2-4801-83bf-3b0ab68506dd | zenglenn42/programming-abstractions | 02-functions-and-libs/readerEx.02.09/main.cpp | #include <iostream>
#include <string>
#include <cstdlib>
// Function prototypes
void error(std::string msg);
long permutations(unsigned n, unsigned k);
bool testPermutations(unsigned n, unsigned k, long expectedAnswer);
// Main program
int main(int argc, char * argv[]) {
unsigned nItems = 6;
unsigned c... | ALGO | 0.991448 | 7.052446 |
6f409063-b613-4554-9fb7-024ef8513227 | dhananjay-dhawale/xylophone-app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998667 | 6.789978 |
886f3400-1c2b-4363-be70-d52458cb46ec | ishandutta2007/codeforces | ilya_msu/normal/538/B.cpp | #define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>
#include<map>
#include<ctime>
#include<cstdio>
... | ALGO | 0.999894 | 3.395529 |
3cd84ea0-3a5d-494f-b58a-72395622e6f2 | Domcode237/educonnect | webkitgtk-2.40.5/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp | #include "config.h"
#include "FontSelectionAlgorithm.h"
namespace WebCore {
FontSelectionAlgorithm::FontSelectionAlgorithm(FontSelectionRequest request, const Vector<Capabilities>& capabilities, std::optional<Capabilities> bounds)
: m_request(request)
, m_capabilities(capabilities)
{
ASSERT(!m_capabilitie... | TOOL | 0.941511 | 7.220713 |
09eca886-3476-4cef-af95-e06abd13af9f | 27-aditya/LeetSols | 1863-sum-of-all-subset-xor-totals/1863-sum-of-all-subset-xor-totals.cpp | class Solution {
public:
int subsetXORSum(vector<int>& nums) {
int subtotal = 0;
for(int num : nums)
subtotal |= num;
return subtotal << (nums.size()-1);
}
}; | ALGO | 0.999973 | 5.740522 |
c3e07bd3-a7ce-411f-9a5d-56acd4cb4f06 | 1105Lakshya/DSA-TOPIC-WISE | 14_STACK/12_I_NEXT_SMALLER_ELEMENT.CPP | /*
Next Smaller Element
Difficulty: MEDIUM
Contributed By
Sounak Majumder
Level 1
Avg. time to solve
25 min
Success Rate
75%
Problem Statement
You are given an array 'ARR' of integers of length N. Your task is to find the next smaller element for each of the array elements.
Next Smaller Element for an array element i... | ALGO | 0.999933 | 5.824192 |
a82b61ac-ca90-4c6a-8bf8-9cb185f40214 | CodoStrofa/labi | laba_6.cpp | // laba_6.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <time.h>
using namespace std;
int return_max(int a, int b, int c)
{
int max = a;
if (b > max) max = b;
if (c > max) max = c;
return max;
}
int func_2(int low, in... | ALGO | 0.997837 | 3.781278 |
f2b2199e-6d77-449b-b5e9-2e3e6e2f9934 | mahfujarr/Cpp_practice | Lab2/8.cpp | #include <iostream>
using namespace std;
int main()
{
int z = 10, x = 0, y = 1, fib;
cout << x << " " << y << " ";
for (int i = 3; i <= z; i++)
{
fib = x + y;
x = y;
y = fib;
cout << fib << " ";
}
return 0;
} | ALGO | 0.99994 | 3.393721 |
890a45e7-4f78-4cd1-8b4a-111116bce54b | hnpyn/leetcode | string/541.反转字符串II.cpp | /*
给定一个字符串 s 和一个整数 k,从字符串开头算起, 每计数至 2k 个字符,就反转这 2k 个字符中的前 k 个字符。
如果剩余字符少于 k 个,则将剩余字符全部反转。
如果剩余字符小于 2k 但大于或等于 k 个,则反转前 k 个字符,其余字符保持原样。
示例:
输入: s = "abcdefg", k = 2
输出: "bacdfeg"
*/
#include <string>
using namespace std;
class Solution {
public:
string reverseStr(string s, int k) {
// 不要写太多逻辑判断和计数,从for循环... | ALGO | 0.999412 | 6.255797 |
8ce7bb34-c7f3-46e8-8abe-cbd05f5e1f14 | Yeah-Jack/cpp-projects | Console/English/BarcodeDigitChecker/main.cpp | // Create a program that calculates the check digit for an EAN barcode (EAN 8 or
// EAN 13).
// TODO: Add EAN 13
#include <iostream>
#include <vector>
#include <windows.h>
int main() {
SetConsoleOutputCP(CP_UTF8);
std::vector<int> digits;
std::cout << "Enter 7 digits: ";
for (int i = 0; i < 7; i++) {
i... | ALGO | 0.989474 | 6.61279 |
ef55130c-5b69-4a37-b62e-2bf1743d2530 | mohit701473/cpp | DSA Questions/Topic - 16 DP/Step 4 - DP on Strings/Que9_convertW1ToW2.cpp | // LeetCode -> 72. Edit Distance
https://leetcode.com/problems/edit-distance/
// Approch -> 1: recursion
// T.C. = Exponential
// S.C. = O(N + M)
class Solution {
int solve(int i, int j, string &word1, string &word2){
// base cases
if(i < 0) return j+1 ; // string word1 exhausted return j+1 i.e. ... | ALGO | 0.999919 | 6.725832 |
50ce45ed-d95a-4b5e-945f-995e77322af8 | HuifengShrimp/ABY_SecureML | src/examples/linear_regression/common/linear_regression.cpp |
#include "linear_regression.h"
#include "../../../abycore/circuit/arithmeticcircuits.h"
#include "../../../abycore/circuit/booleancircuits.h"
#include "../../../abycore/sharing/sharing.h"
#include "../../../examples/innerproduct/common/innerproduct.h"
#include "../../../abycore/sharing/arithsharing.h"
#include <ENCRY... | DATA | 0.940289 | 3.571571 |
d112fbc9-b5ba-4811-812f-42f31008077c | ishandutta2007/codeforces | amnesiac_dusk/normal/1185/G1.cpp | //#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
#ifdef rd
#define trace(...)... | ALGO | 0.999953 | 4.106393 |
c20ab362-dd43-465a-a13a-7fd766f657da | landbase-org/landbase | deps/common/metrics/histogram_snapshot.cpp | //
// Created by Longda on 2021/4/20.
//
#include "histogram_snapshot.h"
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <stdexcept>
namespace common {
HistogramSnapShot::HistogramSnapShot() {}
HistogramSnapShot::HistogramSnapShot(const std::vector<double> ... | TOOL | 0.985859 | 6.566127 |
1096b32a-230e-431b-ad5f-bc3619194814 | parag4690/DSA | Topic_8_linked_list/32_circular_linked_list.cpp | #include <bits/stdc++.h>
using namespace std;
class node{
public:
node *prev;
int data;
node *next;
}*head;
void create(vector<int> v){
node *t , *last;
head=new node;
head->data=v[0];
head->prev=head;
head->next = head;
last = head;
for(int i=1; i<v.size(); i++){
t=... | ALGO | 0.999958 | 5.056657 |
ab86b7ef-0402-425d-93da-84d3c10f755f | DhruvPandey1509/Vscode-Program-Folders | Problem-Solutions/Multiply_Strings.cpp | #include "bits/stdc++.h"
using namespace std;
class Solution
{
public:
string multiply(string num1, string num2)
{
if (num1 == "0" || num2 == "0")
return "0";
vector<int> v(num1.size() + num2.size(), 0);
for (int i = num1.size() - 1; i >= 0; i--)
{
for... | ALGO | 0.999961 | 5.770498 |
a8cb177b-ff7d-4eb9-a5b7-9a0d0d1b6b93 | raincross7/code-similarity | codes/train_code/problem190/problem190_445.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rep1(i,n) for(int i = 1; i <= n; ++i)
#define F first
#define S second
using namespace std... | ALGO | 0.99999 | 3.730007 |
38619528-c4bb-48cc-b856-d7bfd4abd337 | tmaandi/Model_Predictive_Control_Project | src/Eigen-3.3/doc/examples/TemplateKeyword_simple.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
void copyUpperTriangularPart(MatrixXf& dst, const MatrixXf& src)
{
dst.triangularView<Upper>() = src.triangularView<Upper>();
}
int main()
{
MatrixXf m1 = MatrixXf::Ones(4,4);
MatrixXf m2 = MatrixXf::Random(4,4);
std::cout << "m2 before copy:"... | TOOL | 0.976324 | 5.210898 |
26cc95f9-9076-4ac9-b529-28fee29d3eae | honokame/megarover_nnql | navigation/global_planner/src/quadratic_calculator.cpp | #include <global_planner/quadratic_calculator.h>
namespace global_planner {
float QuadraticCalculator::calculatePotential(float* potential, unsigned char cost, int n, float prev_potential) {
// get neighbors
float u, d, l, r;
l = potential[n - 1];
r = potential[n + 1];
u = potential[n - nx_];
d... | ALGO | 0.999848 | 4.837963 |
26e96493-0711-497e-a158-4c1cf9d56f94 | DATx-Protocol/DATx | datxchain/libraries/fc/src/crypto/elliptic_r1.cpp | #include <fc/crypto/elliptic_r1.hpp>
#include <fc/crypto/base58.hpp>
#include <fc/crypto/openssl.hpp>
#include <fc/fwd_impl.hpp>
#include <fc/exception/exception.hpp>
#include <fc/log/logger.hpp>
namespace fc { namespace crypto { namespace r1 {
namespace detail
{
class public_key_impl
{
p... | ALGO | 0.998383 | 7.148319 |
0bf7a502-7177-4847-932c-b2d42c9d4375 | Ariagg/presentasi_TWS | 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.99887 | 6.783439 |
fb8d7e2b-4dae-40d1-b1c1-0abd2f363158 | ishandutta2007/codeforces | thescrasse/normal/1359/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define ld long double
#define INF (ll)1e18
ll i, i1, j, k, k1, t, n, m, res, check1, a, b, num, mod;
ll fxp(ll b, ll e) {
ll k;
if (e == 0) return 1;
if (e % 2 == 0) {
k = fxp(b, e / 2);
return (k * k) %... | ALGO | 0.999983 | 4.993412 |
46d3ba23-7109-4d72-bd06-62cf8cc3d45b | reenasrigb/DAA-Practicals | 1.sum of digit(set4).cpp | #include<stdio.h>
int digitSum(int num) {
int sum = 0;
while (num > 0) {
sum += num % 10;
num /= 10;
}
return sum;
}
int maxDigitSumPair(int nums[], int size) {
int maxSum = -1;
for (int i = 0; i < size; ++i) {
for (int j = i + 1; j < size; ++j) {
if (i != ... | ALGO | 0.999982 | 6.397442 |
821be666-2f50-4aab-88b3-b6b9fc4a8954 | siddharthg1702/SecurityLab | Cipher Methods/hill.cpp | #include<bits/stdc++.h>
using namespace std;
/**
* Function to genenrate matrix
* */
void getKeyMatrix(string key, int keyMatrix[][100], int n)
{
int k = 0;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
keyMatrix[i][j] = (key[k]) % 65;
k++; ... | ALGO | 0.99998 | 5.097872 |
48f8ba6c-fc04-49f0-9258-3be71fff5035 | ICPCMansoura/Level-1-2024-2025-Sheets-solutions | Phase 2 - Sheet #3 DP Recurcive/Problem R - Boredom.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <class T>
using Ordered_Set = tree< T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T>
using Ordered_Multiset = tree< T, n... | ALGO | 0.999974 | 4.680439 |
3cbc0fb4-f95f-46f2-be6b-fee53ac979ee | GersonCavalheiro/OpenMPSnapshot | May2023/RepCPP/573211358/openmp.cpp | #include <omp.h>
#include "physics.h"
#include "shared.h"
int n_omp_threads;
void update(float *data, float *new_data) {
#pragma omp parallel for
for (int i = 1; i < (size - 1); i++){
for (int j = 1; j < (size - 1); j++){
int idx = i * size + j;
if (fire_area[idx]) new_data[idx] = fire_temp;
else {
float up = data[id... | ALGO | 0.999797 | 4.547149 |
baf216be-4ab8-46a6-8795-46733f03a3a0 | Nonbangkok/Competitive_Programming | POSN/Camp_2/Exam/C2_64_Lan.cpp | #include <bits/stdc++.h>
#define coutf(n, m) cout << fixed << setprecision(n) << m
#define forr(i, a, n) for (int i = a; i < n; i++)
#define forl(i, a, n) for (int i = a; i > n; i--)
#define macos ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endll "\n"
#define sp " "
typedef long long ll;
using namespace std;... | ALGO | 0.999724 | 3.604393 |
732e386d-3179-4c76-9af5-e335fb916824 | 3StarAnchovy/Algorithm | swea/c++/8741.cpp | #include <iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cout.tie(NULL);
cin.tie(NULL);
int T;
cin >> T;
for (int i = 0; i < T; i ++)
{
string input;
char result[4];
result[3] = '\0';
for(int j = 0; j < 3; j ++)
{
cin >> input;
result[j] = input[0] - ('a' - 'A');
}
... | ALGO | 0.999752 | 3.660915 |
5cc78780-111c-404d-852f-751a5a0d8744 | rappelrx/covid-simulation | CovidGenomeAnalysis.cpp | #include <iostream>
#include <cstdio> // scanf is faster than cin
#include <string>
using namespace std;
const unsigned int COVID_BASE_PAIRS = 30001;
const string EMPTY_STRING = "";
struct Purines {
const char adenine = 'A';
const char guanine = 'G';
};
struct Pyrimidines {
const char thymine = 'T';
... | ALGO | 0.998035 | 5.880765 |
204b195b-2806-45d0-a43a-1aa5e91ad0ca | suhaas02/Data-structures-and-algorithms | 349-intersection-of-two-arrays/intersection-of-two-arrays.cpp | class Solution {
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
set<int> temp;
std::vector<int>::iterator it;
for(int i = 0;i < nums1.size();i++)
{
it = std::find(nums2.begin(),nums2.end(),nums1[i]);
{
if(it... | ALGO | 0.99978 | 5.354258 |
1687d1c2-f322-4022-a411-d967dd346f1c | khoivux/DSA | Contest Sinh/B25. Ma so may tinh.cpp | #include <bits/stdc++.h>
#define ll long long
/*
N ký tự
đầu tiên là hoán vị của N chữ cái in hoa đầu tiên, tính từ A. N ký tự tiếp theo là
các ký tự số bất kỳ từ 1 đến N (có thể trùng nhau)
*/
using namespace std;
int n;
int a[1999];
vector<string> v1, v2;
int used[1999] = {0};
void solve1()
{
string s = "";
for(... | ALGO | 0.999365 | 3.81853 |
c70f484d-ae3f-4970-8b8f-0d165fa35ba7 | jhanssen/libcxx | test/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// Iter
// is_sorted_until(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_iterators.h"
template <class Iter>
void
test()
{
{
int a[] = {0};
unsigned sa = sizeof(a) / si... | TEST | 0.995143 | 7.226187 |
6a0fd77c-78d5-46af-b77b-f3b4308147f8 | TheWiseWolfy/Expresion-Tree-Solver | Arbori de grad oarecare/Source.cpp | #include <iostream>
#include "Header.h"
using namespace std;
int main() {
cout << "Va rog introduceti o expresie.\n";
Nod* T = creareArbore();
cout << "Gradul arborelui este:\n";
cout << gradArbore(T) << endl;
cout << "Operanzi introdusi sunt\n";
afisareOperanzi(T);
cout << endl;
cout <<"Rezultatul expre... | ALGO | 0.992144 | 4.061203 |
d7bf42a0-e19d-4759-8024-0d9566fde176 | ishandutta2007/codeforces | wsyhb/normal/1324/A.cpp | #include<bits/stdc++.h>
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
using namespace std;
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",&n);
bool f1=false,f2=false;
while(n--)
{
int x;
scanf("%d",&x);
if(x&1) f1=true;
else f2=true;
}
if(f1&&f2) printf("NO\n");... | ALGO | 0.999192 | 4.079968 |
f0f615a7-c4e2-4e29-a889-f9b2c2e4cbbf | MANAS-CHARCHI/DSAPratice | Array/stringCompression.cpp | #include<iostream>
#include<string>
#include<unordered_map>
using namespace std;
string compression(string str){
string result;
int repeted=0;
for(int i=0;i<str.length();i++){
repeted++;
if(i+1>=str.length() || str[i]!=str[i+1]){
result+=str[i]+to_string(repeted);
re... | ALGO | 0.99999 | 5.329627 |
8794c5e0-69c0-41af-9034-d1c66aa443a3 | Muhammad-Ismail-Qazi/cloud-firestore | 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.998784 | 6.761023 |
0a938f34-15b3-4b8f-8fa6-3434aa2a292b | Phantasm-Studios/UnrealEngine | Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.4u3/examples/graph/dining_philosophers/dining_philosophers.cpp | #if _MSC_VER
// Suppress "decorated name length exceeded, name was truncated" warning
#pragma warning (disable: 4503)
#endif
#include "tbb/flow_graph.h"
#include "tbb/task_scheduler_init.h"
#include "tbb/tick_count.h"
#include "tbb/tbb_thread.h"
#include "tbb/atomic.h"
#include "tbb/spin_mutex.h"
#include <ios... | ALGO | 0.983378 | 4.725851 |
db49dd4b-4faf-48d3-be51-7ea362fc7755 | harish3110/SDCND-P10-Model_Predictive_Control | src/Eigen-3.3/unsupported/doc/examples/EulerAngles.cpp | #include <unsupported/Eigen/EulerAngles>
#include <iostream>
using namespace Eigen;
int main()
{
// A common Euler system by many armies around the world,
// where the first one is the azimuth(the angle from the north -
// the same angle that is show in compass)
// and the second one is elevation(the angl... | ALGO | 0.989945 | 5.125681 |
d44b0eb1-702a-432e-bf5b-1e6342abb6e7 | ishandutta2007/codeforces | djq_cpp/normal/1043/F.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <cctype>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#inclu... | ALGO | 0.99997 | 3.736627 |
299146cf-c624-495f-a995-a7a7c16c9e53 | rovinbhandari/Programming_Scripting | ProgrammingCompetitions/ACM-ICPC/ACM-ICPC_12/Amritapuri/online contest/ACM-ICPC Amritapuri 2012 Online Competition Accepted Solutions/A/cpp/00002739_A_PAIRSOCKS_amicpc120270.cpp | //Author : aitch_nu
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<utility>
#include<set>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int r=0,g=0,b=0,w=0;
char str[10000];
scanf("%s",str... | ALGO | 0.999231 | 3.870797 |
b3fdb97d-544b-4903-b3a1-b835866f4625 | srivastava-yash/file-meta | src/lib.cpp | #include "lib.h"
std::uintmax_t get_file_size(std::string filepath) {
const fs::path path = fs::u8path(filepath);
std::uintmax_t fsize_in_bytes = fs::file_size(path);
double fsize_in_mb = static_cast<double>(fsize_in_bytes) / (1024.0 * 1024.0);
return fsize_in_mb;
}
bool has_whitespace_start_and_end(s... | TOOL | 0.867468 | 5.508961 |
766c64a7-c5f2-441d-9cac-6232775f8103 | TrentonBitterli/Chunity-Musical-Instrument | XR Hand Project/Library/PackageCache/com.unity.ide.visualstudio@2.0.18/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.963021 | 6.926379 |
de6a23ea-c05b-4304-bdfd-a9bf140c37a8 | kimbobv22/CMMSimpleFramework | SampleProject/ShowCase/SimpleFramework/libs/Box2D/Dynamics/Joints/b2WeldJoint.cpp | #include <Box2D/Dynamics/Joints/b2WeldJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Point-to-point constraint
// C = p2 - p1
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i ... | ALGO | 0.990531 | 6.746767 |
9c417990-94b6-4c77-8910-40f721fec1aa | an0520a/boj | BOJ_18111.cpp | #include <stdio.h>
#include <stdlib.h>
#include <queue>
#include <vector>
typedef unsigned int u32;
typedef unsigned long long u64;
typedef long long i64;
using namespace std;
int main()
{
u32 N, M;
u32 org = 100;
u32 result = 0;
bool button[10] = { true, true, true, true, true, true, true, true, tru... | ALGO | 0.999676 | 4.037713 |
13007fee-892c-4618-81a8-b27af2a9d95a | berylyvos/lcl | src/852-peak-index-in-a-mountain-array/main.cpp | #include <cstdio>
#include <vector>
#include <cassert>
using namespace std;
// 山脉数组
// 存在 i(0 < i < arr.length - 1)使得:
// arr[0] < arr[1] < ... arr[i-1] < arr[i]
// arr[i] > arr[i+1] > ... > arr[arr.length - 1]
class Solution {
public:
int peakIndexInMountainArray(vector<int>& arr) {
assert(arr.size() >= ... | ALGO | 0.999952 | 4.895185 |
a7ca7cd5-44d3-45af-90cc-844f03205ea2 | C9Teenz/perlombokan | 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 |
cd9c6bef-8d2e-4b2c-be16-180377b4f60c | lattalab/slove-problem | Star 3/uva11503.cpp | // accepted
#include <iostream>
#include <map>
using namespace std;
map<string, string> parent;
map<string, int> ranks;
map<string, int> count; // count the disjoint set size
void makeSet(string x) {
if (parent.find(x) == parent.end()) {
parent[x] = x;
ranks[x] = 0;
count[x] = 1; // coun... | ALGO | 0.999907 | 4.819912 |
d2a20afe-f426-4d7f-8c3d-490c18e04db7 | chy-2003/Checker | CheckerLib/ncmp.cpp | #include "testlib.h"
#include <sstream>
using namespace std;
int main(int argc, char * argv[])
{
setName("compare ordered sequences of signed int%d numbers", 8 * int(sizeof(long long)));
registerTestlibCmd(argc, argv);
int n = 0;
string firstElems;
while (!ans.seekEof() && !ouf.seekEof())
{... | TEST | 0.932375 | 3.982021 |
75e355e1-8c03-40c7-8592-009fc3baad33 | dqian3/cp-templates | ds/segment_lazy.cpp | #include <bits/stdc++.h>
#define NOOP INT_MAX
using namespace std;
typedef long long ll;
// Segment tree that supports assignment over ranges with lazy propagation
struct st {
int size;
int n;
vector<ll> ops;
int op(int a, int b) {
if (b == NOOP) return a;
return b;
}
v... | ALGO | 0.999784 | 4.084116 |
2ebfca4d-0f33-4a5a-a1c8-586e874a7ab3 | ArtemTKC/10A_Strings | B_upcase_lowcase.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int N;
string symbols;
cin >> symbols;
if(((symbols[0])>=65) and ((symbols[0])<=90)) cout << char(tolower(symbols[0]));
if(((symbols[0])>=97) and... | ALGO | 0.998532 | 4.526805 |
9e3eb526-a0cb-4101-825d-5f26bfba340c | NickRaise/DSA-Striver-SDE-Sheet | Array/Medium/06_Rearrange_Array_Elements_by _ign(even-elements).cpp | // Rearrange Array Elements by Sign
// Variety-1 (Even elements)
// Problem Statement: There’s an array ‘A’ of size ‘N’ with an equal number of positive and negative elements.
// Without altering the relative order of positive and negative elements, you must return an array of alternately positive and negative values... | ALGO | 0.999909 | 5.769567 |
a56763ee-01be-4c9e-bc34-497e7820822d | Feroz455/Fundamentals-Of-Computer-Algorithms | Chapter_05/Exercises_5.2/01.cpp | /*
Page 282
01) Find a minimum-cost path from s to t in the multistage graph of figure
5.4. Do this first using the forwad approach and then using the backword approach
*/
#include <iostream>
#include <iomanip>
using namespace std;
void PrintArray(int array[], int n)
{
cout << "\n";
for (int i = 1; i < n; i++)... | ALGO | 0.999991 | 3.102039 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.