uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
329c216a-b75b-44bf-b8b1-6cfb22f1143a | sinian666/codes_41_16 | 1cpp/chapter_computational_complexity/worst_best_time_complexity.cpp | /**
* File: worst_best_time_complexity.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 生成一个数组,元素为 { 1, 2, ..., n },顺序被打乱 */
vector<int> randomNumbers(int n) {
vector<int> nums(n);
// 生成数组 nums = { 1, 2, 3, ..., n }
for (int i = 0; i < n; i++) {
n... | ALGO | 0.998236 | 5.237251 |
5c6fe36d-3b19-46cb-aff6-c69030b99a16 | ishandutta2007/codeforces | hellkitsune/normal/178/A2.cpp | #include <iostream>
using namespace std;
int tree[100001], n;
int get(int r)
{
int result = 0;
for (; r > 0; r -= r & (-r))
result += tree[r];
return result;
}
void add(int a, int x)
{
for (; a <= n; a += (a & (-a)))
tree[a] += x;
}
int main(void)
{
int k, n2, kk;
cin >> n;
... | ALGO | 0.999994 | 3.466816 |
dd70e677-c769-4eb2-8735-7ccde431557d | mkltaneja/Leetcode | Weekly_Contest_#282/2186. Minimum Number of Steps to Make Two Strings Anagram II.cpp | int minSteps(string s, string t)
{
vector<int> map(26);
for(char c : s)
map[c-'a']++;
for(char c : t)
map[c-'a']--;
int ans = 0;
for(int x : map)
ans += abs(x);
return ans;
}
| ALGO | 0.999976 | 5.189838 |
3edd318a-bd95-4dac-b166-b0f43cb30a3b | ArefinAlter/ProblemSolving | atcoder/abc139/C.cpp | //#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//using namespace _... | ALGO | 0.999769 | 3.774778 |
0897140c-bfaf-4da6-935a-afb842763f0a | AmitrajitDas/DSA-CP | 135-candy/135-candy.cpp | class Solution {
public:
int candy(vector<int>& ratings) {
int n = ratings.size();
vector<int> L2R(n);
vector<int> R2L(n);
vector<int> res(n);
for(int i = 0; i < n; i++) // allocating 1 candy to each child
L2R[i] = R2L[i] = 1;
fo... | ALGO | 0.999999 | 6.127522 |
0d339271-8513-4640-ac54-394b0b2b23a9 | 1470vxiv/Algo2025_LeetCode | Week5/23_merge k sorted lists.cpp | #include <iostream>
#include <vector>
using namespace std;
//Definition of single-ended link 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)... | ALGO | 0.999434 | 5.623828 |
f4fcb554-ea4f-4334-be74-858de0b721b9 | huzaifamomin49/CSES-problem-set | CSES/ferris wheel/ferris wheel/main.cpp | #include <iostream>
#include<algorithm>
using namespace std;
int main() {
int n,w;
cin>>n>>w;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
sort(arr,arr+n);
int i=0,j=n-1;
int cnt=0;
while(i<=j){
if(arr[i]+arr[j]<=w){
i++;
}
cnt++;j--;
}
... | ALGO | 0.999967 | 4.161705 |
0aad0828-2e86-4a5f-b119-4732dd907d12 | nandor/MobileAR | MobileAR/ar/BlurDetector.cpp | #include "ar/BlurDetector.h"
namespace ar {
BlurDetector::BlurDetector(int rows, int cols, int threshold)
: rows_((rows >> 4) << 4)
, cols_((cols >> 4) << 4)
, threshold_(threshold)
, levels({
std::make_shared<Level>(rows_ >> 1, cols_ >> 1, 8),
std::make_shared<Level>(rows_ >> 2, cols_ >> 2, 4),
s... | ALGO | 0.990138 | 7.264165 |
44bb513a-578b-4387-b05c-7728117d1ec6 | Bidhit74/DSA-With-C- | Day 16 - 2D - VectorOfVector/Search2DMatrixII.cpp | // leetcode : 240. Search a 2D Matrix II
// Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties:
// Integers in each row are sorted in ascending from left to right.
// Integers in each column are sorted in ascending from top to bott... | ALGO | 0.999915 | 6.149397 |
cab2a3c9-deae-4626-9e69-c25f37a236af | sarjakshah/opencv_sarjak | opencv/modules/stitching/src/exposure_compensate.cpp | #include "precomp.hpp"
namespace cv {
namespace detail {
Ptr<ExposureCompensator> ExposureCompensator::createDefault(int type)
{
if (type == NO)
return makePtr<NoExposureCompensator>();
if (type == GAIN)
return makePtr<GainCompensator>();
if (type == GAIN_BLOCKS)
return makePtr<Blo... | ALGO | 0.952926 | 6.008318 |
7051ea5f-5c2e-4491-9e99-e8251ee53484 | biggysmith/advent_of_code_2015 | src/day18/day18.cpp | #include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <set>
#include <map>
#include <queue>
struct grid_t{
char& get(int x,int y) { return points[y*width+x]; }
const char& get(int x,int y) const { ret... | ALGO | 0.999863 | 6.3921 |
358f1583-2b43-40cc-ab03-aaa1cc837a2f | zzArchive-if-03-22-D-fall-2018/assignment-13-simple-sorts-DalexKraus | test_sorting_algorithms.cpp | /*-----------------------------------------------------------------------------
* HTBLA-Leonding / Class: <your class name here>
*-----------------------------------------------------------------------------
* Exercise Number: #exercise_number#
* File: test_sorting_algorithms.c
* Author(s): Peter Bauer
* Du... | TEST | 0.981376 | 5.997956 |
45e7495b-1932-454d-8f5f-432d93f2ba57 | PlasmaControl/FreeMHD | OpenFOAM-v2206/ThirdParty/sources/cgal/CGAL-4.14.3/examples/Polyhedron/polyhedron_prog_vertex_normal.cpp | // computes the normal vector for facets, assuming they are triangles
// (or at least reasonably planar convex polygons), and the normal
// vector for vertices by accumulating the normal vectors of all
// incident facets. All normal vectors are normalized, which requires
// sqrt computations. Therefore we use the Simpl... | ALGO | 0.999375 | 7.74222 |
7f7704a7-acea-4427-b70a-36754f8cb7fe | akormous/dsa | 6_Recursion_And_DP/CountSortedVowelStrings.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int countVowelStrings(int n) {
vector<vector<int>> dp(n+1, vector<int>(6));
for(int i = 1; i <= n; ++i) {
for(int j = 1; j <= 5; ++j) {
dp[i][j] = dp[i][j-1] + (i > 1 ? dp[i-1][j] : 1);
... | ALGO | 0.99985 | 6.368047 |
026ea439-6452-444f-80a4-a10a1a31a777 | matpx/blendini | src/extern/libigl/include/igl/slice_sorted.cpp | #include <vector>
// TODO: Write a version that works for row-major sparse matrices as well.
template <typename TX, typename TY, typename DerivedR, typename DerivedC>
IGL_INLINE void igl::slice_sorted(const Eigen::SparseMatrix<TX> &X,
const Eigen::DenseBase<DerivedR> &R,
... | ALGO | 0.99879 | 5.802251 |
2001af06-43c3-449e-87d5-e58fd8777d70 | Bhagatsakshi/StarPatterns | InvertedFullPyramid.cpp | #include <iostream>
using namespace std;
int main() {
int n = 5;
for(int i=0;i<=n;i++){
for(int j=0;j<2*i;j++){
cout<<" ";
}
for (int k=0;k<2*(n-i)-1;k++) {
cout<<"* ";
}
cout<<"\n";
}
return 0;
}
| ALGO | 0.999964 | 3.808867 |
41fce4ea-1e53-45b3-a684-4265fa210d83 | edwardchaos/cgalabc | lib/eigen-3.3.9/doc/examples/class_FixedVectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived, 2>
firstTwo(MatrixBase<Derived>& v)
{
return Eigen::VectorBlock<Derived, 2>(v.derived(), 0);
}
template<typename Derived>
const Eigen::VectorBlock<const Derived, 2>
firstTwo(c... | TOOL | 0.905091 | 5.181627 |
6b243fc4-7245-44c1-a5df-d2c581374d7d | HaochenLiu/My-LintCode-CPP | 038.cpp | /*
038. Search a 2D Matrix II
Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it.
This matrix has the following properties:
* Integers in each row are sorted from left to right.
* Integers in each column are sorted from up to bottom.
* No duplicate intege... | ALGO | 0.999993 | 6.454133 |
b5db2bdf-2a0f-4ac2-8bbe-f73d26106216 | Devj2005/C-Codes | C++/names array 2.cpp | #include <iostream>
using namespace std;
int main(){
int x = 5;
string name[x]={"ALI","CHE", "FWA", "KWE", "KUM"};
cout<<"Name[0]= "<<name[0]<<endl;
cout<<"Name[1]= "<<name[1]<<endl;
cout<<"Name[2]= "<<name[2]<<endl;
cout<<"Name[3]= "<<name[3]<<endl;
cout<<"Name[4]= "<<name[4]<<endl;
name[4]="TUM";
cout<<"Name[4]= ... | ALGO | 0.909104 | 3.530388 |
717c2618-aa21-40f8-9ff2-d3f809e850c0 | sourav-islam/XPSC | Week 11/Day 7/E_Restaurant_Customers.cpp | #include <bits/stdc++.h>
using namespace std;
// typedef long long int ll;
#define int long long
#define pp(x) cout << x << "\n"
int32_t main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
map<int, int> df;
while (t--)
{
int l, r;
cin >> l >> r;
df[... | ALGO | 0.99981 | 4.814727 |
1ce4035c-90ac-4fe5-99f0-c90b0440c4a7 | ishandutta2007/codeforces | hehezhou/normal/1178/C.cpp | #include <bits/stdc++.h>
using namespace std;
int mod = 998244353;
inline int power(int a, int b) {
long long res = a, ans = 1;
for(; b; b >>= 1, res = res * res % mod) if(b & 1) ans = ans * res % mod;
return ans;
}
int main() {
int w, h;
scanf("%d%d", &w, &h);
return printf("%d\n", power(2, w +... | ALGO | 0.999856 | 4.569376 |
22179690-245b-4658-80dd-35cf8e0c5b98 | focusright/ovr_sdk_win | ovr_sdk_win_1.43.0/LibOVR/Shim/OVR_StereoProjection.cpp | #include <Extras/OVR_StereoProjection.h>
namespace OVR {
ScaleAndOffset2D CreateNDCScaleAndOffsetFromFov(FovPort tanHalfFov) {
float projXScale = 2.0f / (tanHalfFov.LeftTan + tanHalfFov.RightTan);
float projXOffset = (tanHalfFov.LeftTan - tanHalfFov.RightTan) * projXScale * 0.5f;
float projYScale = 2.0f / (tanH... | TOOL | 0.920676 | 7.253594 |
a507098f-d099-4fd8-ad45-e3200fe8de98 | kmjp/procon | 2012-2016/2014/jag/summer_day4/d.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 ZER... | ALGO | 0.999482 | 3.005385 |
c5b915ca-9962-48dd-bada-02d73b66a99d | Mi-Przystupa/PendulumSimulator | C++/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
m << 1,-2,
-3,4;
cout << "1-norm(m) = " << m.cwiseAbs().colwise().sum().maxCoeff()
<< " == " << m.colwise().lpNorm<1>().maxCoeff() << endl;
cout << "infty-norm(m... | ALGO | 0.999717 | 4.081576 |
e0bdb535-d481-48b7-8ff4-13a9004a5844 | JohnXinhua/ACM-Notebook-1 | src/aib.cpp | #include<algorithm>
#include<stdio.h>
#define Nmax 101010
using namespace std;
int AIB[Nmax],v[Nmax],M,x,y,z;
int N,num;
inline int zeros(int x)
{
return ((x ^ (x - 1)) & x );
}
inline void Add(int x, int q)
{
int i;
for (i = x; i <= N; i += zeros(i))
AIB[i]+=q;
}
inline int comp(int x)
{
int... | ALGO | 0.99985 | 3.56088 |
908c0d68-d886-424a-be3a-8d9b7d8a8bef | afjaramilg/comp_prog | practice1/cfc1406b.cpp | // https://codeforces.com/contest/1406/problem/B
// redux version----------------------
#include <bits/stdc++.h>
#define d(x) cout << #x << " " << x << el
#define vec vector
#define el '\n'
const int MAXN = 1e5 + 200;
const int INF = 1 << 30;
using namespace std;
// problem start----------------------
// < incre, > ... | ALGO | 0.999952 | 5.466331 |
bd92cc80-10f5-41bd-aa80-5b5956f34283 | ahmdirvn/RandomQotes-API-consum-Flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
e6b42400-3157-4f7c-a275-e2551e13300e | abhi2666/DSA | missing.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
int n = nums.size();
int formSum = (n * (n + 1)) /2;
int totalSum = 0;
for(int i = 0; i < n; i++)
{
totalSum += nums[i];
}
return abs(formSum - totalSum);
}
}; | ALGO | 0.999777 | 5.740587 |
1ba36d24-8866-4be8-adc5-76137b111003 | Keyur2311/DSA | BINARY TREE/SERIALIZE_AND_DESERIALIZE_BINARY_TREE.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
// serialization of a Binary tree from preorder
void serialize(Node *&root, vector<int> &v)
{
if... | ALGO | 0.999936 | 4.893991 |
5b2e1a28-6f4b-481b-aec8-b199dbfe920f | Glory-Day/Solutions | Baekjoon/Cpp/7868.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int main() {
int a, b, c, n;
cin >> a >> b >> c >> n;
vector<ll> arr;
ll mx = 1e18;
for (ll i = 1; i < mx; i *= a) {
for (ll j = i; j < mx; j *= b) {
for (ll k = j; k < mx; k... | ALGO | 0.999975 | 4.174772 |
5c72125c-9a66-45e9-a4de-a36063797a60 | jim2832/Leetcode | 2616-maximal-score-after-applying-k-operations/2616-maximal-score-after-applying-k-operations.cpp | class Solution {
public:
long long maxKelements(vector<int>& nums, int k) {
priority_queue<int> pq;
long long result = 0;
for(auto &num : nums) pq.push(num);
while(k--){
result += pq.top();
pq.push((pq.top() + 3 - 1) / 3);
pq.pop();
}
... | ALGO | 0.999973 | 5.506238 |
56f81974-b530-476e-9bc5-d0dc0c0eba52 | wasimraazakram/DSA-Problems | Easy/Common elements/common-elements.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
vector <int> commonElements (int A[], int B[], int C[], int n1, int n2, int n3)
{
//code here.
unordered_map<int,int>m;
vector<int> v;
... | ALGO | 0.999798 | 5.058301 |
60afb6c1-4262-4379-a47e-8e87d5c5f25e | raincross7/code-similarity | codes/train_code/problem012/problem012_222.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, H, maxA = 0;
cin >> N >> H;
vector<int> A(N);
vector<int> B(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i) >> B.at(i);
maxA = max(A.at(i), maxA);
}
sort(B.begin(),B.end());
reverse(B.begin(),B.end());
... | ALGO | 0.999987 | 4.41376 |
a77e0d9f-5ab8-4b92-8fe6-342bda347815 | biurci-scrivener/DGP | deps/polyscope/deps/glm/test/gtx/gtx_fast_trigonometry.cpp | #include <glm/ext/scalar_ulp.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_trigonometry.hpp>
#include <glm/gtx/integer.hpp>
#include <glm/gtx/common.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/trigonometric.hpp>
#include <cmath>
#i... | TEST | 0.979037 | 6.521127 |
c42f74c7-0a5e-4370-8d52-a8bbe51b5766 | gauravmishra15/algorithms-and-data-structures | Graph Algorithms/graphs_starters_edx_1807052307/week5_mst_starters/1_connecting_points/connecting_points.cpp | #include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
using std::vector;
double minimum_distance(vector<int> x, vector<int> y) {
double result = 0.;
//write your code here
return result;
}
int main() {
size_t n;
std::cin >> n;
vector<int> x(n), y(n);
for (size_... | ALGO | 0.999948 | 4.082165 |
d87ca99d-00f9-494b-a9b6-d5d35a72ec60 | Arbazbms/competitive-programming | coding practise/stringPalin.cpp | // #include<bits/stdc++.h>
// using namespace std;
// //REVIEW Enhance time complexity
// int main(){
// string s1 = "mom";
// string temp;
// int flag = 1;
// for(int i=s1.length()-1;i>=0;i--){
// temp+=s1[i];
// }
// if(s1 == temp){
// cout<<"Palindrome";
// }
// else
... | ALGO | 0.999293 | 3.555745 |
5b581b0a-204a-4490-907c-8f8a4fbd920f | yplusplus/aabbyy | 20131031/a.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 111111;
char str[N], buf[N];
int next[N];
int sub_len;
void get_next(char *s) {
int i = 0, j = -1;
next[0] = -1;
while (i < sub_len) {
while (~j && s[i] != s[j]) j = next[j];
i++, j++;
next[i] = ... | ALGO | 0.999741 | 3.603777 |
021c0ab0-5f98-4d2a-ab74-41bd521eb27f | OpenGVLab/VisionLLM | VisionLLMv2/mmcv/mmcv/ops/csrc/parrots/chamfer_distance.cpp | #include "pytorch_cpp_helper.hpp"
#include "pytorch_device_registry.hpp"
void chamfer_distance_forward_impl(const Tensor xyz1, const Tensor xyz2,
const Tensor dist1, const Tensor dist2,
const Tensor idx1, const Tensor idx2) {
DISPATCH_DEVICE_IMPL(... | TOOL | 0.916247 | 6.667909 |
ddeb038b-c8d7-425f-8cad-0076bc2b1fe7 | xzqiaochu/cpp | problem/MFOJ/algorithm/dp/basics/B.cpp | // B-½(LIS)
// http://www.mfstem.org/contest/53/problem/B
// author: xzqiaochu
// status: PACңOJûspecial judge)
// time: 2019/10/30
#include <cstdio>
#include <algorithm>
using std::max;
const int SZ = 105;
int n, a[SZ];
int rank[SZ], f[SZ], pre[SZ], out[SZ];
int ans, end;
void calc()
{
// rank[] = ±
int maxn =... | ALGO | 0.999996 | 4.091486 |
79a1403d-4031-4cab-b423-875ff763eb38 | thalium/icebox | third_party/retdec-3.2/src/config/parameters.cpp | /**
* @file src/config/parameters.cpp
* @brief Decompilation configuration manipulation: decompilation parameters.
* @copyright (c) 2017 Avast Software, licensed under the MIT license
*/
#include "retdec/config/parameters.h"
namespace {
const std::string JSON_verboseOut = "verboseOut";
const std::s... | CONFIG | 0.881125 | 7.449677 |
33d38376-f70c-4425-a3ab-8b60cfd87b99 | ramprasadg/AlgosForOnlineJudges | cplusplus/codechef/SUMTRIAN.cpp | /*
http://www.codechef.com/problems/SUMTRIAN
*/
#include <iostream>
using namespace std;
int input[101];
int arr[101];
int main(){
int tests,n;
cin>>tests;
for(int test=0; test < tests; test++){
cin>>n;
for(int i=0; i<n; i++) {
for(int j=0; j<=i; j++) {
cin>>in... | ALGO | 0.999895 | 4.1737 |
1cf53b8b-d591-4769-9b0e-62614fa0af5b | santiavilaplaza/UF2-Flutter-Project | 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.998757 | 6.771107 |
55584392-63f4-4ee7-8d40-e88709f8deb0 | peizheg/usaco-guide | 2 - Programming in C++/2.7 For Loops/kattis/fizzbuzz.cpp | #include <iostream>
using namespace std;
int main () {
int x, y, n;
cin >> x >> y >> n;
for (int i = 1; i <= n; i++) {
if (i % x == 0 && i % y == 0) {
cout << "FizzBuzz" << endl;
} else if (i % x == 0) {
cout << "Fizz" << endl;
} else if (i % y == 0) {
... | ALGO | 0.999965 | 4.741375 |
a9345469-8730-4169-8652-6b3ad14aab97 | nikolapesic2802/Programming-Practice | Depot ioi/main.cpp | /*
-https://github.com/mostafa-saad/MyCompetitiveProgramming/blob/master/Olympiad/IOI/official/2001/sol.pdf
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define ll long long
#define pb push_back
#define sz(x) (int)(x).size()
#define m... | ALGO | 0.999984 | 3.339399 |
0c6287ae-9863-47b1-9c2e-97166a42e14b | rvarunbharadwaj/GPGPU | ParallelScan/ParallelScan/ParallelScan/ParallelScan/functions.cpp | #include "ParallelScan.h"
void OnInitializeInputData(float* vectorTemp, int SIZE)
{
for (int i = 0; i < SIZE; i++)
{
vectorTemp[i] = ((float)rand() / (RAND_MAX + 1) * (RANGE_MAX - RANGE_MIN) + RANGE_MIN);
}
}
void CopyInputData(float* vectorTemp, float* ref,int SIZE)
{
for (int i = 0; i < SIZE; i++)
{
vector... | TOOL | 0.984909 | 3.178757 |
da3032e6-90b3-4e2d-b0a0-8b14fb213964 | vivek-30/cp-and-dsa-zone | CodeChef/Starters/Starters57/3.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define inf 2e18
#define minf -2e18
#define yes cout << "YES" << "\n";
#define no cout << "NO" << "\n";
#define pii pair<ll, l... | ALGO | 0.999915 | 4.699648 |
9e60bd50-431f-4d12-8a31-d3a2769019a6 | NamanJain8/CompetitiveCodes | GFG/dp/long_path.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define uint unsigned int
#define read(n) scanf("%d",&n)
#define readll(n) scanf("%lld",&n)
#define read2(n,m) scanf("%d%d",&n,&m)
#define read3(n,m,l) scanf("%d%d%d",&n,&m,&l)
#define fr(i,n) for(int i=0;i<n;... | ALGO | 0.999863 | 3.57962 |
48f6b2b4-d53a-4431-9040-2f4519bc9b17 | Harshit-Vashisth/Leetcode | 0003-longest-substring-without-repeating-characters/0003-longest-substring-without-repeating-characters.cpp | class Solution {
public:
int lengthOfLongestSubstring(string s) {
//using unordered set
int left=0;
int maxlen=0;
unordered_set<char> ch;//to check the unique ele in the set
for(int r=0;r<s.length();r++){
while(ch.find(s[r])!=ch.end()){
c... | ALGO | 0.999882 | 6.121971 |
e4485747-e9ef-4387-bc59-f3855d906250 | ishandutta2007/codeforces | mr.robot_28/normal/1550/F.cpp | #include<bits/stdc++.h>
#define X first
#define Y second
#define sz(a) (int)a.size()
#define ll long long
//#define int long long
using namespace std;
const int mod = 1e9 + 7;
const int N = 3e5;
int a[N];
int n, q, s, d;
int dist[N];
set <pair <int, int> > st;
set <pair <int, int> > st1;
void add_points(int l, int r, i... | ALGO | 0.999988 | 3.863724 |
49048a17-7d57-45ac-91cb-3da6f3a6ac6f | ishandutta2007/codeforces | atatomir/normal/618/C.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 100011
#define Point pair<ll, ll>
int n, i;
Point P[maxN];
int A, B, C;
ll aux;
ll dist(int id1, int id2)... | ALGO | 0.999924 | 3.689565 |
518bb3e1-a685-4394-b519-1c7348a74d0e | 9033/solving-UVa | 336 - A Node Too Far.cpp | // Problem ID: 336 - A Node Too Far
// sol by bfs
#include <iostream>
#include <cstring>//memset
#include <utility>//pair
#include <queue>
using namespace std;
int graph[31][31] = {0};
int node_name[31] = {-1}; //노드의 이름.(양수)
int ttl[31] = {999};
int case_num = 1;
int nodes;
queue<pair<int,int>> bfs_queue;
int node_a... | ALGO | 0.999216 | 4.644204 |
adf197b4-b923-4eac-bbea-b3063b04f937 | apaarkamal/LPU-Bootcamp | trie.cpp | #include<bits/stdc++.h>
using namespace std;
struct trie {
trie* next[26];
bool is_end;
int cnt;
trie() {
is_end = false;
cnt = 0;
for (int i = 0; i < 26; i++) next[i] = NULL;
}
};
void insert(trie* root, string name) {
trie* cur = root;
cur->cnt++;
for (int i = 0; i < name.size(); i++) {
char ch =... | ALGO | 0.999459 | 3.818338 |
bcc2dae8-8fc8-4458-abef-51bcb74a53c0 | Lennethe/CPsolved | CodeForces/CDF5551/B.cpp | //#define _GLIBCXX_DEBUG
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,m,n) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define sortAl(... | ALGO | 0.999548 | 3.295027 |
0f6d5885-fe8c-4c25-ac7e-bb75f4a852cf | yu3mars/proconVSCodeGcc | atcoder/others/wupc/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1};
int calcSub(int mx... | ALGO | 0.999983 | 3.504535 |
3b953801-d936-41f7-8eb4-c35c4a7b4a42 | Bhanuprakash-M04/leetcode-DSA | 206-reverse-linked-list/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.999658 | 5.643793 |
8f8a097f-a3f6-44aa-bbb0-933657328f8d | Abhishek-Sharma-1999/GeeksForGeeks-Solutions | Medium/Count all Possible Path/count-all-possible-path.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int isPossible(vector<vector<int>>paths){
/*
agar ek vertex ko visit kar liya, matlab uski ek edge ko traverse kar chuke hain,
ab agar usmein dusri edge hai, toh vhaan se nikal jaayenge,
(matlab edge... | ALGO | 0.999749 | 6.445187 |
a6014cd0-f62e-4f3a-95c4-5bcbe430f185 | garvitkataria/Compitative-Programming | stockSpan.cpp | #include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long int L;
typedef int l;
typedef vector<L> V;
typedef vector<l> v;
typedef set<L> S;
typedef set<l> s;
#define limit 32000
int Final[10000];
int* stockSpan(int *price, int size)
{
stack<int> S;
S.push(0);
Final[0]=1;
for (int i ... | ALGO | 0.999943 | 4.583554 |
d181ac26-6e0f-40e1-96dd-92c99c15156b | teeger/LSTMNNLM | neuralnet/neuralnet_tanh_layer.cpp | #include <cstdlib>
#include <vector>
#include "neuralnet_tanh_layer.h"
using std::size_t;
using std::vector;
namespace neuralnet {
void NeuralNetTanhLayer::ComputeActivationsImpl() {
size_t i;
const size_t n = nneurons();
const vector<ActivationInputType> &acin = activationinputs();
for (i = 0; i + 7 < n;) {... | ALGO | 0.991131 | 7.368063 |
5eefff43-5bba-4f87-9db6-1b608f2fbb3e | Leapense/problems | 10425번: 피보나치 인버스/피보나치 인버스.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
struct BigInt
{
vector<long long> digits;
static const long long BASE = 1000000000;
BigInt() {}
BigInt(const string &s)
{
for (int i = s.size(); i > 0; i -= 9)
{
... | ALGO | 0.999831 | 5.279588 |
2daf3ad3-316f-4851-81ee-d5c3d8b5091e | YiHsiu7893/UVa | 10125.cpp | // UVa-10125: Sumsets.cpp
#include <iostream>
#include <cstdlib>
#include <algorithm>
using namespace std;
int main(void)
{
int n; // n elements
cin >> n;
while(n)
{
// collecting elements
int element[n];
for(int i=0; i<n; i++)
cin >> element[i];
// sort the elements
std::sort(element, ele... | ALGO | 0.999954 | 4.241391 |
1abfecc5-484d-455b-8abb-574b691355a1 | anand-kumar007/Coding_in_Cplusplus | 3_Functions/2_Fibonacii.cpp | #include<iostream>
using namespace std;
void PrintFibonacii (int );
int main()
{
int n;
cout<<"enter N : ";
cin>>n;
cout<<"first "<<n<<" fibonacci Numbers are : "<<endl;
PrintFibonacii(n);
return 0;
}
void PrintFibonacii(int num)
{
int t1=0,t2=1,t3;
for(int i=1; i<=num; i++)
{
... | ALGO | 0.997994 | 3.48563 |
4e400d64-2a00-4121-8f9c-8c94a279db2e | baofuhann/FISCO_BCOS_FL | deps/src/boost/libs/spirit/classic/example/fundamental/number_list.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demontrates a parser for a comma separated list of numbers
// This is discussed in the "Quick Start" chapter in the Spirit User's Guide.
//
// [ JDG 5/10/2002 ]
//
///////////////////////////////////////////////////////... | TOOL | 0.92521 | 7.060096 |
6c78fa86-478e-4631-89f5-dbe75f26e2dd | leandrophiga/TADS-PDFA1 | Aula 06/Funções IF, ELSE e AND.cpp | #include <stdlib.h>
#include <stdio.h>
#include <locale.h>
#include <math.h>
int main ()
{
setlocale(LC_ALL, "Portuguese");
int numero;
printf("Digite um número: ");
scanf("%i", &numero);
if (numero % 3 == 0 && numero % 5 == 0) // executará os comandos abaixo se forem cumpridas tais condições.
... | TOOL | 0.981129 | 3.424668 |
6a993779-836f-4ac9-8a54-de79f7cde973 | kiah2008/lyra_android | external_libs/eigen-3.4.0/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.989697 | 3.691724 |
dca583c9-44cc-440d-9c9c-abdc8cdcb84e | llvm-pic/llvm-pic | llvm/lib/Support/Program.cpp | #include "llvm/Support/Program.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace sys;
//===----------------------------------------------------------------------===//
//=== WARNING: Implementation here must contain only T... | TOOL | 0.971182 | 7.251667 |
fd4aea72-ef5c-4adc-aeb1-fb52e7d90df2 | deniscostadsc/playground | solutions/beecrowd/1154/1154.cpp | #include <cstdint>
#include <cstdio>
int main() {
float sum = 0.0;
std::int16_t n, count = 0;
while (scanf("%d", &n) && n >= 0) {
sum += n;
count += 1;
}
printf("%.2f\n", sum / count);
return 0;
}
| ALGO | 0.997246 | 4.065271 |
1ac701de-6925-4576-8e54-a9b2381729eb | malviska/sort_algs | src/quicksort_stack.cpp | #include "quicksort_stack.hpp"
#include <iostream>
Index QuickSortStack::Unstack()
{
Index partition = stack[stackSize];
stackSize--;
return partition;
}
void QuickSortStack::Pile(Index A)
{
stackSize++;
stack[stackSize] = A;
}
QuickSortStack::QuickSortStack(ItemLoaded *A, int n)
{
struct rusage resource... | ALGO | 0.994612 | 4.98395 |
4832f043-67c7-48b2-8d47-970a83ebfb77 | sauravmittal001/cfladders | A/Football.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
#include <sstream>
using namespace std;
bool flag = true;
int value1, value2;
string team1, team2;
void f(const string& key) {
if (key == team1) {
value1++;
} else if (key == team2) {
value2++;
} else {
if (f... | ALGO | 0.999908 | 4.603353 |
23a2ed7b-507e-4a77-8738-de006f46f7f6 | romeorizzi/esami-algo-public | 2019-06-25/is_shuffle_of/sol/soluzione.cpp | /**
* is_shuffle_of
*
* Autore: Romeo Rizzi, 2019-06-25
*
* Costo di questa soluzione: quadratico.
*
* Descrizione: programmazione dinamica.
*/
#include <cassert>
#include <cstdio>
#include <algorithm>
#define MAXM 1000
#define MAXN 1000
int m, n, output_type;
int x[MAXM+1], y[MAXN+1], w[MAXM + MAXN+1]; ... | ALGO | 0.999952 | 3.471176 |
075bef02-e22d-46a8-bd6e-f066716aeee2 | LikeScience/Code | CompetitiveProgramming/IOICamp23/9AugPOI/renovation.cpp | #include <bits/stdc++.h>
#define F(i,s,e) for (int i = s; i<e; i++)
#define pii pair<int, int >
#define fi first
#define se second
#define mp make_pair
using namespace std;
int t, n, k;
vector<int> v;
vector<bool> s;
bool cs() {
if ((int)s.size() == n-1) {
map<pii, bool> m;
F(i,0,n-1) if (s[i]){
... | ALGO | 0.999861 | 3.874501 |
4d4af2c1-4ae4-4c5b-890d-096d6676b85a | akkannkkshaa/CPP | pattern5.cpp | /*
D
DC
DCB
DCBA
DCB
DC
D
*/
#include<iostream>
using namespace std;
int main(){
char i,j;
for(i='D';i>='A';i--)
{
for(j = 'D'; j >= i; j--) {
cout<<j;
}
cout<<endl;
}
for(i='B';i<='D';i++)
{
for(j='D';j>=i;j--)
{
cout<<j;
}
cout<<endl;
}
}
| ALGO | 0.99921 | 3.695773 |
a6fbe88e-9073-4830-81d2-7ded0a33cba6 | godot-extended-libraries/godot-fire | thirdparty/squish/clusterfit.cpp | #include "clusterfit.h"
#include "colourset.h"
#include "colourblock.h"
#include <cfloat>
namespace squish {
ClusterFit::ClusterFit( ColourSet const* colours, int flags, float* metric )
: ColourFit( colours, flags )
{
// set the iteration count
m_iterationCount = ( m_flags & kColourIterativeClusterFit ) ? k... | ALGO | 0.993293 | 6.944741 |
009805c2-aec0-48d0-833a-1c67d51cae75 | roca12/gpccodes | Codigos estudiantes por lenguaje/C++/Edwin Villarraga/String's/FiniteAutomata.cpp | using namespace std;
#include<bits/stdc++.h>
#include<cstdlib>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
const int NO_OF_CHARS =256;
int getNextState(char pat[], int M, int state, int x) {
if (state < M && x == pat[state]) {
return state + 1;
}
int ns, i;
for (ns = state; ns >... | ALGO | 0.999961 | 5.370351 |
42a3c612-4e4a-46d4-beb2-b1c159823d1d | oscarGates/codeforces | hungry_sequence/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) (int)((x).size())
#define fill(x, y) memset(x, y, sizeof(y))
#define all(x) (x).begin(), (x).end()
#define sci(x) ... | ALGO | 0.999976 | 3.649489 |
4b46dd4c-1774-4bc6-aad9-157d7d80766b | engrmuzamil/CounterApp | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998667 | 6.789978 |
65a43017-7581-4058-9daa-c3d923a7be2a | zakaria-kabir/CSE203-Data-Structure-Codes | QUEUE & STACK/qz3.cpp | #include<bits/stdc++.h>
using namespace std;
//Q1
/*
void prints(stack<int>q){
while(!q.empty()){
cout<<q.top()<<" ";
q.pop();
}
cout<<endl;
}
void replace(stack<int>& st){
stack<int>s;
while(!st.empty()){
int a=st.top();
st.pop();
if(a%2!=0){
a=a+1;
s.push(a);
}
else
s.push(a);
}
whil... | ALGO | 0.999727 | 4.322277 |
1e3cabad-2dc6-4f57-9b1e-c41ab68b51a5 | 2001adarsh/Contests | Practice/Dynamic Programming/LIS/maximum Bridges.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
#define mod 1000000007
#define inf 1e18
// https://www.geeksforgeeks.org/dynamic-programming-building-bridges/
// Maximum Bridges that can be made without crossing each other.
// more than two bridge can start or end at same po... | ALGO | 0.999985 | 4.833251 |
a016ae91-b7f7-4d62-a20d-4c10ff5e133b | fxingliu/LeetCode | UniquePathsII.cpp | class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
int m = obstacleGrid.size();
int n = obstacleGrid[0].size();
vector<int> cur(m, 0);
if (obstacleGrid[0][0] == 1) return 0;
cur[0] = 1;
for (int j=0; j<n; j++)
for (... | ALGO | 0.999749 | 6.106197 |
e1220ae2-6f07-4650-93f7-390e30db607c | ashutoshm1771/Tech-Prep | Top Algorithms/Grpahs/BFS.cpp | // Author : Ashutosh Mishra
#include<bits/stdc++.h>
using namespace std;
class Graph{
int v;
vector<int> *adj;
public:
Graph(int v)
{
this->v=v;
adj=new vector<int>[v];
}
void addEdge(int v,int u)
{
adj[v].push_back(u);
}
void BFS(int s)
{
queue<int> q;
q.push(s);
vector<bool> vis... | ALGO | 0.999896 | 4.18572 |
004b2bdb-c8f1-4c22-bc34-32e1170533e7 | indam1/LearningC | _CHMIP/chmip13/main.cpp | #include <iostream>
#include <cmath>
using namespace std;
double func(double x) {
return 0.5 * pow(x, 3) - 1;
}
int main()
{
double a;
double b;
double x1;
double x2;
const double k = 0.618;
const double eps = 0.000005;
cout << "Enter the borders: ";
cin >> a >> b;
for (int i ... | ALGO | 0.999943 | 4.780102 |
612dcf76-b7c6-4beb-8804-db68c4f594c0 | abhijitjawale09/LeetCode | 0860-lemonade-change/0860-lemonade-change.cpp | class Solution {
public:
bool lemonadeChange(vector<int>& bills) {
int five = 0 ;
int ten = 0;
for(int &bill : bills) {
if(bill == 5) {
five++;
}else if(bill == 10) {
if(five > 0) {
five--;
ten+... | ALGO | 0.999526 | 6.12438 |
fb5c9210-9199-4a1e-ba1e-8805f986b756 | tigercosmos/labkit | Source/WebCore/css/parser/SizesCalcParser.cpp | #include "config.h"
#include "SizesCalcParser.h"
#include "CSSParserToken.h"
#include "RenderView.h"
#include "SizesAttributeParser.h"
namespace WebCore {
SizesCalcParser::SizesCalcParser(CSSParserTokenRange range, const Document& document)
: m_result(0)
, m_document(document)
{
m_isValid = calcToReverse... | TOOL | 0.926161 | 7.141717 |
c30ad123-390e-434b-acf6-2221f7725c37 | Zain-ul-din/Algo-and-Data-Structures-Road-Map | 3xt/CircularLinkedListREv.cpp | #include<iostream>
class Node{
public:
int data;
Node * prev , *next;
};
class LinkedList {
public:
LinkedList (){
head = nullptr;
tail = nullptr;
}
void Push (int newData){
Node* newNode = new Node{newData , nullptr , nullptr};
if(head == nullptr && tail == nullptr){
head = newNode;
... | ALGO | 0.98509 | 4.369562 |
87db9d92-5d27-4c2f-8b6d-7b27ee773d68 | raincross7/code-similarity | codes/train_code/problem106/problem106_107.cpp | #include<bits/stdc++.h>
using namespace std;
int N;
vector<int> A;
int main() {
cin >> N;
A.resize(N);
for (int i=0; i<N; i++) cin >> A[i];
int res = 0;
for (int i=0; i<A.size(); i++) {
for (int j=i+1; j<A.size(); j++) {
res = res + A[i] * A[j];
}
}
cout << res ... | ALGO | 0.999935 | 4.02498 |
532f4194-9ab8-4d47-86af-9016aed430b8 | SaintHyun/Algorithm | softeer/ghost.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
char tmp;
int maze[1010][1010], n, m, i, j;
int test[1010][1010];
int next_y, next_x;
int namwoo_cost=987654321, ghost_cost = 987654321;
int dy[4] = {0, 0, 1, -1}, dx[4] = {1, -1, 0, 0};
int visited[1010][1010];
int des... | ALGO | 0.999972 | 4.404805 |
e7fdb016-272c-476a-a05b-409fc4538cec | Karthik-Ragunath/competitive_programming | tries-gcj-alient-rhyme.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll testcases;
cin >> testcases;
for(ll k = 0; k < testcases; k++)
{
ll n;
cin >> n;
vector< vector< ll > > trie_graph;
vector< ll > visits(1, 0);
vector< ll > parent(1, -1);
... | ALGO | 0.999827 | 4.441878 |
97f1491a-2cf5-4897-961e-1138e0789fff | Bhagyashrib28/Daily-Programming-Challenge-2024 | Day3.cpp | #include <iostream>
#include <vector>
int findDuplicate(const std::vector<int>& nums) {
int tortoise = nums[0];
int hare = nums[0];
do {
tortoise = nums[tortoise];
hare = nums[nums[hare]];
} while (tortoise != hare);
tortoise = nums[0];
while (tortoise != hare) {
... | ALGO | 0.999958 | 6.712657 |
f6e3f5eb-6e37-4f84-85f8-648616e21dd3 | Seth-Bass/csc_142 | Week 13/Admiral.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
int main() {
// Inputs
double distance, fuel, spaceship_weight, life_support;
int crew_size;
std::cout << "Enter distance to planet (million km): ";
std::cin >> distance;
std::cout << "Enter fuel available (tons): ";
std::cin >> fuel... | TOOL | 0.885795 | 7.065191 |
c8cc6bd4-ccfc-4778-8815-52089149ac76 | maspypy/library | test/2_library_checker/enumerative_combinatorics/sharp_p_subset_sum.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/sharp_p_subset_sum"
#include "my_template.hpp"
#include "other/io.hpp"
#include "poly/product_of_one_plus_xn.hpp"
using mint = modint998;
void solve() {
LL(N, T);
VEC(int, S, N);
auto f = product_of_one_plus_xn<mint>(S, T);
f.erase(f.begin());
print(f);
}
sig... | ALGO | 0.999025 | 4.972709 |
2bb115eb-12ae-48c1-bdae-665cc2e3ab9a | Kitware/VTK | ThirdParty/libproj/vtklibproj/src/param.cpp | /* put parameters in linked list and retrieve */
#include <ctype.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "proj.h"
#include "proj_internal.h"
static void unquote_string(char* param_str) {
size_t len = strlen(param_str);
// Remove leading and terminating spac... | TOOL | 0.98234 | 6.077975 |
0052f3c9-0ea4-4d2b-b08c-2d0dd747cc75 | melody97/geminifs | libgeminiFs_src/cccl/libcudacxx/test/libcudacxx/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// Iter
// is_sorted_until(Iter first, Iter last);
#include <cuda/std/__algorithm_>
#include <cuda/std/cassert>
#include "test_iterators.h"
#include "test_macros.h"
template <class Iter>
__host__ __device__ TEST_... | TEST | 0.961989 | 7.500121 |
85372b23-aba8-48d4-8969-77713c5d5f0b | Rushabh-118/dsa | 14-longest-common-prefix/longest-common-prefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
string res = "";
sort(strs.begin(),strs.end());
int n = strs.size();
string first = strs[0] , last = strs[n-1];
for(int i=0;i<min(first.size(),last.size());i++) {
if(first[i] != last[i]) {... | ALGO | 0.999917 | 5.727368 |
e976321d-431a-4a89-b8e3-4ed0692eff71 | 09asad/Cpp-Programs | sorting/9replace0toN-1.cpp | //in the given vector all elements are +ve, replace min element with 0, second min with 1,........n-1
#include<iostream>
#include<vector>
#include<climits>
using namespace std;
int main(){
vector<int>v1={19,12,23,8,16};
int n=v1.size();
for(int i=0;i<n;i++){
cout<<v1[i]<<" ";
}
cout<<endl;
... | ALGO | 0.999988 | 4.305731 |
b6463171-0b47-4ed3-a1f1-d4fb906cad12 | ishandutta2007/codeforces | hank55663/normal/766/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acos(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memset(x,-1,sizeof(x))
#define MEM(x... | ALGO | 0.999872 | 3.69236 |
428a8956-8460-4020-927f-5595a28d57ae | GeorgiTerziev02/FMI | Data structures and algorithms/Final/Part1/Task02.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
void dfs(std::vector<std::vector<size_t>>& graph, std::vector<bool>& visited, size_t componentIndex, size_t current, std::vector<size_t>& counter) {
visited[current] = true;
counter[componentIndex]++;
for(aut... | ALGO | 0.999724 | 4.824955 |
5d87d440-d765-48b0-bcfc-b65c189a82cd | shirnschall/Numerik2 | code/aufgabe1/eigen-3.3.7/eigen-3.3.7/test/sparse_solvers.cpp | #include "sparse.h"
template<typename Scalar> void
initSPD(double density,
Matrix<Scalar,Dynamic,Dynamic>& refMat,
SparseMatrix<Scalar>& sparseMat)
{
Matrix<Scalar,Dynamic,Dynamic> aux(refMat.rows(),refMat.cols());
initSparse(density,refMat,sparseMat);
refMat = refMat * refMat.adjoint();
for (i... | TEST | 0.961479 | 5.162554 |
d8d93904-c01b-4808-a5d3-f44c2a2bd41e | NancySilence/GitforLab | ContentMatchThrift20141211/Server/src/SentenceSplit.cpp | #include "SentenceSplit.h"
using namespace std;
string SentenceSplit::trim(string str)
{
string erasetarget = "\r\t\n "+punct[0];
str.erase(0, str.find_first_not_of(erasetarget));
str.erase(str.find_last_not_of(erasetarget) + 1);
return str;
}
void SentenceSplit::findIndex(string & str,string &source,vector<int... | ALGO | 0.98983 | 4.345748 |
7b16d88d-04b1-40b8-ab8d-4110ccf5e4eb | yvngaayush/gatorgoestosurgery | cocos2d/extensions/Particle3D/PU/CCPUForceField.cpp | #include "CCPUForceField.h"
NS_CC_BEGIN
const Vec3 PUForceFieldCalculationFactory::DEFAULT_WORLDSIZE(500.0f, 500.0f, 500.0f);
//-----------------------------------------------------------------------
unsigned short PUForceFieldCalculationFactory::getOctaves(void) const
{
return _octaves;
}
//--------------------... | TOOL | 0.957668 | 6.670735 |
197d61ba-3a6b-497e-9ff2-1e839749dc2b | appinho/SAGoogleCodeEventTemplate | Grid/circuit_board_PAR.cpp | // KS19/C
// MEDIUM
// Stack/Histogram
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
int max_hist(const vector<int> & row){
stack<int> sta;
int max_area = 0;
int len = row.size();
for(int i = 0; i < row.size(); i++... | ALGO | 0.999667 | 4.318388 |
08c98012-f589-4d6f-ab77-f488e5d1d18a | zhangxiaohu057/SensorsCalibration | factory_calib/3rdparty/eigen3/lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.999133 | 5.816733 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.