uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9d95d6d6-d13c-4879-a9e6-4a68f3d7ab91 | rayjim/boost | libs/geometry/doc/src/examples/algorithms/distance.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[distance
//` Shows calculation of distance of point to some other geometries
#include <iostream>
#include <list>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/geometries/point_xy... | ALGO | 0.996303 | 5.598009 |
6def5e4b-7903-4824-91fc-9afb7c4c4e60 | caozhen-bupt/buptcodes | datastructure/final6.cpp |
/*ͷļ*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/**/
#define MAXN 10000
/*Ͷ*/
typedef int ElementType;
/**/
int A1[MAXN],A2[MAXN],B1[MAXN],B2[MAXN],C1[MAXN],C2[MAXN];
/*Ӻ*/
void InsertSort(ElementType A[],int begin, int end){//
int i,j;
ElementType temp;
for (i... | ALGO | 0.999861 | 4.323002 |
e7c2e1eb-ef4a-4965-814f-f7134dcc167a | phs7646/codingtest | CPP/div2/20364/sol.cpp | #include<iostream>
#include<vector>
using namespace std;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
int N,Q;
cin >> N >> Q;
vector<int> v(Q);
for(int i = 0;i < Q;i++) cin >> v[i];
vector<bool> visited(N);
for(int target : v) {
//target에서 시작해서 루트까지 트래블하면서 만나는 노드 ... | ALGO | 0.999992 | 3.950773 |
99371f97-7a20-45c5-89bc-98cd162679d9 | CI-WATER/TauDEM-LFS-Test | src/SinmapSI.cpp | /* Program to compute stability index and factor of safety for landslide
Hazard mapping.
*/
/*
David G Tarboton
Utah State University
SINMAP package version 1.0 3/30/98
Acknowledgement
---------------
This program developed with the support of Forest Renewal of British Columbia,
in collaboration ... | ALGO | 0.998648 | 3.216228 |
9fe29469-73a8-40fb-b275-3339355e9673 | Utkarsh-Dyundi/Competitive-Programming | A_Party.cpp | #include<bits/stdc++.h>
using namespace std;
#define tr(c,it) for(typeof(c.begin()) it=c.begin();it!=c.end();++it)
#define all(c) c.begin(),c.end()
#define mod 1000000007
#define itor(c) typeof(c.begin())
#define ll long long
#define vi vector<int>
#define si set<int>
#define msi multiset<int>
#define ii pair<int,int>
... | ALGO | 0.999517 | 3.650548 |
1bf60c92-26d2-43ce-a478-70117c3c04f5 | PrajwalaTM/accepted | Codechef/BINOP.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define l long
#define MAX 100003
#define MOD 1000000007
#define fin(i,a,n) for(i=a;i<=n;i++)
#define fde(i,a,n) for(i=n;i>=a;i--)
#define sd(a) scanf("%d",&a)
#define sld(a) scanf("%ld",&a)
#define slld(a) scanf("%lld",&a)
#define slf(a) scanf("%lf... | ALGO | 0.999967 | 4.027283 |
201006cd-a0d4-4e63-9030-50cf3b5f88b8 | AmiteshSingh45/Decode-DSA-with-CPP | BinaryAndLinearSearch/lower_bound.cpp | #include<iostream>
using namespace std;
int main () {
int arr[9]={1,2,4,5,9,15,18,21,24};
int target=17;
int n=9;
int low=0;
int high=n-1;
bool flag=false;
while(low<=high){
int mid=(low+high)/2;
if(arr[mid]==target){
cout<<arr[mid]-1;
flag=true;
... | ALGO | 0.999891 | 3.943374 |
4b35d31f-095c-4416-82f7-af05a9b777c3 | sim82/papara_nt | pw_dist.cpp | #include <fstream>
#include <memory>
#include <deque>
#include "fasta.h"
#include "ivymike/write_png.h"
#include "ivymike/statistics.h"
#include "ivymike/thread.h"
#include "ivymike/getopt.h"
#include <functional>
#include <iomanip>
// #define PWDIST_INLINE
#include "pairwise_seq_distance.h"
//void pairwise_seq_dista... | ALGO | 0.990038 | 4.779645 |
2268164c-6708-4c5a-b178-f61cfcf27974 | ishandutta2007/codeforces | zemen/normal/1142/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
struct pt {
ll x, y;
pt operator+(const pt& p) const { return pt{x + p.x, y + p.y}; }
pt operator-(const pt& p) const { return pt{x - p.x, y - p.y}; }
ll operator*(const pt& p) const { return x * p.x + y * p.y; }
ll ... | ALGO | 0.999976 | 5.430317 |
1250d38f-ae8f-48b0-ba37-a0633c7fe822 | alps-jbnu/25ALPStudy | 2025-1/Basic/dark6409/Stack/1874.cpp | #include <iostream>
#include <stack>
using namespace std;
int main() {
int n; cin >> n;
stack<int> s; // 최소 하나는 있음
string ans;
int c=1; // 반복문 바깥에서 정의함. c는 반복문에서 계속 증가하기만 할 거임
while(n--){
int x; cin >> x;
while(c <= x) {
s.push(c++);
ans += "+\n";
}
if(s.top() != x){
cout <... | ALGO | 0.99992 | 4.357941 |
6848f32d-d47a-4e3f-b2cb-37a5419ff13b | greenrain78/alps13 | HBS/4주차/3019.cpp | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
typedef struct schedule
{
char name[99];
int year;
int month;
int date;
}student;
bool compare(schedule a, schedule b)
{
if (a.year > b.year)return false;
else if (a.year < b.year)return true;
else if (a.month > b.month)return false... | ALGO | 0.999196 | 3.901282 |
f0df8e48-b965-4056-a9d8-53dde3b73abb | shadowmydx/jiuduOJ | Least Common Multiple.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <cstdio>
using namespace std;
/*
1ĿҪԻ
*/
long long gcd(long long a,long long b)
{
if(a % b == 0)
return b;
else return gcd(b,a % b);
}
long long gcm(long long a,long long b)
{
if(a < b)
{
long long tmp = a;
a = b... | ALGO | 0.999928 | 3.044124 |
2e99adab-6e70-41f7-903f-8935a9e65849 | loganchien/llvm | lib/Analysis/PostDominators.cpp | #include "llvm/Analysis/PostDominators.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/GenericDomTreeConstruction.h"
using namespace llvm;
#define DEBUG_TYPE "postdomtree"
... | ALGO | 0.982085 | 6.940807 |
1d91bc9b-6605-4b89-944c-c220627b9676 | MITHaystack/HOPS | extern/matplotplusplus/source/3rd_party/nodesoup/src/layout.cpp | #include "layout.hpp"
#include "algebra.hpp"
#include <cmath>
#include <limits>
namespace nodesoup {
using std::vector;
void circle(const adj_list_t& g, vector<Point2D>& positions) {
double angle = 2.0 * M_PI / g.size();
for (vertex_id_t v_id = 0; v_id < g.size(); v_id++) {
positions[v_id].x = cos(v_... | ALGO | 0.959234 | 6.081459 |
c76a901a-cb7e-4aa0-ab00-132a8cfdf7ee | bitcoinlovecoin/BitcoinLove | src/crypto/hmac_sha256.cpp | #include "crypto/hmac_sha256.h"
#include <string.h>
CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen)
{
unsigned char rkey[64];
if (keylen <= 64) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 64 - keylen);
} else {
CSHA256().Write(key, keylen).Finalize(rke... | ALGO | 0.985362 | 5.856034 |
3da180fe-45bb-413a-8258-3c03f7d5b80d | uoptrainee/flutterweb1 | 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.9988 | 6.76073 |
0a4a2d8f-a488-49e7-a077-4cc872955d99 | fuguiw/oj | LeetCode/Count Primes.cpp | #include <iostream>
#include <cmath>
using namespace std;
class Solution {
public:
int countPrimes(int n) {
if (n <= 2)
return 0;
bool *primes = new bool[n];
memset(primes, 1, n);
double c = sqrt(n);
for (int i = 2; i <= c; i++) {
if (primes[i] == f... | ALGO | 0.999873 | 4.944116 |
f40e0cf7-bd30-4401-9c40-36b75574f70b | Harsimran-s17/GFG-and-LeetCode-Problems | Make Zeroes - GFG/make-zeroes.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
void MakeZeros(vector<vector<int> >& matrix) {
// Code here
int r = matrix.size();
int c = matrix[0].size();
... | ALGO | 0.999694 | 5.792941 |
cc5e0ff4-cdd1-49e0-bf44-9b10ac91661e | SilverShades02/frameworks_base | tools/aapt2/Main.cpp | #ifdef _WIN32
// clang-format off
#include <windows.h>
#include <shellapi.h>
// clang-format on
#endif
#include <iostream>
#include <vector>
#include "android-base/stringprintf.h"
#include "android-base/utf8.h"
#include "androidfw/StringPiece.h"
#include "Diagnostics.h"
#include "util/Files.h"
#include "util/Util.h"... | TOOL | 0.881308 | 7.644154 |
f4d87332-2316-44d0-bb0d-569ab1637df3 | NuRifat/Phitron-batch-5 | Semester 2/Introduction to Algorithm/Module 3 DFS & 2D grid/dfs_2d_grid.cpp | #include<bits/stdc++.h>
using namespace std;
char a[20][20];
bool vis[20][20];
vector<pair<int,int>> d ={{0,1},{0,-1},{-1,0},{1,0}};
int n,m;
bool valid(int i, int j){
if(i<0 || i>=n || j<0 || j>=m){
return false ;
}
return true;
}
void dfs(int si, int sj){
cout << si << " " << sj << endl;
v... | ALGO | 0.999893 | 3.025455 |
652c8ed2-eea2-4273-b4e8-cdb259c6936c | m04j00/class2-coding-study | BaekJoon/Project/Project/no2-3_2753.cpp | #include <iostream>
using namespace std;
int main() {
int year, re;
cin >> year;
if (year % 4 == 0 && year % 100 != 0) re = 1;
else if (year % 400 == 0 && year % 100 == 0) re = 1;
else re = 0;
cout << re;
} | ALGO | 0.999956 | 3.720792 |
877c4e50-3013-4d05-9c76-dffc88f4f185 | azzyr/fortressforever-2013-reborn | src/mathlib/almostequal.cpp | #include <float.h>
#include <math.h>
#include "mathlib/mathlib.h"
static inline bool AE_IsInfinite(float a)
{
const int kInfAsInt = 0x7F800000;
// An infinity has an exponent of 255 (shift left 23 positions) and
// a zero mantissa. There are two infinities - positive and negative.
if ((*(int*)&a & 0x... | TOOL | 0.931823 | 6.345742 |
f7fc9df5-2c44-479c-a34f-5624f7507b62 | ElihuTM/problems-solved | CodeForces/ArrayWalk.cpp | #include <bits/stdc++.h>
#define ff first
#define ss second
#define mod 1000000007
#define maxn 100005
#define md(x) (((x%mod) + mod) % mod)
#define p_b(a) push_back(a)
#define all(x) x.begin(),x.end()
#define sz(a) s.size()
#define endl '\n'
using namespace std;
typedef long long ll;
typedef long double ld;
typedef v... | ALGO | 0.999773 | 3.524645 |
19909b3d-cf7a-47cd-b52a-04e4959f3fa1 | trdln/Codemode_PP1_2021 | BN/05.11/1.cpp | #include <iostream>
using namespace std;
bool unique(int n, int a[]){
for(int i = 0; i < n; ++i){
int value = a[i];
for(int j = i + 1; j < n; ++j){
if( value == a[j] ){
return false;
}
}
}
return true;
}
int main(){
freopen("input.t... | ALGO | 0.999429 | 4.914863 |
b138f968-0b5e-47b1-a059-a52fbb54876e | wnoc-drexel/SynchroTrace-gem5-v20 | src/systemc/tests/systemc/misc/examples/parsing/activa.cpp | /*****************************************************************************
activa.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.990116 | 6.045314 |
7514d1ad-4f56-48c5-ba36-bed962ffb793 | vrishaarora/Schedule-Creation-Program | final-project-alamp009-varor004-xwang298-jmin045/src/TaskList.cpp | #include <algorithm>
#include <sstream>
#include <cassert>
#include "../header/TaskList.h"
#include "../header/EditUtility.h"
TaskList::TaskList() {
tasks = {};
completedTasks = {};
}
SortStrategy* sortStrategy = {};
//---------------------------------------------Above are init part--------------------------... | TOOL | 0.881521 | 6.174256 |
13f55df4-e53f-4866-82b1-1b2c2d5b14e8 | Adarshkaintura/leet_code_ARS_challenge | Day3/Slowest_Key_1629.cpp | class Solution {
public:
char slowestKey(vector<int>& releaseTimes, string keysPressed) {
int time=releaseTimes[0];
char ch=keysPressed[0];
for(int i=1;i<releaseTimes.size();i++){
int temp=releaseTimes[i]-releaseTimes[i-1];
if(time<temp||(time==temp && keysPre... | ALGO | 0.999888 | 6.189083 |
8fb2a2b6-585b-41b4-b198-278f862d2669 | allwellll/cf_code_jiangly | cuiaoxiang/666/666A-A-ReberlandLinguistics.cpp | // url:https://codeforces.com/contest/666/problem/A
// time:2022-04-02 13:15:37
// name:A-ReberlandLinguistics
// #define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector... | ALGO | 0.999796 | 3.985393 |
25b90993-e229-4da4-baaa-3551dc6caf87 | chrzhang/abc | maths/pascalsTriangle/main.cpp | #include <iostream>
#include <vector>
// Generate Pascal's triangle of a given # of rows
void printTriangle(const std::vector<std::vector<int>> & t) {
for (auto row : t) {
for (auto e : row) {
std::cout << e << " ";
}
std::cout << "\n";
}
}
std::vector<std::vector<int>> ge... | ALGO | 0.997878 | 7.096879 |
0e2568a8-45d5-4f02-92a0-c5462aed038f | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4846_1.cpp | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7, siz = 1e6 + 5;
long long t, n, m, k, a[siz], prime[siz], factors[siz];
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
for (long long i = 2; i < siz; i++) {
if (prime[i]) continue;
for (long long j = i; j < siz; j += i... | ALGO | 0.999996 | 4.149708 |
86df749b-65b2-4656-8b16-65e6062e8033 | kshiozaw/AtCoder | ABC/abc175/progC.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define max_num 1000000000000000000
#define max_itr 10000000
int main(){
ll x,k,d;
cin >> x >> k >> d;
if(x<0) x=-x;//xを正にする
//k回移動しても0を超えない場合
if(x/d>k){
x-=d*k;
cout << x << endl;
return 0;
}else{
ll step = x/d;
k-=step;
x-=step... | ALGO | 0.999963 | 3.627457 |
957788f4-de1c-4998-a3ca-159ae5fd80a9 | kreelsama/XDU-SEC | Information Security Foundamental Experiments/miracl/ipk_enc.cpp | /*
Cock's Identity Based Encryption
Encryption phase
Generates a random AES session key, and uses it to encrypt a file.
Outputs ciphertext <filename>.ipk
The session key is ID_PKC encrypted, and written to <filename>.key
Requires : big.cpp
*/
#include <iostream>
#include <fstream>
#include ... | ALGO | 0.96327 | 4.473773 |
2f9300ca-092f-413d-bc4e-8842de500517 | jesusdourado/facul-so | 4_menor_job.cpp | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#define MAX 10
#define RANGE_RNG 4
#define BEGIN_ASCII 65
int pTime[MAX]; // Lista de tempo de execução dos processos
char pID[MAX]; // Lista de ID dos processos
int tam = 0; // Tamanho da fila de processos
int ID_generator = 0; // Control... | ALGO | 0.998964 | 4.390477 |
77635fc6-6008-4f9b-9bab-e83e0a0a4f62 | peterzheng98/gpu-memory | src/base/pytorch/third_party/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(2);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,
1;
//add v to each column of m
mat.colwise() += v;
std::cout << "Broadcasting result: " << std::endl;... | ALGO | 0.997092 | 4.136906 |
a7dacaf6-6a5c-45ad-897f-7ddf4459f106 | rdivi297/DSA | 1945-sum-of-digits-of-string-after-convert/1945-sum-of-digits-of-string-after-convert.cpp | class Solution {
public:
int solve(string &s,int sum){
string x="";
for(auto i:s){
x+=to_string(i-'a'+1);
}
for(auto i:x){
sum+=i-'0';
}
return sum;
}
int getLucky(string s, int k) {
int sum=solve(s,0);
for(i... | ALGO | 0.999965 | 6.08309 |
543ec157-96a9-47e6-be45-40b58a206071 | cvneves/Kit-OR | BB/src/Tour.cpp | #include "Tour.h"
std::vector<std::vector<int>> construirSubtours(int **m, const int &N)
{
std::vector<std::vector<int>> subtours;
std::vector<int> candidatos(N);
for (int i = 0; i < N; i++)
candidatos[i] = i + 1;
while (candidatos.empty() == false)
{
int inicio = candidatos[0]; /... | ALGO | 0.999513 | 3.959535 |
1494287a-c84a-4e72-af41-0e55bfcce2ce | hexu1985/cpp_book_code | cpp.func.handbook/ch02/2-3-57.cpp | #include<iostream.h>
#include<math.h>
#include<string.h>
int _matherrl(struct _exceptionl *e)
{
if(e->type==DOMAIN)
{
if(strcmp(e->name,"powl")==0&&e->arg1==0&&e->arg2<0)
{
cout<<"powl("<<e->arg1<<","<<e->arg2<<") is not correct!"<<endl;
cout<<"Now set it to be 0"<<endl;
e->retval=0;
return 0;
... | ALGO | 0.933722 | 4.044699 |
3e29f78c-cd6b-47c0-8d5b-faa1bf149ad7 | Nikfilk2030/word_count | main.cpp | #include "lib.h"
#include "CLI/CLI.hpp"
int32_t THREAD_COUNT = 20;
int main(int argc, char** argv) {
CLI::App app{"Word Frequency Counter"};
static std::string inputFileName;
static std::string outputFileName;
bool multithreaded = false;
app.add_option("-i,--input", inputFileName, "Input file na... | TOOL | 0.958254 | 6.400294 |
edd98de6-5618-43cb-a052-4a550bbbc688 | indu-in/cctbx_project1 | xfel/metrology/legacy_scale/scale_core.cpp | #include <xfel/metrology/legacy_scale/parameters.h>
#include <scitbx/constants.h>
#include <scitbx/vec3.h>
xfel_legacy::parameter::parameter_array::parameter_array(
int const& ndata,int const& kdim,farray d):
parameters(d),
gradients(ndata*kdim,scitbx::af::init_functor_null<double>()),
curvatures(ndata*kdim,sc... | TOOL | 0.925943 | 5.94765 |
e058faaf-ac78-42e5-9b73-a99804eaedc7 | soup1997/Algorithm | 프로그래머스/2/42747. H-Index/H-Index.cpp | #include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> citations) {
int answer = 0;
sort(citations.begin(), citations.end(), greater<>()); // 오름차순 정렬
if (!citations[0]) return 0; // 제일 많은 인용횟수가 0이면 볼 필요도 없음
for(int i=0; i<citations.size(); i++){ // {6, 5, 3, 1, 0}
... | ALGO | 0.999835 | 5.89393 |
02a5ac77-feac-4176-90f4-1497a0f3f235 | ishandutta2007/codeforces | hank55663/normal/1037/D.cpp | #include<bits/stdc++.h>
#define mp(a,b) make_pair((a),(b))
#define pii pair<int,int>
#define pll pair<LL,LL>
#define pb push_back
#define x first
#define y second
#define sqr(x) ((x)*(x))
#define EPS 1e-6
#define MEM(x) memset(x,0,sizeof(x))
#define MEMS(x) memset(x,-1,sizeof(x))
#define pi acos(-1)
#define index Index... | ALGO | 0.999998 | 3.693138 |
732ec769-01d7-46bf-9665-2ca89827ac1c | dongAxis/clang-700.0.72 | src/lib/ProfileData/CoverageMapping.cpp | #include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ProfileData/CoverageMappingReader.h"
#include "llvm/ProfileData/InstrProfReader.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "l... | TOOL | 0.937972 | 7.749427 |
e863c029-f01c-453c-aa5a-9ef9ad93acc5 | Stblacq/mesh_planner | lvr2/ext/kintinuous/kfusion/src/projective_icp.cpp | #include <kfusion/precomp.hpp>
using namespace kfusion;
using namespace std;
using namespace kfusion::cuda;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// ComputeIcpHelper
kfusion::device::ComputeIcpHelper::ComputeIcpHelper(float dist_thres, float... | ALGO | 0.998289 | 6.751811 |
81fe0d1b-6a8f-45f3-bbeb-76a4c6528be4 | kimziou77/algorithm | boj/1915_가장 큰 정사각형.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int map[1001][1001];
int n, m;
int max_size = 0;
int sol() {
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
if (map[i][j]!=0) {
int& L = map[i][j - 1];
int& U = map[i - 1][j];
int& LU = map[i - 1][j - 1];
... | ALGO | 0.999483 | 3.249214 |
60946cff-a450-4a0f-a5a9-c4fff6d8a00f | saurabh-kud/DSA | mca_oops/gross.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int grossSalary,it,hra,da,net_salary;
cout>>"enter your gross salary ";
cin>>grossSalary;
cout<<"enter your tax ";
cin>>it;
cout<<"enter your hra";
cin>>hra;
cout<<"enter your da ";
cin>>da;
net_salary-=(grossSalary*it)/100;
net_salary+=(grossSal... | ALGO | 0.96782 | 3.185848 |
7f2cd206-e474-4edc-8696-debb0a15d579 | josuemoreau/Jugglyng | Expérimentations/Juggling DLX/DLX/dlx.cpp | /**
* Implémentation de l'algorithme X
* --------------------------------
*
* La description de l'algorithme se trouve dans
* The Art of Computer Programming, Volume 4, Fascicule 5
*/
#include <iostream>
#include <vector>
#include <unordered_map>
#include <string>
#include <functional>
#define INT long int
us... | ALGO | 0.999918 | 4.609906 |
47556b05-aa71-4842-9de3-f816c615b336 | aanchal2320/LeetCode | 671-second-minimum-node-in-a-binary-tree/671-second-minimum-node-in-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.999984 | 6.338964 |
5cde51d3-52f3-4411-9e07-d3a091caf6b5 | IshanC05/LeetCode-Questions | Length Unsorted Subarray - GFG/length-unsorted-subarray.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
vector<int> printUnsorted(int arr[], int n) {
if (n < 2) {
return {0, 0};
}
int i = 0, j = n - 1;
while (i < n - 1 && arr[i] <= arr[i + 1]) {
... | ALGO | 0.999677 | 5.365963 |
6870cd4f-0229-4219-b4a8-8e57bedb2bcd | KozerG17/bai-tap-doi-tuyen | 011121/bonus100.cpp | /**
* author: Dao Le Bao Minh
* created: 01.11.2021 08:32:03
**/
#include <bits/stdc++.h>
#ifndef LBM_LOCAL
#define debug(x...) 17
#endif
// /*
#define fi first
#define se second
// */
#define all(a) (a).begin(), (a).end()
#define For(i, a, b) for (int i = a; i < b; i++)
#define Rof(i, a, b) for (int i... | ALGO | 0.998265 | 3.582963 |
33b8c280-1a49-4716-ae94-d37061b41eb1 | ISTE-DSA-Summer-School/Kavish_220962398 | Worksheet 5/q6.cpp | //Write a program to delete the middle element from a stack
#include <iostream>
#include<vector>
using namespace std;
class Stack{
private:
static const int MAX_SIZE = 100;
int a[MAX_SIZE];
int top;
public:
Stack(){
top = -1;
}
bool isEmpty() {
... | ALGO | 0.999923 | 5.226959 |
8ff5156b-b36a-4059-8ad3-44e7fdd972bf | ducknife/240_bai_CPP_codeptit | CPP0220.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while (t--){
int n; cin >> n;
int a[n][n];
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++) cin >> a[i][j];
}
for (int i = 0; i < n; i++){
for (int j = 0; j < n;... | ALGO | 0.999834 | 3.438583 |
b2b4b666-02f3-40ad-89ea-938908482bed | nhu220840/C-plus-Tutorial | Mang 2 chieu/HoanViDuongCheo.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
int a[n][n];
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
cin >> a[i][j];
}
}
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(i == j)
swa... | ALGO | 0.99997 | 3.481001 |
cd38d228-24d8-4477-8130-87233f183f94 | healerXvivek/DSA | GREEDY/minimum_number_of_coins.cpp | # https://practice.geeksforgeeks.org/problems/-minimum-number-of-coins4426/1
class Solution{
public:
vector<int> minPartition(int n)
{
vector<int> coin{ 1, 2, 5, 10, 20, 50, 100, 200, 500, 2000 };
vector<int> ans;
int i=coin.size()-1;
while(n>0){
if(coin[i]>n... | ALGO | 0.999951 | 5.3563 |
32dea319-5fdf-4fc0-9eea-f76bf0ab4bd7 | proton-whyred/android_system_core | adb/client/transport_mdns.cpp | #define TRACE_TAG TRANSPORT
#include "transport.h"
#ifdef _WIN32
#include <winsock2.h>
#else
#include <arpa/inet.h>
#endif
#include <memory>
#include <thread>
#include <vector>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <dns_sd.h>
#include "adb_client.h"
#include "adb_mdns.h"... | TOOL | 0.976629 | 3.205763 |
c27e5b71-9d4c-42c3-aacb-c1f077d4412b | sugarchain-project/umami | src/hash.cpp | #include <hash.h>
#include <span.h>
#include <crypto/common.h>
#include <crypto/hmac_sha512.h>
#include <string>
inline uint32_t ROTL32(uint32_t x, int8_t r)
{
return (x << r) | (x >> (32 - r));
}
unsigned int MurmurHash3(unsigned int nHashSeed, Span<const unsigned char> vDataToHash)
{
// The following is Mu... | ALGO | 0.995755 | 7.483212 |
350ddb0b-58b4-459d-99aa-52bf28cf0b48 | abstractspoon/ToDoList_8.3 | Core/Shared/WebMisc.cpp | #include "stdafx.h"
#include "webmisc.h"
#include "misc.h"
#include "filemisc.h"
#include "xmlcharmap.h"
#include "regkey.h"
#include <comdef.h>
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <wininet.h>
#include <shlwapi.h>
#pragma comment(lib, "wininet... | TOOL | 0.871932 | 4.874837 |
c8f729c9-f694-461d-853d-68ffa94812cb | alexgan123/dmoj | 7p/coci08c2p3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n; cin >> n;
vector<pair<int, int>> ing(n);
for (int i = 0; i < n; i++) {
cin >> ing[i].first;
cin >> ing[i].second;
}
int ans = INT_MAX;
for (int i = 1; i < (1<<n); i++) {
int sour = 1;... | ALGO | 0.999971 | 3.954939 |
12bf92a9-68cd-4892-bde8-b906d0c0b002 | BenQuickDeNN/LeetCodeSolutions | 不同的二叉搜索树II.cpp | #include <vector>
#include <cstdlib>
using namespace std;
// 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 *l... | ALGO | 0.99998 | 6.100751 |
371348e1-1551-4a78-bdd6-be834d25b446 | Rajkumar992199/C-Plus-Plus | codeforces/800/1358A_Park_Lighting.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int t, n, m, k;
cin >> t;
while (t--) {
cin >> n >> m;
k = ((n * m) / 2) + ((n * m) % 2);
cout << k << endl;
}
} | ALGO | 0.999912 | 5.052048 |
c312ab6f-d064-4fef-8ef3-109e35842a32 | s32044/PPRG | potegowanie.cpp | #include <iostream>
using namespace std;
int main()
{
int podstawa, wykladnik;
int wynik = 1;
cout << "Podaj podstawe: ";
cin >> podstawa;
cout << "Podaj wykladnik: ";
cin >> wykladnik;
for (int i = 0; i < wykladnik; i++)
{
wynik *= podstawa;
}
cout << "Wynik to: "... | ALGO | 0.999591 | 4.310575 |
fcee8578-44f9-4822-b236-5ad899d37e8f | sxs-collaboration/spectre | src/PointwiseFunctions/ScalarTensor/Xcts/ScalarMomentum.cpp | #include "PointwiseFunctions/ScalarTensor/Xcts/ScalarMomentum.hpp"
#include "DataStructures/DataBox/Tag.hpp"
#include "DataStructures/Tensor/EagerMath/DotProduct.hpp"
#include "Elliptic/Systems/ScalarGaussBonnet/Tags.hpp"
#include "Elliptic/Systems/Xcts/Tags.hpp"
#include "Evolution/Systems/CurvedScalarWave/Tags.hpp"
... | ALGO | 0.896453 | 6.587248 |
e6918f51-8596-482e-aa89-66ad75f39291 | peng-yq/the-way-to-find-a-job | leetcode/c++/LCR_193_er_cha_sou_suo_shu_de_zui_jin_gong_gong_zu_xian_lcof.cpp | // https://leetcode.cn/problems/er-cha-sou-suo-shu-de-zui-jin-gong-gong-zu-xian-lcof/description
#include <bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
TreeN... | ALGO | 0.999999 | 6.399607 |
cdf33e1f-97b5-420f-9c33-fc8a704c7355 | cherrie2000/Code | Vertical Traversal of Binary Tree - GFG/vertical-traversal-of-binary-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
... | ALGO | 0.999976 | 6.441032 |
f8078a0a-e955-409c-8739-e289153d0c44 | DaHye9/BaekJoon-Cpp-study | 2020scpc1.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int Answer, n, k;
int a[200010], b[200010];
int main(int argc, char** argv)
{
int T, test_case;
cin >> T;
for (test_case = 0; test_case < T; test_case++)
{
cin >> n >> k;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n... | ALGO | 0.999939 | 3.490445 |
7934f3a6-d826-4b68-a57c-1e237516910d | thejoebaldwin/ios-sandbox | Box2D/Box2D/libs/Box2D/Dynamics/b2World.cpp | #include <Box2D/Dynamics/b2World.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2Island.h>
#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>
#include <Box2D/Dynamics/Contacts/b2Contact.h>
#include <Box2D/Dynamics/Contacts/b2ContactSolver.h>
#include <Box2D/Collision... | ALGO | 0.968647 | 3.636371 |
2ef52fa5-2eb9-4bc9-9c4f-2b8379c2a4ef | RoundedGlint585/pic-flip-fluids | scenes/inf585/project/src/MACGrid.cpp | //
// Created by roundedglint585 on 3/6/21.
//
#include <cmath>
#include <vector>
#include <cstdio>
#include "MACGrid.h"
#include "vcl/vcl.hpp"
#include "boundaries.h"
using namespace std;
MACGrid::MACGrid(int xCellCount, int yCellCount, float cellSize) : xCellCount(xCellCount), yCellCount(yCellCount),
... | ALGO | 0.997489 | 6.502364 |
eb554f79-a383-421b-a528-d47e73c9d0f9 | muhammad-umar-218980/OOP-Labs | Class Codes/Exception Handling/exception1.cpp | #include <iostream>
using namespace std;
class Stack
{
private:
int st[5]; //stack: array of integers
int top; //number of top of stack
public:
Stack() //constructor
{
top = 0;
}
void push(int var) //put number on stack
{
st[++top] = var;
}
int pop() //take number off stack
{
return st[top--];
}... | ALGO | 0.975899 | 4.616821 |
ddacf070-cd80-43be-8b95-eacc65c41256 | lllevels/junjie186.github.io | code/2023-03-16/1.cpp | #include <iostream>
#include <vector>
using namespace std;
int search(vector<int> &nums, int target, int low, int high)
{
if (low < 0 || high >= nums.size())
{
return -1;
}
while (high >= low)
{
int mid = low + (high - low) / 2;
if (nums[mid] > target)
{
... | ALGO | 0.999972 | 5.545922 |
8bb8e8ab-9edf-48ed-8c5b-a47e268581e0 | Praveenraj49/Udacity | CarND-MPC-Quizzes/global_kinematic_model/src/Eigen-3.3/doc/examples/class_VectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived>
segmentFromRange(MatrixBase<Derived>& v, int start, int end)
{
return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
}
template<typename Derived>
const Eigen::Vec... | TOOL | 0.930086 | 4.383477 |
ac0c2ab0-cb5c-4009-baed-928071ee658a | ishandutta2007/codeforces | qwertypi/normal/1553/C.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int powmod(int a, int b, int p){
int res = 1;
while(b){
if(b % 2){
res = (res * a) % p;
}
b /= 2;
a = (a * a) % p;
}
return res;
}
bool A[10];
void sub(){
string s;
cin >> s;
int d;
fill(A, A + 10, 0);
int ans = 10;
for(int i ... | ALGO | 0.999871 | 3.850491 |
8a5d5138-0346-4a15-ba54-0799430ed027 | YttriumWillow/OI | Problems/P2815.cpp | // Problem: P2815 IPv6地址压缩
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P2815
// Memory Limit: 125 MB
// Time Limit: 1000 ms
// Created Time: 2023-02-22 20:36:05
#include <iostream>
#define longint long long
#define reg register
#define qwq puts("fzy qwq ~");
using namespace std;
int l, r, len, s = 8,... | ALGO | 0.934718 | 4.370484 |
93c95fa6-6922-4a63-b539-34df6df42ce2 | robotics-projects-sumukh/RBE-550-Motion-Planning-Project-2-Barking-Up-A-Random-Tree | code/RTP.cpp | #include "RTP.h"
// TODO: Implement RTP as described
#include <limits>
#include "ompl/base/goals/GoalSampleableRegion.h"
#include "ompl/tools/config/SelfConfig.h"
ompl::geometric::RTP::RTP(const base::SpaceInformationPtr &si, bool addIntermediateStates)
: base::Planner(si, addIntermediateStates ? "RTPintermediate... | ALGO | 0.999159 | 6.931661 |
8541e8fa-7571-421f-8d09-f7782e78d154 | caiji853/leetcode | gcd.cpp | //
// Created by niuyb on 2021/2/8.
//
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int longestPalindrome(string word1, string word2) {
string s = word1+word2;
if(s.size() <= 1)
... | ALGO | 0.998925 | 5.166921 |
3fc162d7-b560-41ea-89cd-4c5c3704c0ad | santu-dhali/DSA-Practice | 3379-score-of-a-string/score-of-a-string.cpp | class Solution {
public:
int scoreOfString(string s) {
int sum = 0;
for(int i=0; i<s.size()-1; i++){
sum += (int)abs(s[i]-s[i+1]);
}
return sum;
}
}; | ALGO | 0.999937 | 5.632826 |
77107b68-0fe2-4165-a5cc-212d737e4289 | abelkm99/competitive_programming | topics/recurrsion/stariCase.cpp | #include <bits/stdc++.h>
#include <numeric>
#define ll long long
#define pb push_back
using namespace std;
void stairPermute(int &val,vector<int> &dereja, int n, int index) {
ll total = accumulate(dereja.begin(), dereja.end(), 00L);
for (int i = 1; i <= 3; i++) {
dereja.push_back(i);
ll total = accumulate(... | ALGO | 0.999979 | 4.126826 |
d6874137-c05a-4c36-9e0d-92970dc207ec | sx-aurora-devold/llvm | tools/dsymutil/MachODebugMapParser.cpp | #include "BinaryHolder.h"
#include "DebugMap.h"
#include "MachOUtils.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Object/MachO.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
namespace {
using namespace llvm;
using namespace llvm::dsymutil;
using namespac... | TOOL | 0.894089 | 7.801798 |
d8d7913d-8a05-43b1-a251-ac5566c5ff51 | 18Rutuja/DSA-CPP- | recursion4.cpp | #include<bits/stdc++.h>
using namespace std;
//print 1 to n by using backtracking
void print(int cnt, int n){
// Base Condition.
if(cnt < 1)
return;
// Count Incremente
print(cnt-1,n);
cout<<cnt<<endl;
}
int main(){
int n;
int cnt ;
cin>>n;
print(n,n);
return 0;
} | ALGO | 0.999821 | 4.228737 |
9cd9453c-369d-4d2c-a312-5cbe337c5bbb | access-softek/llvm-project-dil | libc/src/math/generic/fromfp.cpp | #include "src/math/fromfp.h"
#include "src/__support/FPUtil/NearestIntegerOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(double, fromfp, (double x, int rnd, unsigned int width)) {
return fputil::fromfp</*IsSigned=*/true>(x,... | TOOL | 0.923503 | 5.975262 |
0738921a-d827-4013-85e2-992364f4e54d | alexandraback/datacollection | solutions_5630113748090880_1/C++/Uday1312/solution.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
int ar[25000],i,num,j,t,n,ts;
cin>>ts;
for(t=1;t<=ts;t++)
{
cin>>n;
memset(ar,0,sizeof(ar));
for(i=0;i<2*n-1;i++)
{
for(j=0;j<n;... | ALGO | 0.999564 | 3.48565 |
cb7e3b54-83c1-4e82-8d58-bd256f8795d3 | M45UDrana/DS-Algo-Problem-Solving | codeforces/1467A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ff first
#define ss second
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define d(a,b,c) cout<<a<<" "<<b<<" "<<c<<'\n'
#define IO ios_base::sync_with_stdio(0);cin.tie(0);
const int N = 1e5+7;
int main()
{
IO;
int t;... | ALGO | 0.99984 | 4.301883 |
bbd0d376-3b30-4e26-a59f-50ef6e170c27 | Sunstreamy/xcpc | kuangbin/ss1/Oil_Deposits.cpp | //
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<string> vs;
typedef bitset<20> b20;
const int M = 1e9 + 7;
#define N 200005
#define int long long
struct fwt
{
int n;
// 初始化一个可以容纳 n 个数据(外加一个额外索引)的树状数组
vi tre... | ALGO | 0.999687 | 4.264478 |
7f2adc02-c803-424c-90a8-72c0cb7b0bde | AlokSingh04/LeetCode | 0287-find-the-duplicate-number/0287-find-the-duplicate-number.cpp | class Solution {
public:
int findDuplicate(vector<int>& nums) {
int i=0;
while(i<nums.size()){
if(nums[i] != nums[nums[i]-1]){
swap(nums[i],nums[nums[i]-1]);
} else {
i++;
}
}
for(int i=0;i<nums.size();i++){
... | ALGO | 0.999989 | 5.892631 |
a2d1f0ad-17e3-4fae-b194-00a1f9904eed | Pankajcoder1/YouTube-docs | DSA/Kadane's Algorithm.cpp | /*
written by Pankaj Kumar.
country:-INDIA
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int solve(){
// kadane's algorithm
int n;
cin>>n;
vector<int> v(n);
for(int i=0;i<n;i++){
cin>>v[i];
}
int max_so_far=INT_MIN,max_ending_here=0;
for(int i=0;... | ALGO | 0.999916 | 4.886938 |
ce2ed6dd-0b66-4ab6-bf64-ac17324ec30c | jorgepsmatos/cft-otb | trackers/MUSTer/mexopencv/opencv_contrib/src/+cv/private/DisparityWLSFilter_.cpp | /**
* @file DisparityWLSFilter_.cpp
* @brief mex interface for cv::ximgproc::DisparityWLSFilter
* @ingroup ximgproc
* @author Amro
* @date 2016
*/
#include "mexopencv.hpp"
#include "opencv2/ximgproc.hpp"
#include <typeinfo>
using namespace std;
using namespace cv;
using namespace cv::ximgproc;
// Persistent obje... | TOOL | 0.976681 | 6.481123 |
b330dc06-e7bf-4ec8-b933-0505f6d77491 | iRoy7/algo-progs | ps_evaluate_statements.cpp | /*
input:
6
x + 384 = 887
x +30 =200
x+30=200
x+ 5 = 2
x + 10 =20
x + 12 = 3
========================
output:
503
170
170
-3
10
-9
*/
#include <stdio.h>
#define SZ_STR 128
char str[SZ_STR];
char a_str[10];
char b_str[10];
static void
clear_buf() {
int i;
for (i = 0; i < SZ_STR; i++)
str[i] = 0;
for (i = 0; ... | ALGO | 0.996786 | 3.561892 |
39fbb8ea-9e5f-4ad5-a4e1-89566a6cbe02 | ishandutta2007/codeforces | rajat1603/normal/799/E.cpp | #include "bits/stdc++.h"
using namespace std;
const int N = 2e5 + 5;
const int SN = 1 << 19;
const long long inf = 1e15 + 15;
int n , m , k;
int c[N];
int a;
bool likea[N];
int b;
bool likeb[N];
vector < pair < long long , int > > no;
vector < pair < long long , int > > aa;
vector < pair < long long , int > > bb;
vecto... | ALGO | 0.999939 | 3.392956 |
60fb1b6a-975f-40e0-9a61-785ce9cefc4a | xjtuAccel999/ConSci-v1.0 | src/layer/gemm.cpp | #include "gemm.h"
namespace ncnn {
Gemm::Gemm()
{
one_blob_only = false;
support_inplace = false;
}
int Gemm::load_param(const ParamDict& pd)
{
alpha = pd.get(0, 1.f);
beta = pd.get(1, 1.f);
transA = pd.get(2, 0);
transB = pd.get(3, 0);
return 0;
}
int Gemm::forward(const std::vector<Ma... | ALGO | 0.971887 | 6.630658 |
8b1dfe00-4c46-4c9e-ac3c-b002b1a24187 | Akamolyhen/github | 当前是一年中的第几天/当前是一年中的第几天/test.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
int year, month, day;
while (cin >> year >> month >> day)
{
int _day[13] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };//ƽ
int number = _day[month - 1] + day;
if ((year % 4 == 0) && (ye... | ALGO | 0.99996 | 3.511635 |
54cd8a4f-3ee7-4b82-a9af-b5eb43df7bb9 | hareeshghk/leetcode_solutions | diameter-of-binary-tree/diameter-of-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.999921 | 6.74951 |
cd2ea246-226d-4c92-9569-28d3f0628ba0 | JAYKUMARGUPTA73/CODES | oops_c++/polymorphism/function_overloading.cpp | #include <iostream>
using namespace std;
// Function to add two integers
int add(int a, int b) {
return a + b;
}
// Overloaded function to add two doubles
double add(double a, double b) {
return a + b;
}
// Overloaded function to add three integers
int add(int a, int b, int c) {
return a + b + c;
}
int ... | TOOL | 0.899855 | 6.375052 |
22edb047-5a62-42e8-9dfc-ed48d7334c24 | shivg7706/CodeForces | 831B.cpp | #include<iostream>
using namespace std;
int main()
{
int i,j;
char a[28],b[28],c[1002];
cin>>a>>b>>c;
for(i=0;c[i]!='\0';i++)
{
for(j=0;a[j]!='\0';j++)
{
if(c[i]==a[j]||(c[i]+32)==a[j])
{
if(c[i]>='A'&&c[i]<='Z')
c[i]=b[j]-32;
else
c[i]=b[j];
break;
}
}
}
cout<<c;
return 0;
}
| ALGO | 0.999864 | 3.383193 |
aab0f1a9-174f-4d12-a070-3c36b024311d | gustavoem/bcc | tamu/2semester/420/project/main.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include "ToffoliGate.h"
#include "Multiplier.h"
#include "GeneticAlgorithm.h"
#include "GAMultiplier.h"
#include "LocalBeam.h"
#include "LBMultiplier.h"
using namespace std;
void showUsage ();
int main (int argc, char * argv[])
{
if (argc < 2)
{
... | ALGO | 0.998818 | 5.369188 |
e699a177-5bac-464b-87c6-85541a427d3c | Rawan1616/hacker-rank- | test4.cpp | #include <iostream>
#include <vector>
#include <algorithm> // for max_element
using namespace std;
int main() {
cout << "Enter the number of elements in the array: ";
int n;
cin >> n;
vector<int> numArray(n);
vector<int> numFreq(100, 0); // initialize with 0
for (int i = 0; i < n; i++) ... | ALGO | 0.999888 | 5.443656 |
310191b0-e4f1-46dc-9d67-66b17005a824 | sids278/Leetcode-Codes | 0205-isomorphic-strings/0205-isomorphic-strings.cpp | class Solution {
public:
bool isIsomorphic(string s, string t) {
if(s.length() != t.length()) return false; // if lengths are not the same then they can't be Isomorphic.
unordered_map<char, char> mps; // mark chars from str1 to str2
unordered_map<char, char> mpt; // mark chars from ... | ALGO | 0.999983 | 6.386523 |
3cd7c15e-c9eb-4bff-a0f0-598a3cad3cbf | J-Rojas/Path-Planning-Demo | src/Eigen-3.3/unsupported/doc/examples/MatrixPower_optimal.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
Matrix4cd A = Matrix4cd::Random();
MatrixPower<Matrix4cd> Apow(A);
std::cout << "The matrix A is:\n" << A << "\n\n"
"A^3.1 is:\n" << Apow(3.1) << "\n\n"
"A^3.3 is:\n" << Apow(3.3) << "\n\n"
... | ALGO | 0.99659 | 3.396939 |
68f55626-43d2-447d-964a-49ef28319375 | ishandutta2007/codeforces | uryuuu/normal/1175/A.cpp | #include<iostream>
#include<stdio.h>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<string>
#include<stack>
#include<set>
#include<map>
#include<time.h>
#include<cstdlib>
typedef long long ll;
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#de... | ALGO | 0.999774 | 3.511561 |
b158208d-c149-489c-afa9-d1eac955482f | wocantudou/ncnn-20240410 | tools/pnnx/src/pass_ncnn/expand_expression.cpp | #include "pass_ncnn.h"
#include <math.h>
#include <string.h>
#include <set>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <stack>
namespace pnnx {
namespace ncnn {
static bool token_is_argument(const std::string& t)
{
if (t[0] != '@' || t.size() < 2)
return false;
for (size_... | TOOL | 0.893399 | 5.961017 |
34eeb829-a99c-4c52-95d2-92ee656c48f8 | KhoiBui16/Fullhouse_Code_Online | DSA/Contest/09_ThamLam/Bai_12/ThamKhao.cpp | #include <bits/stdc++.h>
using namespace std;
bool checkString(string s)
{
if (s.size() == 1) return true;
string res = "";
map<char, int> freq;
for (string::size_type i = 0; i < s.size(); i++) {
freq[s[i]]++;
}
vector<int> v;
for (auto it : freq)
v.push_back(it.second);
... | ALGO | 0.999982 | 4.612265 |
5ae0f870-374d-4961-a6b5-5d151700bc5a | raincross7/code-similarity | codes/train_code/problem253/problem253_200.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
int n,m,x,y;
cin>>n>>m>>x>>y;
int X[n];
for (int i = 0;i<n;i++){
cin>>X[i];
}
int Y[m];
for (int i = 0;i<m;i++){
cin>>Y[i];
}
sort(X,X+n);
sort(Y,Y+m);
int z = min(Y[0],y);
i... | ALGO | 0.999995 | 3.279725 |
b0b8eac1-647a-42b3-8ca7-dc4954991e5b | lakpareek/MSC-30-days-Challenge | 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.999993 | 6.304055 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.