uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a0207fe9-4a88-4a13-bdad-dc7388ed17c2 | matihope/Chess | Engine/Math/Math.cpp | #include <Math/Math.hpp>
#include <cmath>
#include <iostream>
namespace Math {
int sign(float val) {
return (0 < val) - (val < 0);
}
sf::Vector2f normalizeVector(const sf::Vector2f vector) {
if (vector.x == 0 || vector.y == 0)
return vector;
float length = sqrt(vector.x * vector.x + vector.y * vector.y);
... | ALGO | 0.992098 | 5.810116 |
be7bef54-0f3b-4ad8-9306-8f79bbd3647b | xshuo/MyLeetCode | Smallx_LeetCode/leetcode/18_4Sum.cpp | #ifdef __18__
#include <algorithm>
#include <vector>
#include <iostream>
using std::vector;
class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
vector<vector<int>> ret;
std::sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size(); i++) {
... | ALGO | 0.999947 | 5.678407 |
83c2d66c-0b2b-42f8-8e10-0b33c59e2703 | ambujtripathi988/Coding | HackerRank_Mathematics/Sherlock_and_Moving_Tiles.cpp |
// https://www.hackerrank.com/challenges/sherlock-and-moving-tiles/problem?h_r=profile
#include <bits/stdc++.h>
using namespace std ;
int main()
{
long int l , s1 , s2 , no_of_queries ;
cin >> l >> s1 >> s2 >> no_of_queries ;
double area , time ;
for (int i = 0; i < no_of_queries ; i++)
{
... | ALGO | 0.993153 | 3.551557 |
5e1bbffd-36c0-44ba-be4e-b683daf08396 | H4M2/GameCW | Game/Library/PackageCache/com.unity.ide.visualstudio@2.0.16/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.950958 | 6.937841 |
7442d0c0-0bd0-499d-a13f-146ce4f4792c | anmolkohli13/DSA-practice | gfg solutions/max_difference_of_0's_and_1's_in_a_string.cpp | class Solution{
public:
int maxSubstring(string S)
{
// Your code goes here
int n = S.length();
int arr[n];
for(int x = 0; x < n; x++)
{
if(S[x] == '1')
arr[x] = -1;
else
arr[x] = 1;
}
int i,csum=arr[0],osum=arr[0];
f... | ALGO | 0.999975 | 4.87085 |
36b2cb95-4da0-4bb3-8be9-acaeaea15fd4 | enochjung/acmicpc_net | 10/10867.cpp | #include <cstdio>
#include <set>
using namespace std;
int n;
set<int> s;
int main()
{
scanf("%d", &n);
for(int i=0; i<n; i++)
{
int v;
scanf("%d", &v);
s.insert(v);
}
for(auto it=s.begin(); it!=s.end(); ++it)
printf("%d ", *it);
return 0;
}
| ALGO | 0.999458 | 3.404541 |
3b518b49-7642-4dd7-b1b3-44029020ac09 | xncm/xncm-llvm | utils/PerfectShuffle/PerfectShuffle.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <cassert>
#include <cstdlib>
struct Operator;
// Masks are 4-nibble hex numbers. Values 0-7 in any nibble means that it takes
// an element from that value of the input vectors. A value of 8 means the
// entry is undefined.
// Mask manipulation funct... | ALGO | 0.983549 | 4.461622 |
7be95b51-dc4c-4d49-a4ac-008d44f64835 | PengJiaqiao/LeetCode_Diary | src/0687_Longest_Univalue_Path/Longest_Univalue_Path.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int longestUnivaluePath(TreeNode* root) {
res = 0;
helper(root);
return... | ALGO | 0.999728 | 6.458501 |
9569ee80-18dc-458c-864c-b3964147bd1f | alifalhasan/CP-code-vault | Codeforces/Codeforces Round/Codeforces Round 512 (Div. 2/B - Vasya and Cornfield/66827484.cpp | #include<bits/stdc++.h>
using namespace std;
#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define ... | ALGO | 0.999929 | 3.796301 |
b4544cb2-9353-4a07-b510-6ac69c556b97 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12649_7.cpp | #include <bits/stdc++.h>
using namespace std;
int a[200005], n, x, m;
int main() {
scanf("%d", &n);
x = n / 2;
m = 1000000000;
for (int i = 0; i < n; i++) scanf("%d", &a[i]);
sort(a, a + n);
for (int i = x; i < n; i++) m = min(m, a[i] - a[i - x]);
printf("%d", m);
}
| ALGO | 0.999812 | 3.972073 |
fe51c571-bf62-4249-bda8-3c158007505c | lzyrapx/Competitive-Programming | HDUOJ/1862.cpp | #include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<iomanip>
#include<algorithm>
#include<time.h>
typedef long long LL;
using namespace std;
struct stud
{
int num;
char name[10];
int score;
} stu[100001];
int cmp1(stud a,stud b)... | ALGO | 0.997169 | 3.209513 |
12451ec3-bc89-421e-9b42-193b66554061 | zms1228/WangDao-DataStructure | LinerList/singleLinkList.cpp | #include <stdio.h>
#include <stdlib.h>
typedef struct LNode{
//数据域
int data;
//指针域
struct LNode *next;
}*LinkList;
//这里 LNode * L <==> LinkList L
//初始化(不带头结点)
bool InitList(LinkList &L){
L = NULL;
return true;
}
//初始化(带头结点)
bool InitListWithHeadNode(LinkList &L){
//在内存中申请头结点空间
L ... | ALGO | 0.999801 | 3.010633 |
5a15ad99-a85d-40a1-92e1-a2c924280157 | Chintujukuri/DSA_in_c- | 1problems/javascript.cpp | #include <bits/stdc++.h>
using namespace std;
int fibo(int n)
{
if (n <= 1)
return n;
return fibo(n - 1) + fibo(n - 2);
}
int main()
{
int n = 5;
for (int i = 0; i <= n; i++)
cout << fibo(i) << " ";
return 0;
} | ALGO | 0.999655 | 4.61788 |
02f28e65-342d-4656-b8bc-485c32e7c86f | LucasGamaV/2024-2-Gestao-Labs-DCOMP | frontend/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.998303 | 6.76775 |
9b48871c-8c9f-487d-9c55-e588ab38e6c5 | ishandutta2007/codeforces | nikolapesic2802/normal/1041/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
scanf("%i",&n);
int minn=1000000007,maxx=0;
for(int i=0;i<n;i++)
{
int a;
scanf("%i",&a);
minn=min(minn,a);
maxx=max(maxx,a);
}
printf("%i\n",maxx-minn-n+1);
return 0;
} | ALGO | 0.999257 | 3.633706 |
99e17c24-2d23-4150-986f-c40c378d0513 | piyushk77/leetcode_100_days_of_code | prob-856-score-of-parentheses.cpp | #include <vector>
#include <string>
using namespace std;
class Solution
{
public:
int scoreOfParentheses(string s)
{
vector<string> stack;
for (int i{}; i < s.size(); ++i)
{
if (s[i] == '(')
{
string ch{"("};
stack.push_back(ch);
... | ALGO | 0.999577 | 5.667971 |
6adda07a-8003-471a-aa82-2512400762ba | RichardoMrMu/yolov5-head-deepsort-detector | deepsort/src/hungarianoper.cpp | #include "hungarianoper.h"
Eigen::Matrix<float, -1, 2, Eigen::RowMajor> HungarianOper::Solve(const DYNAMICM &cost_matrix) {
int rows = cost_matrix.rows();
int cols = cost_matrix.cols();
Matrix<double> matrix(rows, cols);
for (int row = 0; row < rows; row++) {
for (int col = 0; col < cols; col++... | ALGO | 0.999728 | 4.366716 |
57e16a2b-5213-4ada-83d3-8e04029c4152 | quantosaurosProject/quantLib | ql/experimental/variancegamma/fftvanillaengine.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/experimental/variancegamma/fftvanillaengine.hpp>
#include <ql/exercise.hpp>
#include <ql/termstructures/volatility/equityfx/blackconstantvol.hpp>
#include <complex>
namespace QuantLib {
FFTVanillaEngine::FFTVanillaEngine... | ALGO | 0.950355 | 7.143511 |
7b6d9621-8955-4ce3-9a22-7259fcd698c0 | biorobaw/EagleEyeVision-S2019 | Pi UDP Networking/PiBot (Python)/opencv-4.0.1/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp | /**
* @function generalContours_demo2.cpp
* @brief Demo code to obtain ellipses and rotated rectangles that contain detected contours
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;... | ALGO | 0.995251 | 7.730851 |
b420c1ce-d239-4264-b277-14ab8d6bbd14 | mzib18/CompetitiveCoding | ABSame.cpp | #include<bits/stdc++.h>
using namespace std;
using lli = long long int;
#define IOS ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0);
const int N = 100010;
int inf = 1e9;
int mod = 1e9 + 7;
signed main(){
IOS
int t;cin>>t;
while(t--){
int n;cin>>n;
vector<int> arr1(n);
vector<int> ... | ALGO | 0.999978 | 4.538476 |
3aaa5c5b-715f-4dd5-bff7-dca0c9d90f23 | yanhai307/cpp_study | 06-boost/dm04_字符串算法string_algo2.cpp | //
// Created by YANHAI on 2019/9/13.
//
/*
string_algo:
- 修剪
- 查找和替换
*/
#include <iostream>
#include <boost/algorithm/string.hpp>
using namespace std;
using namespace boost;
/*
修剪
string_algo提供3个修剪算法
- trim 去掉左右两边的空格
- trim_right 去掉右边的空格
- trim_left 去掉左边的空格
... | TOOL | 0.952186 | 4.420212 |
fb7312d7-43a4-4b28-bae3-9b336a84f123 | Yash-Singh1/competitive-programming | cses/1195/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll n, m;
cin >> n >> m;
vector<vector<pll>> g(n), tg(n);
vector<pair<pll,ll>> adj(m);
ll x, y, z;
for (ll i{0}; i < m; ++i) {
cin >> x >>... | ALGO | 0.999413 | 4.670906 |
2a14da77-e438-452b-b0a5-608fe7530583 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/WatchingCpl_20210101181132.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999986 | 3.923874 |
d5c06b59-ee83-4f17-85ca-bafb0661b135 | Sinccbb/Cpp-CompetitiveProgrammingTLXToki | 3A (Kupon Berhadiah).cpp | // sc : https://tlx.toki.id/courses/competitive/chapters/03/problems/A
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
int main() {
int N, sampel;
cin >> N >> sampel;
vector<pair<int, int>> bil;
for (int i = 0; i < N; i++) {
i... | ALGO | 0.999668 | 3.097566 |
06b9ebc4-6698-4f03-9bd3-c204f52b6a00 | ymtz13/CompetitiveProgramming | AtCoder/ABC098/D.cpp | #include<iostream>
#include<vector>
using namespace std;
#define ll long long
int main(){
ll N; cin >> N;
vector<ll> A(N);
for(ll i=0; i<N; ++i) cin >> A[i];
ll r=0, sl=0, sl_xor=0, sr=A[0], sr_xor=A[0];
ll ans = 0;
for(ll l=0; l<N; ++l){
for(; r<N && (sr-sl==(sr_xor^sl_xor)); ++r) { sr+=A[r+1]; sr_xo... | ALGO | 0.999971 | 4.09068 |
1b3be777-83b3-4918-bef0-3d8b0aa73ffb | ChiragGitHub231/Competitive-Programming | 0330-patching-array/0330-patching-array.cpp | class Solution {
public:
int minPatches(vector<int>& nums, int n) {
long long sum=0, patches=0, index=0;
while(sum<n){
if(index<nums.size() && nums[index]<=sum+1) sum+=nums[index++];
else {
patches++;
sum+=sum+1;
}
}
... | ALGO | 0.999851 | 6.677314 |
6660fbcf-3d9a-4701-b702-16f1d3a923b3 | raincross7/code-similarity | codes/train_code/problem488/problem488_387.cpp | #include <bits/stdc++.h>
#include <math.h>
#define ALL(a) a.begin(), a.end()
#define rep(i, K, N) for(long long int i = K; i < N; i++)
#define ll long long int
using namespace std;
int main(){
ll N, K, total = 0, Ans = 0;cin >> N >> K;
vector<ll> f;
vector<ll> b;
rep(i, 0, N + 1){
total += i;total%=10000000... | ALGO | 0.999816 | 3.854978 |
6b82d265-3e17-4571-9c18-5b11d2d6fdbb | GNAQ/Algorithm-Contest-Archive | Template/快速幂.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#define ll long long
using namespace std;
ll a,b,c,d;
template<typename int_t>
void readx(int_t& x)
{
x=0; int_t k=1; char ch=0;
while (ch<'0' || ch>'9') { ch=getchar(); if (ch=='-') k=-1; }
while (ch>='0' &... | ALGO | 0.999887 | 3.877816 |
4db323d3-b06b-4cee-a27d-6b92e7065cf0 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/August/smallestKmp_20200809132659.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.99997 | 4.114421 |
b9f7d78f-4e4a-45f5-aeef-349e7635d4be | Naman1302/DSA | Graph/Backtracking/01. Rat in A maze(#BFS).cpp | bool solve(vector<vector<int>> &m,vector<vector<bool>> &vis,int n,int x,int y,vector<string> &ans,string s){
if(x<0 || y<0 || x>=n || y>=n || vis[x][y] || !m[x][y] ){
return false;
}
if(x==n-1 and y==n-1){
ans.push_back(s);
vis[x][y]=false;
re... | ALGO | 0.999989 | 6.186366 |
b04b9d9c-1c55-4c94-882d-18ad494a41af | 0xedb/algo-ds | c++/leetcode/124. Binary Tree Maximum Path Sum.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.999944 | 6.418307 |
6496839d-720b-4a35-b176-7b6aa9716ce7 | zouliangqi/WareHouse | 数据库课程设计/数据库_1/仓储管理系统-(实训生案例-肖XX)/仓储管理系统-(实训生案例-肖XX)/people.cpp | /*### people.cpp #*/
/*################*/
/*本文件函数是个人类的基本函数*/
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "myclass.h"
using namespace std;
/*带参构造函数*/
People::People(int num,const char *name,int age,const char *sex,const char *phone,const char *department,const char *password)... | TOOL | 0.905227 | 3.982452 |
ce754337-ca9a-4339-9b49-8fdbc1773467 | ParthGoyal1508/interviewbit-solutions | trees/BST.cpp | #include <bits/stdc++.h>
using namespace std;
typedef struct Node {
int val;
struct Node *left;
struct Node *right;
} Node;
Node *insert(Node *root, int val) {
if (root == NULL) {
Node *temp = new Node;
temp->val = val;
temp->left = temp->right = NULL;
return temp;
... | ALGO | 0.999992 | 4.079504 |
c25441c3-cff4-452e-b769-a8275ce99346 | tanvirmahmud66/problem_Solving | Preparation/CP/Problem Solve/Harker Rank/Time_conversion.cpp | #include<bits/stdc++.h>
using namespace std;
//---------For Loop--------------
#define f(n) for(LL i=0; i<n; ++i)
#define ff(from,to) for(LL i=from; i<to; ++i)
#define fff(var,from,to) for(LL var=from; var<to; ++var)
//--------Variable---------------
typedef string s;
typedef long long LL;
typedef double D;
typ... | ALGO | 0.977866 | 3.893961 |
f9930624-05be-45bd-90ac-92475ed392e1 | codeSpicer/LeetCode-solutions | 1491-average-salary-excluding-the-minimum-and-maximum-salary/1491-average-salary-excluding-the-minimum-and-maximum-salary.cpp | class Solution {
public:
double average(vector<int>& salary) {
int mini= salary[0];
int maxi = salary[0];
double sum = 0;
for( const auto& ele : salary){
mini = min( ele , mini);
maxi = max( ele , maxi);
sum ... | ALGO | 0.999493 | 6.01525 |
adbf3358-bf29-460c-8eb5-bebbde6d9a1d | Himanshu4776/leetcode-submissions | 1119-robot-bounded-in-circle/2022-01-09 23.38.54 - Accepted - runtime 3ms - memory 6.3MB.cpp | class Solution {
public:
bool isRobotBounded(string instructions) {
vector<vector<int>> dir = {{0,1}, {-1, 0}, {0, -1}, {1,0}};
int point = 0;
int x = 0;
int y = 0;
for(int s = 0; s < instructions.size(); s++){
if(instructions[s] == 'L'){
p... | ALGO | 0.999927 | 6.096235 |
4802bffd-d8a3-4c21-b384-03dd2bdf793f | anurag-saraswat/DS-Practice | LeetCode/ValidateBinaryTreeNodes.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<unordered_set>
using namespace std;
bool validateBinaryTreeNodes(int n, vector<int>& leftChild, vector<int>& rightChild) {
unordered_set<int> set;
vector<int> v(n, 0);
for (int i = 0; i < n; i++) {
int l = leftChild[i];
int r ... | ALGO | 0.999959 | 5.446554 |
79408854-4749-4b91-b971-ae8e968c2c7d | 84z0r/Begode-Peripheral-Board | Main/tools.cpp | #include "tools.h"
uint8_t* Tools::FindPattern(const uint8_t* pStart, size_t searchSize, const uint8_t* pPattern, size_t patternSize, const uint8_t* mask)
{
size_t patternPos = 0;
uint8_t* pFind = nullptr;
for (size_t i = 0; i < searchSize; ++i)
{
if (!mask[patternPos] || (pStart[i] == pPatter... | ALGO | 0.988035 | 5.527958 |
0e2f46a1-52e9-458c-aef6-5d4fe8293690 | wudip/nbody-cuda | simple_cell.cpp | #include <cstdio>
#include <cmath>
#include "simple_cell.h"
#define SOFTENING_FACTOR_SQR 0.5
#define GRAVITATION_CONSTANT 6.67300E-11
#define IS_NOT_EMPTY(index) ((unsigned int) -1) != index
SimpleCell::SimpleCell() {}
SimpleCell::SimpleCell(unsigned int offset, unsigned int particle, const Particle ¢er, unsign... | ALGO | 0.998694 | 4.939136 |
bd3438dd-6427-4569-b94b-709d53b5edd6 | squarefk/spheretree-fixed | src/API/SRQuickBurst.cpp | #include "SRQuickBurst.h"
SRQuickBurst::SRQuickBurst(){
burstThreshold = 5;
}
void SRQuickBurst::getSpheres(Array<Sphere> *spheres, int n, const SurfaceRep &surRep, const Sphere *filterSphere, float parSphereErr) const{
CHECK_DEBUG(burstThreshold > 1, "Need to give value > 1 or the algorithm will end up being SRMe... | ALGO | 0.998565 | 4.314134 |
9c85322a-8e03-4bb7-b655-1a4818889954 | MOHIT-PANDEY215/Leetcode_sols | 278_first_bad_version.cpp | // The API isBadVersion is defined for you.
// bool isBadVersion(int version);
bool isBadVersion(int index){
if(index>5)
return true;
return false;
}
class Solution {
public:
int firstBadVersion(int n) {
long long int i=1,j=n,mid;
while(i<=j){
mid=(i+j)/2;
if(... | ALGO | 0.999721 | 6.393934 |
0be75921-ceed-4492-af63-84bad2e98101 | leadert/Leetcode | 494.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int findTargetSumWays(vector<int>& nums, int S) {
int len = nums.size();
int sum = 0;
for (int i = 0; i < len; i++) {
sum += nums[i];
}
if (sum < S) return 0;
if ((sum + S) % 2 == 1) return 0;
//иԪصĺΪtargetҵкΪtarget... | ALGO | 0.999969 | 4.747468 |
579b91b8-aff6-4781-afe4-e47696685546 | WayneWei228/Algorithm | USACO_Silver/2017JS2.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
using namespace std;
#define MAXN 100005
int N;
char A[MAXN];
struct count
{
int p;
int h;
int s;
} arr[MAXN];
int win(int x)
{
int a, b;
a = max((arr[x].p), max(arr[x].s, arr[x].h));
b = max((arr[N - 1].p - arr[x - 1].... | ALGO | 0.998012 | 3.222369 |
ccc0e56e-760e-4aa2-9b28-ad3244716468 | trailofbits/llvm-sanitizer-tutorial | llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp | #include "clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtCXX.h"
#include "clang/Analysis/AnalysisDeclContext.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/ProgramPoint.h"
#include "clang/B... | ALGO | 0.9986 | 7.813391 |
7ccc8adb-141d-402f-8a35-734a61dfc7fa | rijwanrk/striverA2ZdsaSheet | step6[Learn LinkedList]/Lec2 Learn Doubly LinkedList/4.Reverse a DLL/Reverse-a-Doubly-Linked-List.cpp | class Solution {
public:
// Function to reverse a doubly linked list
DLLNode* reverseDLL(DLLNode* head) {
// Your code here
if(head==NULL || head->next==NULL){
return head;
}
DLLNode* current = head;
DLLNode* last = NULL;
while(current!=NULL){
... | ALGO | 0.999581 | 5.600967 |
30b4292c-114e-494e-98b4-001a5c502652 | JsIqbal/problem-solving | beeCrowd/salaryIncrease.cpp | #include <bits/stdc++.h>
using namespace std;
int main () {
float salary, reAdjustmentRate, newSalary;
cin >> salary;
if (salary >= 0.00 && salary <= 400.00) {
reAdjustmentRate = 15.00 / 100;
newSalary = salary * reAdjustmentRate;
salary = salary + newSalary;
cout << "N... | ALGO | 0.998993 | 3.909674 |
b1776d46-e9e2-4f5d-a9e0-289fb45d94ad | Tsubasa10wtz/GMT | include/freestanding/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy_comp.pass.cpp | // <algorithm>
// template<InputIterator InIter, RandomAccessIterator RAIter, class Compare>
// requires ShuffleIterator<RAIter>
// && OutputIterator<RAIter, InIter::reference>
// && Predicate<Compare, InIter::value_type, RAIter::value_type>
// && StrictWeakOrder<Compare, RAIter::value_type>}... | TEST | 0.999081 | 6.196958 |
47837537-1970-4b0a-9cdd-742332b738c6 | ranjeet229/DSA_Series | Dsa/countTHeno.cpp | // #include<bits/stdc++.h>
// using namespace std;
// int Countdigit(int n){
// // int cnt=0;
// // while(n>0){
// // // int lastdigit=n%10;
// // cnt+=1;
// // n/=10;
// // }
// // return cnt;
// // another method to solve this question
// //weknow log10(n) approxmai... | ALGO | 0.999424 | 5.086387 |
1090645a-c73c-485a-bb29-6ac5441dc8cd | PixelExtended/frameworks_base | libs/androidfw/AssetsProvider.cpp | #include "androidfw/AssetsProvider.h"
#include <sys/stat.h>
#include <android-base/errors.h>
#include <android-base/stringprintf.h>
#include <android-base/utf8.h>
#include <ziparchive/zip_archive.h>
namespace android {
namespace {
constexpr const char* kEmptyDebugString = "<empty>";
} // namespace
std::unique_ptr<A... | TOOL | 0.911693 | 7.864291 |
0a47348c-81ad-4954-8b9d-e562e98c4212 | kerozou/kyopuro | Atcoder解答/ARC解答/ARC032 B - 道路工事.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second... | ALGO | 0.999865 | 4.114616 |
b1db485f-c51b-4ccd-a983-4bb71576c69c | vishantrathi/C-plus-plus.cpp | DSA/Basics of DS/LeetCode/tempCodeRunnerFile.cpp | #include<iostream>
using namespace std;
int firstOcc(int arr[],int n,int key){
int start =0;
int end=n-1;
int ans = -1;
int mid =start+(end-start)/2;
while(start<=end){
if (arr[mid]==key){
ans =mid;
end=mid-1;
}
else if(key>arr[mid]){ //right mai j... | ALGO | 0.999974 | 4.801712 |
df4ff901-9188-4a4a-a398-6dc0875ae1eb | Taehyun-Koh/Baekjoon | greedy/1339.cpp | #include <iostream>
#include <string>
#include <algorithm>
bool cmp(int &a, int &b){
return a>b;
}
using namespace std;
int graph[26];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n; cin >> n;
for (int i =0; i<n; i++){
string input; cin >> input;
int pow... | ALGO | 0.999879 | 4.238149 |
19311624-2251-442f-b2f9-bf9884926656 | Ilham9675/latihan_cp | pemberajaran/day1.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define lb lower_bound
#define pb push_back
#define ub upper_bound
#define fi first
#define se second
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n,m;
int jum = 0;
string nilai;
string huruf[10] ... | ALGO | 0.997043 | 3.905653 |
e688d887-8e84-47ed-97bf-4334c74b0f4b | stellaraccident/iree-forge | trees/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp | // UNSUPPORTED: c++03
// <algorithm>
// template<class T>
// pair<T, T>
// minmax(initializer_list<T> t);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
int main(int, char**)
{
assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3)));
assert((std::minmax({1, 3, 2}) == std::pair<i... | TEST | 0.965275 | 5.835735 |
f13000bf-01b6-4d83-b89d-4f7537e8c3f1 | louis-bompart/8IAR125-01 | lib/boost_1_61_0/libs/numeric/ublas/doc/samples/banded_matrix.cpp | #include <boost/numeric/ublas/banded.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
banded_matrix<double> m (3, 3, 1, 1);
for (signed i = 0; i < signed (m.size1 ()); ++ i)
for (signed j = (std::max) (i - 1, 0); j < (std::min) (i + 2, signed (m.size2 ... | ALGO | 0.945433 | 3.750736 |
1f89e192-a248-4dad-a295-79c239cc1f57 | Mukit09/UVA_Solution | 727.cpp | #include<stdio.h>
#include<string.h>
#include<stack>
using namespace std;
stack<char>stk;
int main()
{
char re[100],ch[15];
long t,j,flag=0;
scanf("%ld",&t);
getchar();
while(t--)
{
j=0;
while(gets(ch))
{
if(flag)
{
if(ch[0]=='\0')
break;
if(ch[0]=='+'||ch[0]=='-')
{
if(st... | ALGO | 0.999827 | 3.405766 |
9e524c37-a4ec-4d28-8e06-1aa1fcb34b65 | nursyah21/algoexercise | 1201210014_MuhammadDifaUlinnuhaAlfarhani/Projecteuler/10001st_Prime.cpp | #include <iostream>
using namespace std;
int main()
{
int prime, number = 2, count = 0;
while (count < 10001)
{
bool isPrime = true;
for (int i = 2; i < number; i++)
{
if (number % i == 0)
{
isPrime = false;
break;
... | ALGO | 0.999671 | 4.604152 |
a4269b39-59e3-40ca-b970-8ba78ff5439b | Visiator/Visiator_Windows | V26/cryptopp/pubkey.cpp | // pubkey.cpp - originally written and placed in the public domain by Wei Dai
#include "pch.h"
#include "config.h"
#ifndef CRYPTOPP_IMPORTS
#include "pubkey.h"
#include "integer.h"
#include "filters.h"
NAMESPACE_BEGIN(CryptoPP)
void P1363_MGF1KDF2_Common(HashTransformation &hash, byte *output, size_t outputLength,... | ALGO | 0.952024 | 7.378901 |
e327aa76-ba97-497c-a905-acc2079197fa | LorenzoBianconi/ath_spectral | UI/qwt/src/qwt_curve_fitter.cpp | #include "qwt_curve_fitter.h"
#include "qwt_math.h"
#include "qwt_spline.h"
#include <qstack.h>
#include <qvector.h>
#if QT_VERSION < 0x040601
#define qFabs(x) ::fabs(x)
#endif
//! Constructor
QwtCurveFitter::QwtCurveFitter()
{
}
//! Destructor
QwtCurveFitter::~QwtCurveFitter()
{
}
class QwtSplineCurveFitter::Priva... | ALGO | 0.997752 | 6.818741 |
2ce20241-09a5-46ab-bae3-d338f4c8d5ba | prithvi2226/Leetcode | Arrays - Hard/OVerlapArray.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
//sorted or not intervals ask interviewer
//if sorted,then they are consecutive
//and then we can compare it easily consecutively linearly
std::sort(intervals.begin(), intervals.end());
... | ALGO | 0.999991 | 6.045137 |
c8a1f150-7e21-4c6e-b3b3-4e8c4f8b0530 | reddcoin-project/reddcoin | src/signet.cpp | #include <signet.h>
#include <array>
#include <cstdint>
#include <vector>
#include <consensus/merkle.h>
#include <consensus/params.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <hash.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <span.h>
#include <script/interprete... | ALGO | 0.999153 | 7.084201 |
87380d3b-32bf-4486-8bb1-8aa91d5ef40f | X-oss-byte/Hhvm.com | third-party/mcrouter/src/mcrouter/lib/config/RendezvousHash.cpp | #include "RendezvousHash.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include <folly/hash/Hash.h>
namespace facebook {
namespace memcache {
/*
* The algorithm of RendezvousHash goes like this:
* Assuming we have 3 clusters with names and weights:
* ==============================================
*... | ALGO | 0.999701 | 6.391043 |
fe5abac9-640e-4f0c-866c-c8d04f1426ea | ishandutta2007/codeforces | fedoseev.timofey/normal/1205/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int K = 60;
vector <int> who[K];
const int Inf = 1e9;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.setf(ios::fixed); cout.precision(20);
#ifdef LOCAL
freopen("input.txt", "r", std... | ALGO | 0.999965 | 3.925859 |
b51a7c13-e308-4cbb-9ee3-10f83a64fa9c | XiaochenTschen/Blog | leetcode/String/224/test.cpp | #include<string>
#include<stack>
#include<iostream>
#include<stdlib.h>
class Solution
{
public:
int calculate(std::string s)
{
int isPositiv = 1;
int num = 0;
int ans = 0;
std::stack<int> op({1});
for(char c:s)
{
if(std::isdigit(c))
{
... | ALGO | 0.999894 | 4.390495 |
158bdf44-a869-4c75-98b6-76eaffb99b1f | chenliang2017/uvBaseLib | src/sort/BubbleSort.cpp | #include "BubbleSort.h"
CBubbleSort::CBubbleSort()
{
}
CBubbleSort::~CBubbleSort()
{
}
void CBubbleSort::Sort(int* array, int array_num)
{
for (int num = 0; num < array_num; num++) {
for (int idx = 0; idx < array_num - 1 - num; idx++) {
if (array[idx] > array[idx + 1]) {
int tmp = array[idx + 1];
arr... | ALGO | 0.999024 | 3.923421 |
6ded7445-188c-48c3-8008-ba17d3f40dba | zhangyangit/TestOnline | Sort/Heap Sort.cpp | #include <iostream>
using namespace std;
void print(int a[], int n);
void HeapAdjust(int h[], int s, int length);
void BuildingHeap(int h[], int length);
void HeapSort(int h[], int length);
int main()
{
int h[23] = {22, 1, 3, 23, 92, 18, 4, 218, 12, 84, 90, 22, 32, 3, 21, 31, 232, 132, 13, 214, 5,132,323};
HeapSo... | ALGO | 0.999457 | 4.093044 |
18de9f89-16a1-43af-b09d-1ce35d1b0bbf | slack2450/csgo-dma-overlay | dma/boost_1_69_0/libs/math/example/continued_fractions.cpp | #include <boost/math/tools/fraction.hpp>
#include <iostream>
#include <complex>
//[golden_ratio_1
template <class T>
struct golden_ratio_fraction
{
typedef T result_type;
result_type operator()()
{
return 1;
}
};
//]
//[cf_tan_fraction
template <class T>
struct tan_fraction
{
private:
T a, b;
pu... | ALGO | 0.92531 | 5.192014 |
53a4cefa-23f1-48b7-9c97-141b0416d2bb | GurhanIU/cpp_advanced | ders_07/trailing_return_type_02.cpp |
int main()
{
auto f = [](int x) -> double {
if (x > 10)
return x;
else
return x * 1.5;
}
}
| TOOL | 0.939752 | 4.645431 |
ecbab301-8fe8-4029-a593-5df5814266ed | bdhBDH/learngit | algorithm/leetcode_offer09_用两个栈实现队列.cpp | /*
剑指offer 09: 用两个栈实现队列
2021/8/2
*/class CQueue {
public:
stack<int>cache;
stack<int>ans;
CQueue() {
}
void appendTail(int value) {
cache.push(value);
}
int deleteHead() {
if(ans.empty())
{
if(cache.empty()) return -1;
while(cache.si... | ALGO | 0.999947 | 5.506793 |
1ca2d819-2c31-4540-b4d3-f3ef53fa5988 | miiiingi/ps | programmers/코딩테스트연습/정렬/가장큰수.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
string solution(vector<int> numbers) {
vector<string> strNumbers(numbers.size());
for(int i = 0; i< numbers.size(); i++){
strNumbers[i] = to_string(numbers[i]);
}
sort(strNumbers.begin(), str... | ALGO | 0.999836 | 6.114415 |
e99ab432-ee32-4d14-bdc0-9203d49c8766 | TyrantDA/finalProject | Octree/Octree.cpp | #include "../gl/glew.h"
#include <iostream>
#include <vector>
using namespace std;
#include "Octree.h"
#include "../3DStruct/threeDModel.h"
#include <math.h>
const int FACE_LIMIT = 1;
Octree::Octree()
{
minX = 0;
minY = 0;
minZ = 0;
maxX = 0;
maxY = 0;
maxZ = 0;
PrimitiveListSize=-1;
PrimitiveList = NULL;
... | ALGO | 0.959445 | 4.583777 |
38172afa-5bb7-41f7-83ca-d3e3fb480250 | mustafatok/ChessAI | Knight.cpp | //
// Knight.cpp
// Chess
//
// Created by mustafa tok on 12.12.2011.
//
#include <iostream>
#include "Component.h"
void Knight::draw(){
if(this->isBlack())
cout << "n";
else
cout << "N";
}
int Knight::canmove(Point &p1, Point &p2){
int dx = p2.getX() - p1.getX();
int dy = p2.... | ALGO | 0.933428 | 3.434899 |
f68084c9-4391-4842-9fb3-aa33852e89bd | Snigdha-Gayathri/C-Programs | LeetCode/LC-869.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string countDigits(int num) {
string cnt(10, '0'); // store counts as chars
while (num > 0) {
cnt[num % 10]++;
num /= 10;
}
return cnt;
}
bool reorderedPowerOf2(... | ALGO | 0.999503 | 6.41611 |
9aca6f2f-b65f-4699-be51-8c091a64fd80 | darcythomas/graphviz | cmd/mingle/minglemain.cpp | #include "config.h"
#include <cgraph/cgraph.h>
#include <cgraph/exit.h>
#include <ingraphs/ingraphs.h>
#include <common/pointset.h>
#include <getopt.h>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <vector>
#include <sparse/DotIO.h>
#include <mingle/edge_bundling.h>
#include <mingle/nearest_neigh... | ALGO | 0.98361 | 6.01462 |
bb81f8fa-ff8a-427a-9960-aaf3f99639b1 | abhishekchauhan15/leetcode | 867-transpose-matrix/867-transpose-matrix.cpp | class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& matrix) {
int n=matrix.size(); //no. of rows
int m=matrix[0].size(); //no. of columns
vector<vector<int>>tp(m, vector<int>(n,0));
for(int i=0; i<n; i++){
for(int j=0; j<m; j+... | ALGO | 0.99997 | 6.218626 |
1f3e44e5-fd90-4bc0-8eb7-c5685f29a7d2 | knightwayne/VLC-MPD | modules/demux/mkv/virtual_segment.cpp | #include <vector>
#include <new>
#include "demux.hpp"
namespace mkv {
/* FIXME move this, it's demux_sys_t::FindSegment */
matroska_segment_c * getSegmentbyUID( KaxSegmentUID * p_uid, std::vector<matroska_segment_c*> & segments )
{
for( size_t i = 0; i < segments.size(); i++ )
{
if( segments[i]->p_se... | TOOL | 0.954193 | 4.238083 |
33744a31-11e7-4bf7-971e-a7d740167e95 | Rahmat767/UTS_MOBILE2 | 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.998762 | 6.786404 |
7be417e9-9905-4d1f-b128-d8c7dad266ae | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8_formatted/4yn/8294486_5654117850546176_4yn.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX_N 1009
struct AugPath {
int A, B; // size of left, right groups
vector<vector<int>> G; // size A
vector<bool> visited; // size A
vector<int> P; // size B
AugPath(int _A, int _B) : A(_A), B(_B), G(_A), P(_B, -1) {}
void AddEd... | ALGO | 0.999964 | 4.723293 |
a8a1bb5c-c5ac-43a8-b1c2-89c148920532 | isac322/BOJ | 5618/5618.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int n, t, m = 987654321;
vector<int> vec;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &t);
vec.push_back(t);
}
m = min(m, t);
const int &len = vec.size();
for (int i = 1; i <= m; i++) {
bool check... | ALGO | 0.999984 | 4.039019 |
fe7525c2-59d1-48e3-9044-251d6b78bf2b | Vincent550102/Competitive-Programming-Warehouse | sprout/no391.cpp | #include<bits/stdc++.h>
using namespace std;
#define INF 0xffffffffffffffff
using ll = unsigned long long;
#define int ll
int dis[10005];
int n,m,s,e,f;
vector<pair<int,int> > G[100005];
void dijkstra(int p){
priority_queue<pair<int,int> ,vector<pair<int,int>>,greater<pair<int,int> > > pq;
fill(dis,dis+n+1,INF);
di... | ALGO | 0.999851 | 4.61039 |
0353dae4-b21e-4ab5-935d-1bfb501e4b08 | SylarAnh/docker-colrio | 3rd_party/gtsam-4.2a8/gtsam/3rdparty/GeographicLib/examples/example-SphericalEngine.cpp | // Example of using the GeographicLib::SphericalEngine class
#include <iostream>
#include <exception>
#include <vector>
#include <GeographicLib/SphericalEngine.hpp>
using namespace std;
using namespace GeographicLib;
int main() {
// See also example-SphericHarmonic.cpp
try {
int N = 3; // Th... | TOOL | 0.861335 | 6.358807 |
f019c4b2-8ed5-4697-95b4-f6e5790efc8e | anstjaos/Algorithm | BOJ/4920.cpp | #include <iostream>
using namespace std;
int dirX[13][3] = { {0,0,0}, {1,2,3}, {0,1,1}, {-1,-1,-2}, {0,0,1}, {1,2,2}, {1,1,1}, {-1,-2,-2}, {0,0,1}, {1,2,1}, {0,0,-1}, {-1,-2,-1}, {0,1,1} };
int dirY[13][3] = { {1,2,3}, {0,0,0}, {1,1,2}, {0,-1,-1}, {1,2,2}, {0,0,-1}, {0,1,2}, {0,0,1}, {1,2,1}, {0,0,-1}, {-1,-2,-1}, {0,... | ALGO | 0.999852 | 4.315868 |
b2e6e20b-2cec-4b10-bf80-0cd4e7742ec2 | khanhtoan094/18-mang02 | 18 manh02/18 manh02.cpp | // 18 manh02.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <iostream>
using namespace std;
int main()
{
int tien;
cout << "nhap tien\n"; cin >> tien;
int soto500 = 0, soto200 = 0, soto100 = 0, soto50 = 0, soto20 = 0, soto10 = 0, soto5 = 0, so... | ALGO | 0.94831 | 3.460548 |
3fa4be23-a5ac-4a7f-9cb0-28c00e124f9c | Kfkcome/lougu | csp/202212-2.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int pre[366], t[366], s[366], last[366];
int main()
{
cin >> n >> m;
for (int i = 1; i <= m; i++)
{
cin >> pre[i];
}
for (int i = 1; i <= m; i++)
{
cin >> t[i];
}
for (int i = 1; i <= m; i++)
{
if (last[p... | ALGO | 0.999984 | 3.083074 |
13661f77-97fd-4679-9a14-7ba1efe64bd7 | SenseLogic/MYST | BOOST/boost_1_76_0/libs/geometry/doc/index/src/examples/rtree/value_shared_ptr.cpp | //[rtree_value_shared_ptr
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <cmath>
#include <vector>
#include <iostream>
#include <boost/foreach.hpp>
#include <boost/shared_ptr.hpp>
namespace ... | ALGO | 0.999264 | 6.511525 |
db60722f-f67e-49b8-bac8-3a1bd030716e | mission365/neetcode150 | arrays and hashing/two_sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
int n = nums.size();
unordered_map<int,int> mp;
for(int i=0;i<n;i++){
int diff = target - nums[i];
if(mp.find(diff) != mp.end()){
return {mp[diff], i};
}
... | ALGO | 0.999748 | 6.350684 |
85a3f0fc-7bab-4269-895d-dc2fb1fb672c | Sajan6778/Myapp1 | 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 |
b32ba6e9-9ebd-428b-b102-0cac580186a2 | theenesh7073/dbms_lab | XFS_Interface/BPlusTree.cpp | #include <cstring>
#include <cstdio>
#include <queue>
#include <iostream>
#include "BPlusTree.h"
#include "define/constants.h"
#include "define/errors.h"
#include "disk_structures.h"
#include "block_access.h"
using namespace std;
BPlusTree::BPlusTree(int relId, char attrName[ATTR_SIZE]) {
// initialise object instan... | ALGO | 0.988365 | 3.829909 |
416359c0-2eba-4946-a2c0-987d0b4891a7 | yash3001/NS-QOTD-CODE | 22_09_2022.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n;
cin >> n;
vector<int> a(n);
for(auto &i : a) cin >> i;
int ans = 0;
for(int i = 0; i < n; i++){
if(a[i] % 2){
ans = 0;
break;
}
a[i] /= 2;
while(a[i] ... | ALGO | 0.999908 | 4.284726 |
42b9df18-0ec3-4bde-b2a8-f4fbc9c3a72a | shubhada10kunde/OnJobTraining-OJT- | DecodeString.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
string decodeString(string s)
{
stack<int> IntStack; // Creates an empty stack to store integer values.
stack<string> StringStack; // Creates an empty stack to store string values.
int ptr = 0; //... | ALGO | 0.99939 | 6.264365 |
8d7b5024-48a1-4c95-9b16-dfe74d094ec1 | Koyingtw/CP | CSES/Tree Algorithm/Tree Diameter.cpp | // Problem: Tree Diameter
// Contest: CSES - CSES Problem Set
// URL: https://cses.fi/problemset/task/1131
// Memory Limit: 512 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define Weakoying ios::sync_with_stdio(0), cin.tie(0), cout.ti... | ALGO | 0.999342 | 4.454978 |
9508b4ce-c65a-432b-ad78-339d7b728caa | OmarAlaaeldein/ALViS | thirdparty/eigen-3.2.7/bench/geometry.cpp |
#include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 8
#endif
typedef SCALAR Scalar;
typedef NumTraits<Scalar>::Real RealScalar;
typedef Matrix<RealScalar,Dynamic,Dynamic> A;
type... | ALGO | 0.953624 | 5.941502 |
a498899c-15f3-4d93-abb1-ba019ea3f65f | aminjonshermatov/competitive_programming | stepik/199929/2/2.2.1.cpp | //
// Created by aminjon on 11/5/22.
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
auto solve() {
ll N, M;
cin >> N >> M;
vector<pll> A(2 * N);
for (ll i = 0; i < N; ++i) {
ll l, r;
cin >> l >> r;
A[2 * i] = make_pair(l, 1);
... | ALGO | 0.999958 | 4.685835 |
435bbc10-fa7d-4d96-b57a-b60139f2a294 | deepak2k03/DSA | 16_Dynamic_Programming/43_Unbounded_Knapsack_Memoization.cpp | // User function Template for C++
class Solution {
public:
int f(int ind,vector<int>&val, vector<int>&wt, int w,vector<vector<int>>&dp){
if(ind==0){
if(wt[0]<=w) return (w/wt[0])*val[0];//max no of times u can steal it
else return 0;
}
if(dp[ind][w]!=-1) return dp[... | ALGO | 0.999929 | 5.099077 |
94deb1f6-f115-4424-9b0b-39e06d085679 | jseobyun/WarpHE4D_ReFLAME | ext/botsch-kobbelt-remesher-libigl/ext/libigl/tutorial/703_Decimation/main.cpp | #include <igl/circulation.h>
#include <igl/collapse_edge.h>
#include <igl/edge_flaps.h>
#include <igl/shortest_edge_and_midpoint.h>
#include <igl/read_triangle_mesh.h>
#include <igl/opengl/glfw/Viewer.h>
#include <Eigen/Core>
#include <iostream>
#include <set>
#include "tutorial_shared_path.h"
int main(int argc, char... | ALGO | 0.991062 | 5.780732 |
2c53f278-1ae8-4995-8041-c7137dc4bafa | YenNhi392/dsa1 | [BST] Nodes with level k.cpp | #include <iostream>
using namespace std;
struct node {
int info;
node* left, * right;
node(int x) {
info = x;
left = right = NULL;
}
};
typedef node* Tree;
void add(Tree& t, int x) {
if (t == NULL) {
t = new node(x);
return;
}
if (x < t->info) {
add(t->left, x);
}
else {
add(t->right, x);
}
}
... | ALGO | 0.999974 | 3.954648 |
06ba7575-1fb0-4b08-b293-ddfba35b5f9d | nkufree/opencv-cmake-template | deps/eigen-3.4.0/bench/sparse_lu.cpp |
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out
#define EIGEN_SUPERLU_SUPPORT
#define EIGEN_UMFPACK_SUPPORT
#include <Eigen/Sparse>
#define NOGMM
#define NOMTL
#ifndef SIZE
#define SIZE 10
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifnd... | ALGO | 0.997005 | 4.19082 |
802c0572-443b-49fc-b683-2b03e692c4a7 | sebastiandperez/CPP_S1 | Practicing/vectores.cpp |
// Online C++ Compiler - Build, Compile and Run your C++ programs online in your favorite browser
#include<iostream>
using namespace std;
void proc1(int v[], int v2[]){
for(int i=0; i<100; i++){
v[i] = i;
v2[i] = i*2;
}
}
int main()
{
int v[100];
int v2[100];
for(int i=0; i... | ALGO | 0.99115 | 3.554947 |
1f63ac20-8742-4968-a12c-3598eed30c5f | rickyHong/CRNN-Caffe-Text-repl | src/caffe/util/im2col.cpp | #include <vector>
#include "caffe/util/im2col.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
// Function uses casting from int to unsigned to compare if value of
// parameter a is greater or equal to zero and lower than value of
// parameter b. The b parameter is of type signed and is always positiv... | TOOL | 0.911194 | 7.823773 |
a7a62afa-f5df-4c73-b8e5-2a72a943020c | Barsh4ec/OOP_Lab_3.3C | OOP_Lab_3.3C/Source.cpp | #include <iostream>
#include <Windows.h>
#include "Vector3D.h"
using namespace std;
int main()
{
Vector3D l, r;
cin >> l;
cout << l << endl;
cin >> r;
cout << r << endl;
Vector3D t;
t = l + r;
cout << "a + b " << t << endl;
t = l - r;
cout << "a - b " << t << endl;
cout << "a * b = " << l * r << endl;
co... | ALGO | 0.974698 | 3.761854 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.