uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4ab10158-ffeb-4308-b37c-80fda3b72eed | elommills/apkinspector | androguard/classification/libsimilarity/sources/lzma/CPP/7zip/UI/Common/SortUtils.cpp | // SortUtils.cpp
#include "StdAfx.h"
#include "SortUtils.h"
#include "Common/Wildcard.h"
static int CompareStrings(const int *p1, const int *p2, void *param)
{
const UStringVector &strings = *(const UStringVector *)param;
return CompareFileNames(strings[*p1], strings[*p2]);
}
void SortFileNames(const UStringVec... | TOOL | 0.928808 | 6.468472 |
4d928c6e-ff97-48b1-b844-227b26045f7b | FelipeSilva10/TOU | T4/Beecrowd_1180.cpp | /*https://judge.beecrowd.com/pt/problems/view/1180*/
#include <iostream>
int main() {
int N,posicao,aux=0,menorvalor; //Declaração de variáveis
std::cin>>N; //Tamanho do vetor de X
if(1<N<1000) { //Condição imposta pelo exercício
int X[N]; //Declaração de variável com N sendo o tamanho de um vetor... | ALGO | 0.999948 | 4.767927 |
6a4d053c-42e7-48ae-a7ba-c156a9dd6ee5 | raincross7/code-similarity | codes/train_code/problem212/problem212_187.cpp | #include <bits/stdc++.h>
using namespace std;
bool is_prime(int x){
if(x<=1) return false;
for(int i=2;i*i<=x;i++)
if(x%i==0) return false;
return true;
}
int main() {
int n;
cin>>n;
vector<int>a;
for(int i=2;i<=n;i++){
if(is_prime(i))a.push_back(i);
}
int kotae=0;
if(a.size()<=3){
cout<<0... | ALGO | 0.999961 | 3.930153 |
5e6aed87-7c39-4cdf-83e0-2a1fdb99f79f | sainadth/codeforces | contest/H2025/C.cpp | #pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#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;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_stat... | ALGO | 0.999323 | 4.007964 |
2a59ee0f-bb3a-43cb-afa2-a6ba06b06ad0 | alessandro-bugatti/appunti_terza | archivio/2020_2021/programmazione/funzioni/es_21/main.cpp | #include <iostream>
using namespace std;
//Soluzione richiesta dal libro
void arrotonda(float &n)
{
//Primo algoritmo
int n1 = n + 0.5;
n = n1;
}
//Soluzione alternativa
float arrotonda2(float n)
{
//Secondo algoritmo
int n1 = n; //se n = 2.3 -> n1 = 2
if (n - n1 < 0.5)
return n1;
... | ALGO | 0.99882 | 4.0881 |
28cb82c1-a9e6-4cfe-a36e-21c3728c4970 | iamnagasatya/LeetCode | 700. Search in a Binary Search 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.233832 |
4c3e3eda-3fe8-4cfd-a4d6-7743eefcb6fb | momomorgentau/code | atcoder/abc/abc150/c_count_order.cpp | //422
//abc150_c_count_order
#include<bits/stdc++.h>
#define rep(i,n) for(int i =0;i<n;++i)
#define reps(i,s,n) for(int i =s;i<n;++i)
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main()
{
int n;
cin >> n;
int p = 0;
int q = 0;
int d = pow(10, n - 1);
int td = d;
rep(i, n)
{
int ci... | ALGO | 0.99983 | 3.418659 |
7cedab1c-5069-4702-ab3c-e2e819e979be | Mindjolt2406/Competitive-Programming | Codeforces/705/C.cpp | #include<bits/stdc++.h>
// g++ -std=c++17 -Wl,-stack_size -Wl,0x10000000 main.cpp
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define all(v) v.begin(),v.e... | ALGO | 0.99992 | 4.507192 |
82c4169f-a428-4789-95d2-c9aa663779ec | AntennaeVY/CP | CodeForces/1400/Ball in Berland.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
int a,b,k;
cin >> a >> b >> k;
vector<pair<int, int>> p(k);
map<int, int> p_b, p_g;
for(int i=0; i < k; i++) {
cin >> p[i].first;
p_b[p[i].first]++;
}
for(int i=0; i < k; i++) {
cin >> p[i].seco... | ALGO | 0.999911 | 3.571938 |
4ad2e4c5-184a-4f4d-9645-3a57dd2ae516 | bk1472/bbi | misc/minicalc.cpp | /*-----------------------------------------*/
/* α minicalc.cpp */
/*-----------------------------------------*/
#include <iostream>
#include <cstdlib> // for exit()
#include <cctype> // for is...()
using namespace std;
enum TknKind { /* ū */
Print, Lparen, Rparen, Plu... | ALGO | 0.984647 | 3.75298 |
a82581d0-2bd0-4ef3-8f34-0cfa5b4a340e | ishandutta2007/codeforces | crackersamdjam/normal/1343/B.cpp | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define gc getchar()
#define pc(x) putchar(x)
template<typename T> void scan(T &x){x = 0;bool _=0;T c=gc;_=c==45;c=_?gc:c;while(c<48||c>57)c=gc;for(;c<48||c>57;c=gc);for(;c>47&&c<58;c=gc)x=(x<<3)+(x<<1)+(c&15);x=_?-x:x;}
template<typename T> void printn(T n... | ALGO | 0.999708 | 3.762053 |
9055c1e3-1929-483a-8094-4086f8f15871 | Hemanthx/Data-structures- | Binary Trees/Basic/Path_length.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int data;
node *left , *right;
};
struct node *newnode(int data){
struct node*temp = (struct node *)malloc(sizeof(struct node));
temp -> data = data;
temp -> left = NULL;
temp -> right = NULL;
return temp;
}
int pathlength(struct node *temp){
if(temp==NU... | ALGO | 0.999594 | 4.016654 |
4be09714-f65b-44f9-b646-3dc032b8d3c4 | yashparmar15/Cpp-Codes | Top_K_Frequent_Element.cpp | /*Given a non-empty array of integers, return the k most frequent elements.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]
Example 2:
Input: nums = [1], k = 1
Output: [1]
Note:
You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
Your algorithm's time complexity must be better than O(n ... | ALGO | 0.999988 | 5.910094 |
8e2000e4-bb8b-40ae-bdf4-48d69f64ebc7 | gozu52/AtCoder | ABC/277/d.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int,int>;
using PL = pair<ll,ll>;
const int INF = 1e9;
const ll INFL = 1e18;
const int dx[4] = {1,0,-1,0};
const int dy[4]... | ALGO | 0.999987 | 3.358534 |
be1e9ef4-fe26-4f88-ad12-ccba56c04a25 | raincross7/code-similarity | codes/train_code/problem386/problem386_315.cpp | /*
このコード、と~おれ!
Be accepted!
∧_∧
(。・ω・。)つ━☆・*。
⊂ ノ ・゜+.
しーJ °。+ *´¨)
.· ´¸.·*´¨) ¸.·*¨)
(¸.·´ (¸.·'* ☆
*/
#include <iostream>
#include <vector>
#include <array>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <climits>
#include <tuple>
#include <unordered... | ALGO | 0.999989 | 3.762979 |
1fbbbb8b-3829-40cb-b695-f14b18acfd31 | sheeluofficial/practice | OthersCode/LeetCode-Solutions-master/LeetCode-Solutions-master/C++/permutation-in-string.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
bool checkInclusion(string s1, string s2) {
vector<int> counts(256);
for (const auto& c : s1) {
++counts[c];
}
for (int i = 0, l = s1.length(); i < s2.length(); ++i) {
if (counts[s2[i]]-- > 0) {
... | ALGO | 0.999966 | 6.586968 |
d5cbddc8-23f5-4519-b230-20e765bcd285 | sonjoe123/Bracket-Checker | Checking.cpp | //
// Created by phant on 10/25/2022.
//
#include "Checking.h"
#include <iostream>
#include <algorithm>
#include <fstream>
#include <cstring>
#include <iomanip>
#include <vector>
#include "DSStack.h"
using namespace std;
bool Checking::processStack(DSStack<char> &stack, char character) {
if (character == '{' || ch... | ALGO | 0.927932 | 5.005628 |
c66eea2e-3475-4e52-a6f5-c373cb49f159 | wslee/popl21_artifacts | euphony/thirdparty/z3/src/test/arith_simplifier_plugin.cpp | #include "smt/arith_eq_solver.h"
#include "smt/params/smt_params.h"
typedef rational numeral;
typedef vector<numeral> row;
static void test_solve_integer_equations(
arith_eq_solver& asimp,
vector<row>& rows
)
{
row r_unsat;
if (asimp.solve_integer_equations(rows, r_unsat)) {
std::cout ... | ALGO | 0.969385 | 5.908551 |
31fd8076-a581-4d33-9abe-103add776e66 | Shirocpm/neetcode-solves | Two Pointer/trapping_rain_water.cpp | class Solution {
public:
int trap(vector<int>& height) {
int n = height.size();
int ans = 0;
int lmx = height[0], rmx = height[n-1];
int l = 1, r = n - 2;
while (l <= r) {
if (height[l] >= lmx) {
lmx = height[l]; l++;
continue ;
... | ALGO | 0.99999 | 6.721133 |
aa0f5bef-fe3f-4925-bfb0-b73db5924deb | isachd/Hacker-Rank-Solutions | computing-analytics.cpp | //computing-analytics.cpp
//Computing Analytics
//Addepar Hackathon
//Author: derekhh
#include<iostream>
#include<unordered_set>
using namespace std;
unordered_set<int> l[100001], r[100001];
unordered_set<int> leftMinusOne[100001];
int main()
{
int n, c, q;
cin >> n >> c >> q;
for (int i = 0; i < c; i++)
{
int... | ALGO | 0.999969 | 4.131072 |
9a4969e2-3c30-4a32-9f55-7bc3883ac74c | gtoo8888/Cplusplustest | 1-Algorithm_test/leetcode/1-数据结构/5-栈和队列/栈/1021-删除最外层的括号.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
void printVector(vector<int> v){
for(auto it : v)
cout << it << " ";
}
class Solution {
public:
string removeOuterParentheses(string s) {
int len = s.size();
stack<char> st;
string ans;
for(int i = 0;i < len;i++){
if(s[i]... | ALGO | 0.999492 | 5.798966 |
661c0244-25d4-446a-a7b9-b78afde29979 | ccasas777/CarND-Highway-Path-Planning-P7 | src/Eigen-3.3/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.996131 | 4.015535 |
f6fbca98-9ba5-4a62-85ad-076b98ac6717 | pmathur007/cp | cpp_USACO/Gold2020USOpen/exercise.cpp | #include "bits/stdc++.h"
using namespace std;
const int MAXN = 10005, MAXP = 1234;
int N, M, P = 0;
bool isPrime[MAXN];
int p[MAXP];
long dp[MAXP][MAXN];
int main() {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
freopen("exercise.in", "r", stdin);
freopen("exercise.out", "w", stdout);
cin >> ... | ALGO | 0.999991 | 4.638057 |
1d308a88-5ecd-452e-8c34-2075b303e42b | harshit93/Algo-codes | muffins3.cpp | #include<iostream>
using namespace std;
main()
{
int t;
cin>>t;
while(t--)
{
long long int n;
cin>>n;
long long int a=int(n/2) + 1;
cout<<a<<endl;
}
return 0;
} | ALGO | 0.999156 | 3.794548 |
4a3fcd6a-b857-4b28-8cf5-16c2d9dcc1e2 | toufu-24/AtCoder | ABC/ABC330/C2.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define all(v) v.begin(), v.end()
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort(v.rbegin(), v.rend())
#define REVERSE(v) reverse(v.begin(), v.end())
#define ll int64_t
#define ld long double
#define int ll
... | ALGO | 0.999913 | 4.507329 |
ad424ff4-3b67-4c59-a71e-fc727563e89d | Joey574/Cpp-Advanced-Projects | Snake_Game/Snake_Game.cpp | #include <iostream>
#include <vector>
#include <random>
#include <chrono>
#include <thread>
#include <conio.h>
#include "Matrix.h"
struct pos {
int x;
int y;
};
enum class tile_type {
none, food, body, head
};
enum class direction {
up, down, left, right
};
void draw_board(std::vector<std::vector<tile_type>> gam... | TOOL | 0.989407 | 6.400344 |
07c436c1-0c02-4ce6-b746-f518a322cb07 | waitongsuen69/adsa | assignment2/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
class Node
{
public:
int height,con;
Node* l;
Node* r;
};
Node* make_node(int content){
Node* nn=new Node();
nn->l=NULL;
nn->r=NULL;
nn->con=content;
nn->height=1;
return nn;
}
int... | ALGO | 0.999642 | 5.355716 |
14cf6c02-73d6-4827-afdd-0185a10fd7ed | SlimAOSP/frameworks_av | media/libstagefright/codecs/mp3dec/src/pvmp3_stereo_proc.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_stereo_proc.cpp
Functions:
pvmp3_st_mid_side
pvmp3_st_intensity
pvmp3_stereo_proc
-------------------------------------------------------------------------... | ALGO | 0.997364 | 6.241484 |
2f6be4f9-3721-4776-aa60-10ee7a859b3a | eshf/NPSI | source/headers/boost/libs/geometry/doc/src/examples/algorithms/relation.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
//[relation
//` Shows how to calculate the spatial relation between a point and a polygon
#include <iostream>
#include <string>
#include <boost/geometry.hpp>
#include <bo... | ALGO | 0.983631 | 6.574086 |
876b4fb4-1771-4191-81b4-04180234ea70 | AmanTechWiz/Leetcode-Submissions | 0066-plus-one/0066-plus-one.cpp | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
for(int i = digits.size() - 1; i >= 0; i--) {
if (digits[i] + 1 != 10) {
digits[i] += 1;
return digits;
}
digits[i]=0;
if(i == 0){
digits.inser... | ALGO | 0.999785 | 6.624716 |
623f2d97-a22b-478e-b9a5-e0c9c0c5f882 | kanak22/CP-DSA-Questions | LeetCode/Build Array from Permutation/build array from permutation.cpp | //solution
class Solution {
public:
vector<int> buildArray(vector<int>& nums) {
vector <int> arr; // initializing a vector array of name arr
for(int i=0; i<nums.size(); i++){ //using the for loop to iterate through the array
arr.push_back(nums[nums[i]]); // adding the required element... | ALGO | 0.999944 | 5.98704 |
cbd9e7c1-07a4-4122-b856-3ac59d800ac8 | Keyu-He/Enhancing-Debugging-Skills-of-LLMs-with-Prompt-Engineering | solutions_correct/algorithms/T/Tweet Counts Per Frequency/Tweet Counts Per Frequency.cpp | #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
//less_equal to use it as a multiset
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
class TweetCounts {
public:
unordered_map<string,... | ALGO | 0.999051 | 5.965715 |
4a645a9e-ee97-4778-9241-1d812fd2ff89 | richefeu/rockable | src/ForceLaws/ForceLaw_Avalanche.cpp | #include "factory.hpp"
#include "Core/Rockable.hpp"
#include "ForceLaw_Avalanche.hpp"
Avalanche::Avalanche() {}
void Avalanche::init() {
box->idKnContact = box->dataTable.add("knContact");
box->idEn2Contact = box->dataTable.add("en2Contact");
box->idKtContact = box->dataTable.add("ktContact");
box->idMuConta... | ALGO | 0.99721 | 5.588148 |
96bb8e71-a75e-4af6-8680-403db4476e8a | hunter-street/opencv-static | opencv-4.0.1/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp | /**
* @function goodFeaturesToTrack_Demo.cpp
* @brief Demo code for detecting corners using Shi-Tomasi method
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
/// Global variables
M... | ALGO | 0.994463 | 7.203835 |
0b5ff405-7246-4e75-bff9-4e357f993757 | wjddlsy/Algorithm | Baekjoon/baek_1100_하얀칸/main.cpp | #include <iostream>
using namespace std;
int main() {
const int n = 8;
int ret = 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
char b;
cin >> b;
if (i % 2 == 0 and j % 2 == 0 and b == 'F') {
ret++;
} else if (i % 2 =... | ALGO | 0.999069 | 4.015297 |
9d431274-d079-4843-bef8-6e0e535e5e29 | DenizIsikli/Codeforces | Problemsets/Rating800/Tram116A.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
// Macros and optimizations
#pragma GCC optimize ("O3")
#define FAST_IO std::ios::sync_with_stdio(0); std::cin.... | ALGO | 0.999935 | 4.905406 |
9924a174-22f7-49cb-8fb2-b895eb1f3c7b | EdwardKYC/code-space | dandanjudge/a589.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
bool cmp(pair<char,int> &x,pair<char,int> &y){
return x.first==y.first ? x.second < y.second : x.first < y.first;
}
int main (){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,s;
bool m;
cin>>n>>m>>s;
while(n--){
string str;
cin>>str;
ve... | ALGO | 0.999779 | 3.231099 |
99e638f0-cb37-4e6a-afbd-2d22fc072fff | dallen-28/VuforiaHololensTracking | App/Il2CppOutputProject/IL2CPP/libil2cpp/icalls/mscorlib/System/Decimal.cpp | #include "il2cpp-config.h"
#include "il2cpp-object-internals.h"
#include "il2cpp-class-internals.h"
#include "icalls/mscorlib/System/Decimal.h"
#include "utils/StringUtils.h"
#include "vm/Exception.h"
#include <cmath>
#include <algorithm>
typedef enum
{
IL2CPP_DECIMAL_OK,
IL2CPP_DECIMAL_OVERFLOW,
IL2CPP_DE... | ALGO | 0.871488 | 6.776881 |
a3298d50-f320-453f-af14-107c6e115189 | lionelcutrocs/AUS-Diseno-Orientado-a-Objetos | Propios/gestor_libros.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
class Book {
public:
void addBook ( const string& title, const string& author )
{
books.push_back ({ title, author });
}
void deleteBook ( const string& title, const string& author )
{... | TOOL | 0.875612 | 4.560085 |
6bd9c9a5-7142-4fce-969a-332319118a0c | simon-ameye/42-piscine_cpp | day08/ex01/Span.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.cpp :+: :+: :+: ... | TOOL | 0.852511 | 4.925905 |
61be8506-0f99-4042-93a3-c478535989b7 | abdulalimswe/Competitive-Programming | Contest/Individual Contest - 2 ( DIU Advanced Camp - Spring 23)/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define FastIO() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int32_t main()
{
FastIO();
int t; cin>>t;
while (t--)
{
string str; cin>>str;
int cnt = 1;
int result = 0;
for (in... | ALGO | 0.998849 | 5.346975 |
7c7b17a3-b5a1-469c-b4ca-a99488c93c1f | sarvex/leetcode-algol | solution/0600-0699/0696.Count Binary Substrings/Solution.cpp | class Solution {
public:
int countBinarySubstrings(string s) {
int i = 0, n = s.size();
vector<int> t;
while (i < n) {
int cnt = 1;
while (i + 1 < n && s[i + 1] == s[i]) {
++cnt;
++i;
}
t.push_back(cnt);
... | ALGO | 0.999989 | 6.536963 |
675f1767-c22d-46ef-b923-26717912310c | zhangyong5566/CryptoppEX | app/src/main/jni/cryptopp/dh2.cpp | // dh2.cpp - originally written and placed in the public domain by Wei Dai
#include "pch.h"
#include "cryptlib.h"
#include "misc.h"
#include "dh2.h"
NAMESPACE_BEGIN(CryptoPP)
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
struct NullCryptoParameters : public CryptoParameters
{
void AssignFrom(... | ALGO | 0.950161 | 6.759193 |
2517fca7-6439-467d-8861-74b10bcd9dea | Andy-Lv/Cpp-Learning | 数据结构学习/03-顺序表的动态实现.cpp | /*
* 程序名:seqlist3.c,此程序演示顺序表的动态实现,数据元素是整数。
* 作者:C语言技术网(www.freecplus.net) 日期:20201230
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INITSIZE 10 // 顺序表的初始长度。
#define EXTSIZE 5 // 每次扩展元素的个数。
typedef int ElemType; // 自定义顺序表的数据元素为整数。
typedef struct
{
ElemType *data; ... | ALGO | 0.982107 | 3.710968 |
4582591b-fd1c-4a88-98fa-0f12af5bba93 | capacitybuilding/Fundamentals-of-Programming-Source-Code | Code/call_by -value.cpp | #include <iostream>
using namespace std;
// function declaration
void change(int num1, int num2);
int main (){
int a = 100, b = 200, ret;
cout <<a<< " " << b << endl;
change(a, b);
cout <<a<< " " << b << endl;
return 0;
}
// function returning the max between two numbers
void max(int num1, int num2){
num1 += num2++;
co... | ALGO | 0.99324 | 3.973047 |
0ab9094b-563a-47d8-8176-b2b2c5629871 | mayanjain/LeetCode-Solutions | 1202-smallest-string-with-swaps/1202-smallest-string-with-swaps.cpp | class Solution {
public:
vector<int> parent;
int find(int i){
if(parent[i]==i)return i;
return parent[i]=find(parent[i]);
}
string smallestStringWithSwaps(string s, vector<vector<int>>& pairs) {
int n=s.size();
parent.resize(n);
for(int i=0 ; i<n ; i++)parent... | ALGO | 0.999999 | 5.981458 |
ee1cbffc-49a9-42b8-8e12-64a598e28337 | shu8Cream/atcoder-archive | atcoder.jp/abc175/abc175_c/Main.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (ll i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(){
ll x,k,d;
cin >> x >> k >> d;
x=abs(x);
if(x/d>=k){
cout << x-k*d << endl;
return 0;
}
if((k-(x/d))%2 == 0) cout << x%d << endl;
else cout << abs(d-x... | ALGO | 0.999909 | 3.636604 |
2e4381b8-929c-4f96-bbdb-d1a0be939705 | weiweiweidong/My_Competitive_Programming_Codes | 10_Practice/02_AtCoder/10_Permanent_Contests/01_AtCoder_For_Beginner/CH3/3.1/Ex_12.cpp | // https://atcoder.jp/contests/typical90/tasks/typical90_ag
#include <iostream>
using namespace std;
int H, W;
// 这道题有一种日语理解的感觉:
// 题目中只说了“满足下列条件为不合适情况”:
// 2*2 格子中,点灯LED在2个以上
// 潜台词是,如果没有 2*2 的方格,怎么点灯都无所谓。
int main() {
cin >> H >> W;
if (H == 1 || W == 1)
cout << H * W << endl;
else
cout... | ALGO | 0.99978 | 4.80938 |
340816e3-4afa-4f14-8053-d30f9ad30210 | evialbert/LeetCode | 3174-clear-digits/3174-clear-digits.cpp | class Solution {
public:
string clearDigits(string s) {
int n = s.length();
int j = -1;
for (int i = 0; i < n; i++) {
int id = s[i] - '0';
if (id >= 0 && id < 10) { // Check if s[i] is a digit
while (j >= 0) {
if (s[j] != '-') { /... | ALGO | 0.99967 | 5.687591 |
c13dca79-c6ca-48ac-9abf-44cc765de2ea | enderorman/Freaky-Algorithms | graph/djisktra.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> dijkstra(int n, int src, vector<vector<pair<int, int>>>& adj) {
vector<int> dist(n, INT_MAX);
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<>> pq;
dist[src] = 0;
pq.emplace(0, src);
while (!pq.empty()) {
auto [d, u... | ALGO | 0.99994 | 5.6019 |
31c6735d-9c77-4d37-959f-60c385503d6f | ishandutta2007/codeforces | wsyhb/normal/1663/D.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string S;
int X;
cin>>S>>X;
bool ans;
if(S=="ABC")
ans=X<=1999;
else if(S=="ARC")
ans=X<=2799;
else
{
assert(S=="AGC");
ans=X>=1200;
}
puts(ans?"YES":"NO");
return 0;
} | ALGO | 0.999623 | 3.271897 |
2e8d835d-9499-49e2-92b9-e456a70c568f | KumaTelila/competitive-programming | cpp/206. Reverse 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) {}
* };
*/
class Solution {
public:
ListNode* reverseList... | ALGO | 0.99982 | 5.698912 |
dd1304c7-3fe1-4712-a078-720026764f62 | heavenMOJANG/ICPC | .history/Codeforces/CF1945/C_20240319164110.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int inf=0x7fffffff;
void solve(){
int n;cin>>n;
string s;cin>>s;
vector<int>a(n+2,0),pre(n+2,0);
for(int i=0;i<n;++i){
if(s[i]=='1... | ALGO | 0.999985 | 4.448951 |
f6139fa6-629e-4005-9d1b-5855d9531777 | Suryash-Jha/Codeforces | Olesya_and_Rodion.cpp | //Question Link: https://codeforces.com/problemset/problem/584/A
//did a lot of wrong submissions on this one :(
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(i, n) for(int i=0;i<n;i++)
#define deba(i, a, n) fo(i, n){cout << a[i] << " ";}
#define pb push_back
#define mod 1e9 +7
#defin... | ALGO | 0.999288 | 3.589603 |
f712db3f-11f8-4dff-a6ec-b921185bf4b3 | ishandutta2007/codeforces | physics0523/normal/1682/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while(t>0){
t--;
int n;
cin >> n;
vector<int> a(n);
int v=(1<<30)-1;
for(int i=0;i<n;i++){
cin >> a[i];
if(a[i]!=i){v&=a[i];}
}
cout << v << '\... | ALGO | 0.999185 | 4.881313 |
ed676bbe-b7c8-4c37-ada9-c8fcc46cf0de | expertsleepersltd/distingNT_API | airwindows/src/Slew3.cpp | #include <math.h>
#include <new>
#include <distingnt/api.h>
#define AIRWINDOWS_NAME "Slew3"
#define AIRWINDOWS_DESCRIPTION "A new approach to slew clipping meant for a more analog-like darkening effect."
#define AIRWINDOWS_GUID NT_MULTICHAR( 'A','S','l','g' )
#define AIRWINDOWS_KERNELS
enum {
kParam_One =0,
//Add yo... | TOOL | 0.978039 | 5.305088 |
fdf2727e-e681-427d-a55d-a52da4bb22ee | ishandutta2007/codeforces | akulyat/normal/1477/A.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O3", "unroll-all-loops")
#pragma GCC target ("sse4.2")
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
ifstream in;
ofstream out;
const long long kk... | ALGO | 0.999928 | 4.121648 |
a44c5408-4248-4d4b-bc13-4344c07632ea | Metrolina-Regional-Model-Team/MRM22v2.0 | pgm/ModeChoice/Transims60/Transims60/TourData/Normalize.cpp | //*********************************************************
// Normalize.cpp - Normalize Origin Zones
//*********************************************************
#include "TourData.hpp"
//---------------------------------------------------------
// Normalize_Origins
//-------------------------------------------------... | DATA | 0.978215 | 6.131855 |
35f6e729-3d48-457a-b118-056fd68affc7 | sabbirahmedfahim/ProblemSolving | Codeforces/B_Appending_Mex.cpp | #include <bits/stdc++.h>
#define nl '\n'
#define ll long long int
#define all(c) c.begin(),c.end()
#define print(c) for(auto e : c) cout << e << " "; cout << nl
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
int n; cin >> n;
vector<int> a(n); for(auto &e : a) cin >> e;
... | ALGO | 0.999925 | 4.079113 |
e6b6d9fa-60bf-4704-91b7-14fb4a12fdf4 | ishandutta2007/codeforces | killerx/normal/1556/C.cpp | #include <bits/stdc++.h>
#define eprintf(args...) fprintf(stderr, args)
#define rep(i, n) for (int i = 0; i < (int)(n); ++ i)
int main() {
int n;
scanf("%d", &n);
std::vector <int> c(n);
rep(i, n) scanf("%d", &c[i]);
long long ans = 0;
for (int s = 0; s < n; s += 2) {
long long A = 0, B = 0;
for (int t = s ... | ALGO | 0.999924 | 3.629908 |
0b001b43-93a7-4ae6-9034-4833061161f4 | timvdm/openbabel-razinger | src/math/spacegroup.cpp | #include <openbabel/babelconfig.h>
#include <openbabel/math/spacegroup.h>
#include <openbabel/data.h>
#include <openbabel/obutil.h>
#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <locale>
#include <cstdarg>
#include <cstdlib>
using namespace std;
namespace OpenBabel
{
/** Function to... | TOOL | 0.86546 | 5.473461 |
1cb4282c-28d8-4289-b264-d0af632f6216 | Anoop6338/cpp | c++/compare_value.cpp | // Write a code that input a number n and tell whether it is equal to, less than or more than 10\
#include <iostream>
using namespace std;
int main()
{
int num;
cout<<"Input your number ";
cin>>num;
if (num<10){
cout<<"Less than 10";
}
else if (num==10){
cout<<"Equal to 10";
... | ALGO | 0.998315 | 3.156609 |
79ed91aa-f1a7-436b-be3f-f54d06b69ab8 | KillCobra/tictactwo | 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 |
2dd9249f-d209-4f0d-a88a-cae121c9d5e3 | dihuibao/PKUACM | BST/main.cpp | #include <iostream>
using namespace std;
int main()
{
int t,n,tt,a,b;
cin >> t;
while(t--){
cin >> n;
tt = n & -n;
a = n-tt+1;
b = n+tt-1;
cout << a << " " << b << endl;
}
return 0;
} | ALGO | 0.999339 | 3.990344 |
df9098cf-ad1c-4d34-badc-63a6bf472467 | thilio/Competitive-Programming | Codeforces-Rounds/Div2/#643/c.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define ms(x,i) memset(x,i,sizeof(x))
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begin(),x.en... | ALGO | 0.998408 | 3.564586 |
69746c6e-d4a6-4e4c-a564-149ebdac2b1a | Faizatgit/Problem_Sheet | 4 sum/optimal.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<vector<int>> fourSum(vector<int> &nums, int target)
{
int n = nums.size();
vector<vector<int>> ans;
sort(nums.begin(), nums.end());
for (int i = 0; i < n; i++)
{
if (i > 0 && nums[i] == nums[i - 1])
... | ALGO | 0.999942 | 5.085515 |
1cb7f1c2-1fdf-4ad8-ad03-07350a3e558a | pluto2001/C_Coding | number ASC.cpp | #include "stdio.h"
#include "conio.h"
void mintomax();
void maxtomin();
int continueLoop();
char inputContinue;
int number[5];
bool run = false;
int main(){
int tmp;
while(true){
if(run == true){
printf("Enter Y to continue : ");
inputContinue = getche();
if(inputContinue == 'y'){
}else if(input... | ALGO | 0.998952 | 3.099369 |
dd823256-bdfc-4ff0-83d1-e7ed8fec4e4c | SachinRamesh024/1st_Semester_CPP_Lab-work | lab3&4/task19.cpp | #include <iostream>
using namespace std;
int main()
{
int cppMarks, dsMarks, osMarks;
double totalMarks, percentage;
cout << "Enter marks obtained in C++: ";
cin >> cppMarks;
cout << "Enter marks obtained in Data Structures: ";
cin >> dsMarks;
cout << "Enter marks obtained in Operating S... | TOOL | 0.973463 | 3.269015 |
843b789d-259e-4363-aa46-e7814990e9ab | vishalkushw/ArrayQuestion | Uniq number finde in array.cpp | #include<iostream>
using namespace std;
int main(){
int arr[]={5,11,5,11,2,9};
int n=sizeof(arr)/sizeof(arr[0]);
for(int i=0;i<n;i++){
int j;
for(j=0;j<i;j++){
if(arr[i]==arr[j])
break;
}
if(i==j)
cout<<arr[i]<<" ";
}
}
| ALGO | 0.999946 | 3.236194 |
7f58a69c-3694-443a-8a5e-76a9c4d0aadc | mank-423/LeetCode | arrayinter.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
vector<vector<string>> groupAnagrams(vector<string>& strs) {
map<string, vector<string>> mp;
vector<vector<string>> result;
if (strs.size() == 0){
result.push_back({" "});
}
for (string i: strs){
string temp = i;
... | ALGO | 0.999972 | 5.386872 |
a8a3e0b1-3b22-4766-84ba-796535a2f712 | 113bommy/LogicalErrorFixCodeT5 | logicalErrorFix_CodeT5_Linenumber/model/cpp/CodeT5_LineNumber_cpp_gold/Problem_84_gold_442.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010, MAXM = 1000010;
int t, n, k, mu[MAXM], phi[MAXM];
long long sumphi[MAXM], dp[MAXM][30];
void solve(int l, int r, int xl, int xr, int k) {
if (l > r) {
return;
}
int mid = (l + r) >> 1, np = 0;
long long nw = 0, nv = 1e18;
for (int l = min(xr, mid - ... | ALGO | 0.999851 | 4.035906 |
287e8ca8-dd93-474e-9499-1705aa860deb | Usama-Qasit/Flutter-Covid-19-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.998784 | 6.761023 |
d5635177-fcf2-4d3e-ac64-4c8ec5565932 | himanshumahajan138/Leetcode | 2164-two-best-non-overlapping-events/two-best-non-overlapping-events.cpp | class Solution {
public:
int maxTwoEvents(vector<vector<int>>& events) {
int n = events.size();
sort(events.begin(), events.end(), [](const vector<int>& a, const vector<int>& b) {
return a[0] < b[0];
});
vector<int> suffixMax(n);
suffixMax[n - 1]... | ALGO | 0.999408 | 6.286124 |
11057fae-78b8-47af-a11f-a6610d4886cd | plusminus34/scalable_DOGs_master_thesis | C/Dog/Objectives/LinearConstraints.cpp | #include "LinearConstraints.h"
using namespace std;
LinearConstraints::LinearConstraints(): A(nullptr), z(nullptr) {
const_n = 0;
IJV.resize(0);
ready = false;
}
LinearConstraints::LinearConstraints(const Eigen::SparseMatrix<double> &A_i,
const Eigen::VectorXd &z_i): A(&A_i), z(&z_i) {
if(A == nullptr) {ready... | ALGO | 0.927267 | 5.590557 |
f528671f-900a-49c5-bd3f-5f36cf458bcd | michaelyshih/CS102 | ch6/6.2.e.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> swimmingListings;
int numDistance;
int inputVal;
int i;
cin >> numDistance;
for (i = 0; i < numDistance; ++i) {
cin >> inputVal;
swimmingListings.push_back(inputVal);
}
/* Your code goes here */
... | ALGO | 0.999801 | 3.696991 |
669f14cc-ee05-43a0-aa63-f839ee277c1b | Sharmishtha1907/DSA-450 | Given an array of size n and a number k, find all elements that appear more than n by k times.cpp | class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
unordered_map <int,int> m;
vector <int> v;
for(int i=0;i<nums.size();i++)
{
m[nums[i]]++;
}
for(auto i:m)
{
if(i.second >(nums.size()/3))
{
... | ALGO | 0.999984 | 5.663279 |
59f7f4ce-28f1-429d-967e-4f4dee9b9349 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/stamping-the-sequence-Solution.movesToStamp/177853_DoS_Overflow.cpp | setPath(JsonbIterator **it, Datum *path_elems,
bool *path_nulls, int path_len,
JsonbParseState **st, int level, Jsonb *newval, bool create)
{
JsonbValue v;
JsonbValue *res = NULL;
int r;
if (path_nulls[level])
elog(ERROR, "path element at the position %d is NULL", level + 1);
switch ... | ALGO | 0.996996 | 3.530962 |
add50f05-8906-4c2e-9096-7f27b699e4eb | JJungs-lee/problem-solving | LeetCode/21. Merge Two Sorted Lists.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* mergeTwoLists(... | ALGO | 0.999902 | 6.366301 |
e5b6fef5-85f4-475f-9c8e-b0dcecda6f6f | 18-VK/Coding__ninjas-DSA-CPP | Tree/Generic tree/problems/Second_largest.cpp | #include<iostream>
#include"Print_and_take_input.cpp"
using namespace std;
class Pair
{
public:
int maximum;
int second_max;
Pair()
{
maximum=INT16_MIN;
second_max=INT16_MIN;
}
};
Pair helper(treeNode *root)
{
if(root==NULL)
{
Pair temp;
return temp;
}
Pair ... | ALGO | 0.999757 | 4.699839 |
4446f214-c4a7-457d-ae4b-aeab31b7d729 | rsphoenix02/Data-Structures-and-algorithms | 06. Searching/Binary Search/count1s.cpp | #include <iostream>
using namespace std;
int countOne(int arr[], int n)
{
int s = 0;
int e = n - 1;
int ans = -1;
while (s <= e)
{
int mid = s + (e - s) / 2;
if (arr[mid] == 0)
{
s = mid + 1;
}
else
{
if (mid == 0 or arr[mid -... | ALGO | 0.999818 | 5.210258 |
62d1a006-8dcf-4fbd-b55f-f24175e03efd | alexandrecarloss/C | ED/apostc/E0505.CPP | /* *******************************************************************
Programa: e0505.cpp
Proposito: Uso da estrutura if...else
Ultima Revisao: 26/08/97
******************************************************************* */
#include <stdio.h>
void main(){
float a,b,c; // parametros d... | ALGO | 0.993908 | 3.829356 |
43ef5e58-352e-4383-a052-9c25b7f9c2b6 | MachangDoniel/Ostad-Coding-Interview-Preparation | Module 18/contest code/K-th Prefix Max.cpp | // K-th Prefix Max
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, K;
cin >> N >> K;
vector<int> P(N);
for (int i = 0; i < N; i++) cin >> P[i];
priority_queue<int, vector<int>, greater<int>> minHeap; // min heap
for (i... | ALGO | 0.999989 | 4.837371 |
2ce5b2ef-ab4b-419f-8f84-1022954ba8fe | benMcChesney/KinectHacks | FireIce/ofxBox2d/src/lib/Box2D/Source/Collision/b2BroadPhase.cpp | #include "b2BroadPhase.h"
#include <algorithm>
#include <cstring>
// Notes:
// - we use bound arrays instead of linked lists for cache coherence.
// - we use quantized integral values for fast compares.
// - we use short indices rather than pointers to save memory.
// - we use a stabbing count for fast overlap querie... | ALGO | 0.997256 | 5.941575 |
f20dda97-b7e8-4aa4-8d02-31b1a4ef5d54 | OneBitPython/Codeforces | Round811/A_Everyone_Loves_to_Sleep.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(c) c.begin(), c.end()
#define endl "\n"
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(unsigned x)... | ALGO | 0.999907 | 4.172805 |
19f4931a-2174-4d57-80fc-572bd47e2fed | DoanNguyenTrong/mpc_controller_ros | docs/example/CppAD_started.cpp | /*
$begin get_started.cpp$$
$spell
cppad.hpp
http://www.coin-or.org/CppAD/
getstarted
namespace
iostream
const
std
powx
Jacobian
jac
endl
da
cout
$$
$section Getting Started Using CppAD to Compute Derivatives$$
$mindex simple example start$$
$head Purpose$$
Demonstrate the use of CppAD by computing the d... | ALGO | 0.99851 | 6.731783 |
85e73ee9-d33a-4d0c-8da2-99b165966d82 | AryanJJChympa/DSA-Instructor-RohitNegi- | Recursion/checkPalindrome.cpp | #include<iostream>
using namespace std;
bool checkPal(string str, int start, int end){
if(start>=end){
return 1;
}
if(str[start]!= str[end]){
return 0;
}
return checkPal(str, start+1, end-1);
}
int main(){
string str="naman";
cout<<checkPal(str,0,4);
return 0;
} | ALGO | 0.999808 | 4.967976 |
a7fb7200-79d0-4800-b058-96ff20415e42 | dsfhdshdjtsb/cppcp | 1971B.cpp | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--) {
string input;
cin >> input;
string output(input.length(), '*');
char beg = input.at(0);
... | ALGO | 0.999992 | 4.323725 |
b0063cca-6afd-43f7-be5f-a2cb6fecd8f7 | Archisman-A/DS-LAB | day10_timepass.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* left;
struct Node* right;
};
void insert(struct Node** root, int x)
{
if(*root==NULL)
{
struct Node *newnode= (struct Node*)malloc(sizeof(struct Node));
newnode->data=x;
newnode->left= newnode->right = NULL;
*root... | ALGO | 0.999977 | 4.580613 |
88fc6b6a-eee7-49e8-a3e5-5acd6eea7cc9 | geoffgeorgein/CP | 1/A_211A.cpp | #include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define F first
#define S second
#define ll ... | ALGO | 0.999624 | 3.154353 |
ca52cd6f-0581-40bc-9e2a-4586e9da348f | WilliamSmolla/SpaceGuts | SpaceGuts/dependencies/Box2D/src/collision/b2_collide_circle.cpp | #include "box2d/b2_collision.h"
#include "box2d/b2_circle_shape.h"
#include "box2d/b2_polygon_shape.h"
void b2CollideCircles(
b2Manifold* manifold,
const b2CircleShape* circleA, const b2Transform& xfA,
const b2CircleShape* circleB, const b2Transform& xfB)
{
manifold->pointCount = 0;
b2Vec2 pA = b2Mul(xfA, circle... | ALGO | 0.998754 | 7.741599 |
90921486-e6fb-4aa0-80d3-db00caca7e76 | shubhamagrawal6/Data-Structures | 1.LinkedList/1.Singly/4.DeleteNode.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node* next;
Node(int data){
this->data = data;
this->next = NULL;
}
};
void printlist(Node* head){
if(!head){
cout<<"Empty List :) "<<endl;
}
while(head){
cout<<head->data<<endl;
h... | ALGO | 0.999344 | 4.045927 |
e7eb5f2d-47da-4049-bb7f-1750d3ae898f | king-yyf/cpcode | google/amazonoa/non_decre_arr__Good.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int n;
cin>>n;
vector<int>arr(n);
for(int i=0;i<n;i++)cin>>arr[i];
vector<int>presum(n);
presum[0]=arr[0];
for(int i=1;i<n;i++)presum[i]=presum[i-1... | ALGO | 0.999893 | 3.880654 |
34ee28ea-6789-4325-89f1-faa6499d3e88 | grigorisg9gr/detection_for_rgbd | sparsecoding_rgbd/hsc_cvpr13/Eigen-3.1.1/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.982031 | 4.389442 |
d0eac909-f838-4da5-9c8a-8e81275c49ec | munafmd9849/GeeksForGeeks | Difficulty: Basic/First 1 in a Sorted Binary Array/first-1-in-a-sorted-binary-array.cpp | class Solution {
public:
int firstIndex(vector<int> &arr) {
// Your code goes here
int s=0,e=arr.size()-1,ans=-1,k=1;
while (s<=e){
int mid=s+(e-s)/2;
if(arr[mid]==k){
ans=mid;
e=mid-1;
}
else if(k<arr[mid]){
... | ALGO | 0.999954 | 5.375962 |
3f68d304-f9e7-4924-9d6e-9ab41ffa0b1e | renhaolong2009/note | 数据结构与算法/03-Sorting-Advance/02-Merge-Sort/main.cpp | #include <iostream>
#include "SortTestHelper.h"
#include "InsertionSort.h"
using namespace std;
template <typename T>
void __merge(T arr[], int l, int mid, int r)
{
T aux[r - l + 1];
for (int i = l; i <= r; i++)
{
aux[i - l] = arr[i];
}
int i = l, j = mid + 1;
for (int k = l; k <= r; k... | ALGO | 0.99906 | 5.444615 |
c4c575aa-28d5-4341-b8dc-8ebbe1ace28e | StevenMallqui/Algorithmic-Methods | GreedyAlgorithm/MaratonDeCineDeTerror/main.cpp |
/*@ <answer>
*
* Nombre y Apellidos: Steven Mallqui Aguilar
*
*@ </answer> */
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
/*@ <answer>
Escribe aquí un comentario general sobre la solución, explicando cómo
se resuelve el problema y cuá... | ALGO | 0.999576 | 5.320951 |
c5fb0187-769a-42af-9969-25a0e91b0286 | Madhur-A/Competitive-DSA | Leetcode/Misc/C2416.cpp |
#include <bits/stdc++.h>
using std::vector;
using std::string;
struct trie {
public:
int count = 1;
trie* next[26];
};
struct tried {
public:
trie* root;
public:
tried(): root(new trie()) {
for(int i = 0; i < 26; ++i) {
root->next[i] = nullptr;
}
}
void inse... | ALGO | 0.99998 | 5.700648 |
190efe56-8fa5-47f4-87c9-d176cdd10663 | Koichi5/benesse_hack_4 | 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 |
1a58c6cf-5e1a-48dc-9d70-e2d80f87ac18 | ishandutta2007/codeforces | kmjp/normal/521/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(... | ALGO | 0.999953 | 4.252689 |
b4d47a16-ae9f-46fb-9b64-1e6c7f22d517 | ANKAN257/DSA-problems | recurrsion/chap3_sum_n_recur.cpp | #include<bits/stdc++.h>
using namespace std;
void sum_fun(int n,int sum){
if(n<1){
cout<<"\nsum : "<<sum <<endl;
return;
}
cout<<n<<" ";
sum_fun(n-1,sum+n);//
}
int sum_fun_fun(int n){
if(n==0){
return 0;
}
return n+sum_fun_fun(n-1);
}
int main(){
int n... | ALGO | 0.99962 | 4.004148 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.