uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d0658aca-0bf4-4a73-a730-261c78104d21 | kishanrajput23/Programming-Resources | DSA CODES IN CPP/LINKED LIST INSERTION.cpp | // A complete working C++ program to demonstrate
// all insertion methods on Linked List
#include <bits/stdc++.h>
using namespace std;
// A linked list node
class Node
{
public:
int data;
Node *next;
};
/* Given a reference (pointer to pointer)
to the head of a list and an int, inserts
a new node on the front of t... | ALGO | 0.998925 | 5.026981 |
01fc969c-3819-4da9-bbbf-5b3f1ce63595 | nikhraj/Leetcode | palindromic-substrings/palindromic-substrings.cpp | class Solution {
public:
int countSubstrings(string s) {
int n=s.size();
int ans=0;
vector <vector <int>> dp(n,vector <int> (n,0));
for(int i=n-1;i>=0;i--)
{
for(int j=i;j<n;j++)
{
dp[i][j]=s[i]==s[j]&&((j-i+1<=2)||dp[i+1][j-1]);
... | ALGO | 0.999967 | 6.084023 |
1eb77741-5b5f-4a5b-8ba9-fc6a50bb3ce5 | PatrikOkanovic/ETH-AlgoLab-2020 | Problem of the Week/Idefix/idefix.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <CGAL/squared_distance_2.h>
#include <boost/graph/adjacency_list.hpp>
#i... | ALGO | 0.999753 | 4.549334 |
e7f23892-902e-46f2-8501-dcf68a1c1677 | 2019331043-Zakaria/Codes | CB/C_-_Manga.cpp | /*
* @Author: Zakaria
* @Date: 2022-10-01 18:16:58
* @Last Modified time: 2022-10-01 18:21:46
*/
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define s second
#define pi acos(-1.0)
#define LCM(a,b) a*b/__gcd(a,b)
#define GCD(a,b) __gcd(a,b)
#define ... | ALGO | 0.99997 | 5.006227 |
02018713-5c33-49ae-8bc9-9ae7b0c299b6 | warehouse-picking-automation-challenges/team_acrv_2017 | acrv_modified_clones/librealsense/src/ivcam-device.cpp | #define _USE_MATH_DEFINES
#include <math.h>
#include <limits>
#include <climits>
#include <algorithm>
#include "image.h"
#include "ivcam-private.h"
#include "ivcam-device.h"
namespace rsimpl
{
rs_intrinsics MakeDepthIntrinsics(const ivcam::camera_calib_params & c, const int2 & dims)
{
return{ dims.x, ... | TOOL | 0.874391 | 7.349762 |
3c8e39de-e1b6-490b-95b7-ce7cd6616924 | Pseudo-iitian/DSA_2024 | Placement/Array/1InsertionArray.cpp | #include<bits/stdc++.h>
using namespace std;
void insertAt(int arr[],int pos,int var,int &size){
if(size>=10){
cout<<"out of bound, you can't enter any more now"<<endl;
return;
}
if(pos<0){
cout<<"position can't be negative"<<endl;
return;
}
else if(pos>=10){
cout<<"position can't go outs... | ALGO | 0.997073 | 3.57279 |
28110d92-98b9-4afe-9570-b2e348081723 | gitHubwhl562916378/opencv4.3 | opencv_contrib-4.3.0/modules/tracking/samples/tutorial_customizing_cn_tracker.cpp | #include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <cstring>
#include "samples_utility.hpp"
using namespace std;
using namespace cv;
// prototype of the functino for feature extractor
void sobelExtractor(const ... | ALGO | 0.992072 | 5.965919 |
e9cb3ae6-9b5b-4eb2-999a-4907367008be | darrinmwiley/jeeves | kb/terraces/terraces.cpp | /*
BEGIN ANNOTATION
PROBLEM URL: https://open.kattis.com/problems/terraces
TAGS: dfs
EXPLANATION:
- For each cell A in the grid, if there is another cell B such that height[A] > height[B], then mark cell A as impossible
- For each cell A in the grid, if A is marked impossible, use dfs (traverse up, down, left, right) ... | ALGO | 0.999988 | 4.375425 |
9e8a8d32-1ca8-403d-8f90-bb0b9386233e | selgod/ExpenseReportManager | tesseract-master/textord/underlin.cpp | #ifdef __UNIX__
#include <assert.h>
#endif
#include "underlin.h"
#define PROJECTION_MARGIN 10 //arbitrary
#define EXTERN
EXTERN double_VAR (textord_underline_offset, 0.1, "Fraction of x to ignore");
EXTERN BOOL_VAR (textord_restore_underlines, TRUE,
"Chop underlines & put back");
/*************... | TOOL | 0.994962 | 5.618581 |
283090b6-e141-4d72-a009-af04084243f1 | Layty/CppPrimer | 11th/11.99.cpp | #include "../include/include.h"
// 将s分隔成多个整体(整数、小数、运算符、括号中的部分均算作一个整体)
std::vector<std::string> split(const std::string &s)
{
std::vector<std::string> ret;
if (s.length() == 0)
return ret;
// bracket
if (s.at(0) == '(')
{
int cnt = 0;
for (int i = 0; i < s.length(); i++)
... | ALGO | 0.99924 | 4.076628 |
d0e3416c-f0c5-4a78-80f4-cb882ad7966e | jarnutowski/ECE752Project | HIP-Examples/strided-access/benchmark-openmp.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <stdexcept>
#include <cstdlib>
#include "benchmark-utils.hpp"
typedef float NumericT;
int kernel_func(NumericT *x, NumericT const *y, NumericT const *z, int stride, int N);
int main(int argc, char **argv)
{
// slightly larg... | TOOL | 0.943912 | 6.021428 |
1dd8d0c6-3fcd-4ae0-9bad-49322587bcb8 | spencerparkin/Thebe | Engine/Source/Thebe/Containers/AVLTree.cpp | #include "AVLTree.h"
using namespace Thebe;
//------------------------------------ AVLTree ------------------------------------
AVLTree::AVLTree()
{
this->rootNode = nullptr;
this->nodeCount = 0;
}
AVLTree::~AVLTree()
{
}
AVLTreeNode* AVLTree::GetRootNode()
{
return this->rootNode;
}
AVLTreeNode* AVLTree::Find... | ALGO | 0.998472 | 5.415489 |
08551a6a-6b18-472e-9c72-a46988eb36ab | vinod-2309/Competitive-Programming | CSES/Graph/Message_Route.cpp | #include<bits/stdc++.h>
using namespace std ;
#define mod 1000000007
#define f(i,a,b) for( int i = a ; i < b ; i++ )
#define lb lower_bound
#define ub upper_bound
#define all(v) v.begin() , v.end()
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typed... | ALGO | 0.99999 | 4.038849 |
5b350da7-8a50-4ec6-bcee-ac0c095f9ca6 | RafaelChavesPB/Codeforces | contests/div3_916/c.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
#ifdef EBUG
#define bug(x) { cout << "*** " << #x << " " << x << '\n' << flush; }
#define bug2(x,y) { cout << "*** " << #x << " " << x \
<< " " << #y << " " << y << '\n' << fl... | ALGO | 0.999995 | 3.525038 |
a3130912-9df9-4e19-93b0-5e8195aef133 | b10011/usaco-solutions | frac1.cpp | /*
ID: nbjarvi1
LANG: C++
TASK: frac1
*/
#include <bits/stdc++.h>
using namespace std;
typedef tuple<float, int, int> frac;
typedef vector<frac> fracs;
bool mycompare(const frac &a, const frac &b) {
return get<0>(a) < get<0>(b);
}
int main() {
ifstream fin("frac1.in");
ofstream fout("frac1.out");... | ALGO | 0.999916 | 4.114915 |
6b053ae9-3ff2-4b2c-a0d0-87f578cb4fba | gaurlakshya/Leetcode_Submissions | 206-reverse-linked-list/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.999627 | 5.643477 |
7319669b-489e-4fb1-809e-fd63d514d566 | Prathamesh1407/LeetCode | Difficulty: Easy/Reverse a Doubly Linked List/reverse-a-doubly-linked-list.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node * next;
Node * prev;
Node (int x)
{
data=x;
next=NULL;
prev=NULL;
}
};
Node *newNode(int data)
{
Node *temp=new Node(data);
... | ALGO | 0.99977 | 5.974032 |
39b7248c-2881-4bec-b60f-ce43e1a9f67a | ishandutta2007/codeforces | qwqcorz/normal/585/E.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=5e5+5;
const int M=1e7+5;
const int p=1e9+7;
ll read(){static ll x;scanf("%lld",&x);return x;}
void write(ll x){printf("%lld",x);}
void print(ll x,char c='\n'){write(x),putchar(c);}
int f[N],g[N],a[M],mu[M];
signed main()
{
int n=read(),m... | ALGO | 0.999965 | 4.009883 |
73ba47e8-8dfb-49a3-85f0-eec6714c52f3 | hoangng-003/UNI-LTNC | Week3/tuan3_bai6.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
string s;
getline(cin,s);
int count=0,sLength = s.length();
for (int i = 1; i < sLength; i++){
if (s[i] != ' ' && s[i-1] == ' ') {
count++;
}
}
cout << count+1;
} | ALGO | 0.999521 | 3.231905 |
013c9097-027a-4d2f-ba9d-474090d284d2 | mbrzecki/julian | src/pricingEngines/optionGreeks/optionVega.cpp | #include <pricingEngines/optionGreeks/optionVega.hpp>
namespace julian {
/** \brief calculates the option's Vega
*
* Vega of option is calculated using the finite difference scheme
* * \f$Vega = \frac{\partial PV}{\partial Vol} \approx \frac{PV(Vol+h) - PV(Vol)}{h}\f$ when forward differencing is used
... | ALGO | 0.999777 | 7.584721 |
4c9ccc47-81cb-4fd8-aa62-b58755f3b5c9 | gajeshladhar/DenseLayer | neural_net.cpp | #include <iostream>
#include <cmath>
#include<fstream>
#include <string>
#include<stdlib.h>
#include "matrix.h"
#include "dense.h"
using namespace std;
int batch_size=401;
int output_size=1;
float calculate_loss(float**,float**);
void read_csv(float**,float**);
int main()
{
Dense *dense_1,*dense_2,*dense_3;
fl... | DATA | 0.998649 | 3.281249 |
c047dbef-ad4e-4f86-99bd-2491f8ab5ac7 | neosizzle/computorv1 | srcs/computor.cpp | #include "main.hpp"
void computor(std::string arg)
{
std::vector<Term> terms;
// trim all whitespaces from input
arg.erase(std::remove_if(arg.begin(), arg.end(), isspace), arg.end());
// validate symbols
const char invalid_symbol = validate_symbols(arg);
if (invalid_symbol)
{
print_err(std::string("Invalid ... | ALGO | 0.999633 | 4.29096 |
c6550991-ba4c-4d49-9478-cee18899e534 | sqiemanqieman/Leetcode-vscode | header/72.编辑距离.cpp | /*
* @lc app=leetcode.cn id=72 lang=cpp
*
* [72] 编辑距离
*/
// @lc code=start
#ifdef RUN_IN_LOCAL
#include "common.h"
#endif
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int minDistance(string word1, string word2) {
vector<vector<int>> dp(word1.size()+1, vector<int>(word2.size(... | ALGO | 0.999954 | 6.24189 |
eff77ce0-e3e7-4149-9b1c-c15cf6afae00 | DevEtwas/university_practice-first_half | C-72568/main.cpp | /*Problem C: 72568. Maxmimum in array
Given an array consisting of integers. Write a program, which outputs maximum in array.
Input format
The first line contains integer n
(1⩽n⩽105) — array size. The next line contains n integers ai (−109⩽ai⩽109)
— elements of array.
Output format
Single integer, maximum in array.... | ALGO | 0.997704 | 4.751099 |
c69f32cd-0adb-4471-b25e-7ca0f27d3a0d | DanielGoncalves666/Programando | CodCad/Gangorra.cpp | #include<iostream>
using namespace std;
int p1,p2,c1,c2;
int main(){
cin>>p1>>c1>>p2>>c2;
if(p1*c1==p2*c2)
cout<<"0\n";
else if(p1*c1<p2*c2)
cout<<"1\n";
else
cout<<"-1\n";
return 0;
}
| ALGO | 0.999952 | 3.428524 |
6a94a296-a78d-4088-8431-186e0779ca5d | Ryb7532/AtCoder | submissions/abc351/e.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define GET_MACRO(_1,_2,_3,NAME,...) NAME
#define rep3(i,s,e) for (int i=(int)s; i<(int)e; i++)
#define rep2(i,n) rep3(i,0,n)
#define rep1(n) rep2(_,n)
#define rep(...) GET_MACRO(__VA_ARGS__,rep3,rep2,rep1)(__VA_ARGS__)
#define ... | ALGO | 0.999948 | 4.219666 |
82b772ae-67a3-4fad-b705-1f9c8dcdc8aa | anipatil72/My_Competitive_Programming | B_Conveyor_Belts.cpp | // ॥ श्री गणेशाय नमः ॥
#include <bits/stdc++.h>
#include <random>
#include <complex>
#include <tuple>
#include <functional>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#include <cstdint>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
... | ALGO | 0.999322 | 4.077724 |
0a858a12-944e-4c83-8b25-fc87394a239c | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9583_0.cpp | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
#define MAX 100000
#define INFTY (1 << 30)
class Edge {
public:
int t, w;
Edge() {}
Edge(int t, int w) : t(t), w(w) {}
};
vector<Edge> G[MAX];
int n, d[MAX];
bool vis[MAX];
int cnt;
void bfs(int s) {
for(int i = 0; i < n; i++) ... | ALGO | 0.999925 | 4.15312 |
b71a612f-1346-4b88-9014-2934f00e9fed | shreyansh-sawarn/HackerRank-Solutions | Algorithms/Birthday Cake Candles.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int maxVal = 0, ans = 0;
for (int i = 0; i < n; i++) {
int height;
cin >> height;
if (height > maxVal) {
maxVal = height;
ans = 1;
} else if (height == maxVal) {
ans++;
}
}
cout << ans << endl;
re... | ALGO | 0.999941 | 4.605027 |
a74684f6-bfec-498b-9702-55d4f31acc42 | pushkarguptaaa/Cpp-DSA | arrayChallenges.cpp | #include <iostream>
using namespace std;
int main(){
// max till i
// int n;
// cin>>n;
// int arr[n];
// for(int i=0; i<n; i++){
// cin>>arr[i];
// }
// int maxNo=INT_MIN;
// for(int i=0; i<n; i++){
// maxNo=max(maxNo,arr[i]);
// cout<<maxNo<<" ";
// }
/... | ALGO | 0.999765 | 4.248114 |
d530e759-857a-4f1b-be26-5dc11b79053d | wopeizl/frcnn-caffe | src/caffe/util/io.cpp | #include <fcntl.h>
#if defined(_MSC_VER)
#include <io.h>
#endif
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/text_format.h>
#ifdef USE_OPENCV
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/highgu... | TOOL | 0.891689 | 7.537454 |
cb0b2e00-0540-433e-89ca-26148ee0edb8 | CRAZFREE/CPlusPlus | 03_basicmath.cpp | #include<bits/stdc++.h>
using namespace std;
int countDigit(int n){
int count;
count = log10(n) + 1;
return count;
}
int extractDigit(int n){
int ed, newDigit=0;
while(n>0){
ed = n % 10;
n = n / 10;
newDigit = newDigit * 10 + ed;
}
return newDigit;
}
int reverse(... | ALGO | 0.999731 | 4.353317 |
08aa7957-8996-4455-96ff-146eecf8cbd9 | hosi1001/Atcoder_ABC | 259/Cbefore.cpp | #include <iostream>
#include <vector>
#include <array>
#include <iterator>
#include <charconv>
#include <bits/stdc++.h>
#include<string>
#include <iomanip>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <set>
using namespace std;
using ll = long long;... | ALGO | 0.999986 | 5.546842 |
0b38ee14-58c3-4885-88e6-21104b73e4a1 | AdityaPandey598/code | c++/Mcolour.cpp | #include <bits/stdc++.h>
using namespace std;
void add(vector<vector<int>> &a, int u,int v)
{
a[u].push_back(v);
a[v].push_back(u);
}
void displayMatrix(vector<vector<int>> &mat)
{
int V = mat.size();
for (int i = 0; i < V; i++)
{
for (int j = 0; j < mat[i].size(); j++)
cout <<... | ALGO | 0.999909 | 5.060166 |
91120f26-ca8c-4077-866f-65e1e61849fd | iamrichardwhite/algorithm | usaco-training/cowtour.cpp | /*
ID:selfcon2
LANG:C++
PROG:cowtour
*/
#include <fstream>
#include <iomanip>
#include <cmath>
using namespace std;
ifstream fin("cowtour.in");
ofstream fout("cowtour.out");
struct node{double x,y;};
const double INF=1e20;
node p[155];
static int a[155][155],i,j,k,n;
static double ans=INF,w[155][155],far[155],infarm[15... | ALGO | 0.999048 | 3.567419 |
0d766112-0d51-43f9-9f79-b61dc58069ae | EgorSu/SpotRecognition | mythread.cpp | #include "mythread.h"
MyThread::MyThread() {}
MyThread::~MyThread()
{
}
Mat MyThread::LocalROI (Mat frame, int a, Scalar *MeanScalar)
{
Mat LocalROI;
CvRect LocalROIrect;
LocalROIrect.width = (int) frame.cols/a;
LocalROIrect.height = (int) frame.rows/a;
for(int i = 0; i < a; i++)
{
LocalROIrect.y = i... | TOOL | 0.920888 | 4.967751 |
20ab8202-b579-467d-a680-79e5d2042bb3 | Divyanshu9794/LeetcodePotd | 99-recover-binary-search-tree/recover-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.999997 | 6.120887 |
05c68462-60f8-473b-9da7-65796202f7b8 | Mun-Seong/Algorithm_Cpp | Baekjoon/Brute_force/rebrushing_chessboard.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int N, M;
string board[50];
string WB[8] = {
"WBWBWBWB",
"BWBWBWBW",
"WBWBWBWB",
"BWBWBWBW",
"WBWBWBWB",
"BWBWBWBW",
"WBWBWBWB",
"BWBWBWBW"
};
string BW[8] = {
"BWBWBWB... | ALGO | 0.999969 | 4.518309 |
bfaa2dd2-53c4-46ca-a8c8-645e981a4ff4 | WanderedInteractive/FavAndShop | 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.998809 | 6.763549 |
e33e49e1-7e57-41ae-adf5-d33b96709e9e | puja2196/LLVM-tutorial | libc/src/math/generic/fminimum_numl.cpp | #include "src/math/fminimum_numl.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(long double, fminimum_numl, (long double x, long double y)) {
return fputil::fminimum_num(x, y);
}
} //... | ALGO | 0.997741 | 5.295177 |
26920690-67b3-4e07-a6eb-753a26e585f5 | FelixMorenoPenarrubia/CompetitiveProgramming | entrenos/northeast13/c.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
ll gcd(ll x, ll y) {
if(y == 0) return x;
return gcd(y, x%y);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int T;
cin >> T;
while(T--) {
int n;
cin >> n;
map<ii, ll> sl;
map<pair<ii, ll>, ll> o... | ALGO | 0.999213 | 3.968177 |
161d4d4f-0fb0-4765-8b1e-bd600d693c2d | tempure/algorithm-advance | OJ/atcoder/abc227/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define um unordered_map
#define pq priority_queue
#define sz(x) ((int)(x).size())
#define x first
#define y second
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int... | ALGO | 0.999841 | 3.945683 |
a5055121-6ac2-4fef-b940-f9908ab06dd5 | jinhyo-dev/gbsw_informatics | cash.cpp | #include<iostream>
using namespace std;
int main()
{
int money, price,changes,coin;
cin >> money;
cin >> price;
if (money >= price && money <= 10000)
{
changes = money - price;
if (changes > 500)
{
for (int i = 0; ; i++)
{
changes - 500;
coin ++;
}
}
... | ALGO | 0.998926 | 3.595988 |
eba9e08d-6ecc-4f2a-b131-8e2580fb2abb | neeraj222002/dsa-practice-question | lecture 34/reverse.cpp | #include<iostream>
using namespace std;
string reverse(string str, int i, int j){
// base case
if(i>=j){
return str;
}
swap(str[i],str[j]);
i++;j--;
return reverse(str,i,j);
}
int main(){
string str = "aerba";
string ans =reverse(str,0,str.length()-1);
cout<<ans;
return 0;
} | ALGO | 0.999694 | 4.355222 |
1bf05862-5b53-458d-aedb-11a725e6d8e6 | Killua-22/LeetCode | 0005-longest-palindromic-substring/0005-longest-palindromic-substring.cpp | class Solution {
public:
string longestPalindrome(string s) {
int n = s.size();
vector<vector<bool>> dp(n, vector<bool>(n, false));
int max_len = 0;
int start = 0;
int end = 0;
for(int i=0; i<n; i++) {
dp[i][i] = true;
for(int j=0; j<i; j++) ... | ALGO | 0.999971 | 6.27704 |
b4319de8-2274-4dd6-9658-59c22f54c11d | vishalrathee1/Live-Batch-C-May2023 | 5lec/006ques.cpp | #include<iostream>
using namespace std;
int main(){
int n;
//n numbers will be given in which each number will be appearig twice except one number
cin>>n;
int first;
cin>>first;
//loop
int ct = n-1;
while(ct>0){
//xorring all numbers together
int next;
cin>>next;
first = first^next ;//if i do this ste... | ALGO | 0.999992 | 3.374918 |
05a7ed1d-8011-4e24-a422-359489021775 | kayarre/reconbench | recon/poisson/Src/MarchingCubes.cpp | #include <math.h>
#include "MarchingCubes.h"
////////////
// Square //
////////////
int Square::CornerIndex(const int& x,const int& y){return (y<<1)|x;}
void Square::FactorCornerIndex(const int& idx,int& x,int& y){
x=(idx>>0)%2;
y=(idx>>1)%2;
}
int Square::EdgeIndex(const int& orientation,const int& i){
switch(orie... | ALGO | 0.998853 | 6.181388 |
429c7029-9db2-4912-8299-4b444792a692 | stupidcucumber/calgeo | main.cpp | #include "Matrices.h"
using namespace std;
int main(){
cMatrix m(110,110);
m.randValues(-10, 100);
m.showMatrix();
cout << endl;
ComplexNumber c = m.determinant();
c.showNumber();
} | TOOL | 0.986292 | 4.083407 |
2881fcc3-29da-4436-97a8-fc213834ec61 | Fresh-hongsi/Programmers | Lv.1/키패드 누르기.cpp | #include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
string solution(vector<int> numbers, string hand) {
string answer = "";
int curL = 10; // 왼손 시작점 : *
int curR = 12; // 오른손 시작점 : #
for(int i=0;i<numbers.size();i++){
int cur = numbers... | ALGO | 0.999992 | 6.086812 |
56eb64f5-3846-4f5c-9591-7b8cf6c6ed9c | miiinnn23/Baekjoon | Study/2751/2751.cpp | #include <cstdio>
void merge(int* sorted, int* arr, int begin, int mid, int end);
void mergeSort(int* sorted, int* arr, int begin, int end);
void printArr(int* arr, int n);
int main(void) {
int n;
scanf("%d", &n);
int* arr = new int[n];
int* sorted = new int[n];
for(int i = 0; i < n; i++) {
... | ALGO | 0.999877 | 5.039076 |
2519b0b2-baa0-4073-b2f0-1b931686551d | pitaohc/Algorithm-Diary | LeetCode/LC-213/main.cpp | #include<iostream>
#include"Solution.h"
using namespace std;
void print(vector<vector<int>> vect)
{
for each (vector<int> row in vect)
{
for each (int num in row)
{
cout << num << " ";
}
cout << endl;
}
}
int main()
{
Solution sol;
vector<int> vect;
... | ALGO | 0.999943 | 4.600549 |
9d253845-72a1-493a-bd60-dc9ea62af44e | saranv01/code | 0338-counting-bits/0338-counting-bits.cpp | class Solution {
public:
vector<int> countBits(int n) {
if(n==0) return {0};
vector<int>dp(n+1,0);
dp[1]=1;
for(int i=2;i<=n;i++){
if(i%2==0){
dp[i]=dp[i/2];
}
else{
dp[i]=dp[i-1]+1;
}
}
... | ALGO | 0.999993 | 6.158199 |
b88d811f-22ba-4837-9163-09f068db479e | wangyongalive/PAT | 1013.cpp | //////
////// Created by admin1 on 2018/1/12.
//////1.判断是不是素数
//////2.注意输出格式
//////
//
//#include <string>
//#include<iostream>
//#include <cstdio>
//#include<cmath>
//#include <vector>
//#include <stdlib.h>
//#include <map>
//using namespace std;
//bool isPrime( int num )
//{
// //两个较小数另外处理
// if(num ==2|| num==... | ALGO | 0.999869 | 3.291547 |
9da14ee2-3048-4098-9156-578a3b49fd7a | hrhabib07/cpp_for_data_structure | December 24/day-5/multiMap.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
multimap<string, int>m;
m.emplace("tv",100);
m.emplace("tv",100);
m.emplace("tv",100);
m.emplace("tv",100);
m.erase(m.find("tv"));
for(auto val:m){
cout<<val.first<<" "<<val.second<<endl;
}
return 0;
} | ALGO | 0.968419 | 3.911532 |
576730d5-3fff-4332-833f-e46a82659899 | Esther-Guo/algorithm_notes_and_exercise | chap9/9.7-堆/B.cpp | // http://codeup.cn/problem.php?cid=100000616&pid=1
/*
该算法参考网络,避免了数组过大,非常巧妙
1. 把(a1, bj), j = 1...n加入最小堆中(已有序)
2. 取出最小的那个(ai, bj),把(ai+1, bj)加入堆中
3. 重复步骤2,n次以获取n个最小的和
*/
#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 100010;
struct Node {
int data;
int i, j;
};
int n;
Node he... | ALGO | 0.999964 | 3.398027 |
fb6278b0-0ce9-4c92-a737-f746f01ec4e9 | siddharth25pandey/CPP-Programming | Linked List Algo/Insertion and Deletion in Doubly Linked List.cpp | #include <iostream>
using namespace std;
// structure of Doubly Linked List (DLL)
typedef struct node
{
int data;
struct node *prev;
struct node *next;
} DLL;
// initialising head pointer
DLL *head;
void insert(int val)
{
// Allocating space and storing val top new Node
DLL *newNode = (DLL *)mall... | ALGO | 0.999879 | 5.895125 |
cd4eeffc-7135-487f-b4a2-dd77c985db77 | ishandutta2007/codeforces | mhq/normal/1371/C.cpp | #ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
// freopen("input.txt", "r", stdin);
int tst;
cin >> tst;
while (tst... | ALGO | 0.999446 | 3.799663 |
549ebee1-d24b-4636-93be-be5f00b04578 | C-B-U/algorithm_challenge | 시즌8/중/D4LGONA/0223_9_D4LGONA.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void DFS(vector<vector<int>>& v, vector<bool>& b, int i, int m, int& cnt)
{
if (i == m) return;
if (i != -1 && v[i].size() == 0 || v[i].size() == 1 && v[i][0] == m)
{
cnt++;
return;
}
for (int idx : v[i... | ALGO | 0.99992 | 4.011975 |
7fc7be21-3414-4602-9331-4c9b206af64b | priyanshukoshta5/MOB100-Leetcode-GFG | 0230-kth-smallest-element-in-a-bst/0230-kth-smallest-element-in-a-bst.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.999989 | 6.265506 |
0e0b2d7a-ef69-43ad-b214-5485c5a14c07 | loki-engr/CtrlHair | wrap_codes/wrap_triangle/useful_code/libigl/tests/include/igl/signed_distance.cpp | #include <test_common.h>
#include <igl/signed_distance.h>
TEST_CASE("signed_distance: single_tet", "[igl]")
{
Eigen::MatrixXd V(4,3);
V<<
0,0,0,
1,0,0,
0,1,0,
0,0,1;
Eigen::MatrixXi F(4,3);
F<<
0,1,3,
0,2,1,
0,3,2,
1,2,3;
Eigen::MatrixXd P(1,3);
P<<0.5,0.5,0.5;
for(const i... | TEST | 0.99567 | 7.424608 |
88673c9a-9353-4fff-ad77-7d0ee5fafd13 | CodythFeng/QuantLib | math/optimization/projectedcostfunction.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/math/optimization/projectedcostfunction.hpp>
namespace QuantLib {
ProjectedCostFunction::ProjectedCostFunction(
const CostFunction& costFunction,
const Array& parameterValues,
... | ALGO | 0.922916 | 7.462762 |
c60f24fc-8c0d-4230-b06d-05faa5ceeea7 | novikov-vladimir/teambook | stress-tests/graph/MaximalCliques.cpp | #include "../utilities/template.h"
#include "../../content/graph/MaximalCliques.h"
template<class F>
void fastCliques(vector<B>& eds, F f) {
B R{}, P = ~B(), X{};
vi deg(sz(eds));
rep(i,0,sz(eds)) deg[i] = sz(eds[i]);
rep(j,0,sz(eds)) {
int i = (int)(min_element(all(deg)) - deg.begin());
R[i] = 1;
rec(eds, ... | ALGO | 0.994796 | 5.447414 |
8c94144b-2efb-4aa2-84cf-fbbc99b7bc57 | singi/vbox | src/VBox/HostDrivers/Support/SUPLibSem.cpp | /* $Id: SUPLibSem.cpp $ */
/** @file
* VirtualBox Support Library - Semaphores, ring-3 implementation.
*/
/*********************************************************************************************************************************
* Header Files ... | TOOL | 0.860047 | 7.765905 |
fb6e82aa-295b-4470-892c-47cfb287b617 | PranavReddyP16/CP-Utils | CSES/GraphAlgorithms/round_trip.cpp | #include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
using namespace std::chrono;
#define ll long long
#define ld long double
#define sz(c) ((ll)c.size())
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,t... | ALGO | 0.999987 | 4.742858 |
11d6ec4b-c2a7-4cbc-8427-6ee1a219d6a6 | ups1610/Assignment-Questions-2 | Question_4.cpp | // Question 4
// You have a long flowerbed in which some of the plots are planted, and some are not.
// However, flowers cannot be planted in adjacent plots.
// Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return true if n new flowers can be plant... | ALGO | 0.99996 | 6.053635 |
aea40f46-cc9c-4471-85de-7a829a461fe1 | capstone-engine/llvm-capstone | libc/src/math/gpu/llroundf.cpp | #include "src/math/llroundf.h"
#include "src/__support/common.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(long long, llroundf, (float x)) {
return __builtin_lroundf(x);
}
} // namespace LIBC_NAMESPACE
| ALGO | 0.949562 | 5.120371 |
6c1a6cf7-f818-43f5-9519-8f4b90658682 | sangbpark94/CS211_CPP_Projects | CS211 HW 1-12/HW12.cpp | #include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;
bool check(int q[],int col);
void print(int q[]);
int main(){
int i,j,k,l;
typedef char box[5][7];
box bb,wb,bq,wq,*board[8][8];
//fill in bb=black box and wb=whitebox and fill in bq=blackqueen and wq=whitequeen
for(i=0;i<5;i++)
for( j=0... | ALGO | 0.999356 | 3.080375 |
9e08af81-c71b-4124-86d0-d9a4406e011f | syawacha/AtCoder | ABC/D/D_130.cpp | #include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
int main(){
ll N, K;
cin >> N >> K;
ll a[N];
ll sum[N + 1];
sum[0] = 0... | ALGO | 0.999628 | 3.771183 |
dab47e4f-3e9a-4a73-b271-ab4d87f22694 | wallace-lai/ATC | src/dfs/0889.cpp | #include <set>
#include <map>
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NU... | ALGO | 0.99991 | 5.701159 |
225ba813-399e-47ec-8bd3-af6caee3a9b0 | anushka209/DSALeetCode_Problems | 0890-lemonade-change/0890-lemonade-change.cpp | class Solution {
public:
bool lemonadeChange(vector<int>& bills) {
int five=0,ten=0;
for(int i=0;i<bills.size();i++)
{
if(bills[i]==5)
five++;
if(bills[i]==10)
{
if(five)
{
ten++;
five--;
... | ALGO | 0.999267 | 6.025867 |
b4b74232-1ad7-4852-b297-675dc952f26b | bogdanmacovei/Algorithmics | Tema7/SortareABC/main.cpp | #include <iostream>
typedef struct nod
{
int val;
nod *st, *dr;
}NOD;
NOD *firstNode;
int n;
void inserare(NOD *&r, int arg)
{
if(r)
{
if(r->val == arg)
{
std::cout<<"\nExista deja aceasta cheie\n";
return ;
}
if(r->val > arg)
inser... | ALGO | 0.999974 | 3.974525 |
1be972ed-8393-4aae-86d6-de0db1b915f0 | 0baydullah/ProblemSolving | SpecialContests/Hacker Cup 22 Qualification Round/A - Second Hands.cpp | #include "bits/stdc++.h"
#define endl "\n"
#define pb push_back
#define PI acos(-1)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define ll long long
#define ull unsigned long long
using namespace std;
void miryoku()
{
int n, k,x; cin >> n >> k;
map<int,int>m;
for(int i=0 ; i<n ;i++){
... | ALGO | 0.999674 | 4.414239 |
f420c313-1a86-4445-b17d-bce61f718cae | BasharHazbar/Proplem-Solving-and-Practise-Programmig | is identity matrices/is identity matrices/is identity matrices.cpp | #include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int RandomNumber(int From, int To) {
//Function to generate a random number
int randNum = rand() % (To - From + 1) + From;
return randNum;
}
void fillMatrixWithRandomNumber(int arr[3][3], short rows, short cols) {
for (short i = 0; i ... | ALGO | 0.99031 | 3.539981 |
cac52007-e5bc-44eb-a852-9c6c67199e27 | GOOTEAKIM/algo | C++/programers_basic/programers_basic/p_181896.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
return 0;
}
int solution(vector<int> num_list) {
int answer = -1;
for (int i = 0; i < num_list.size(); i++) {
if (num_list[i]< 0) {
answer = i;
break;
}
}
return answer;
} | ALGO | 0.999669 | 5.048948 |
a0f4263d-1e68-4352-bc32-2a17165e65ad | CoderXshuai/leetcode | Temp/leetcode/editor/cn/354-russian-doll-envelopes.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
public:
static bool compare(vector<int> &a, vector<int> &b) {
if (a[0] == b[0])
return a[1] < b[1];
retu... | ALGO | 0.999994 | 6.006376 |
c22037b1-afde-4f23-905a-86a9178377bd | azat-archive/qtcreator | src/plugins/valgrind/callgrind/callgrindcycledetection.cpp | #include "callgrindcycledetection.h"
#include "callgrindfunction.h"
#include "callgrindfunctioncall.h"
#include "callgrindparsedata.h"
#include "callgrindfunctioncycle.h"
#include <utils/qtcassert.h>
#include <QDebug>
namespace Valgrind {
namespace Callgrind {
namespace Internal {
CycleDetection::CycleDetection(Pa... | TOOL | 0.877598 | 6.312605 |
cde9d182-c7cb-495b-ba2a-6ce8a4ea7af6 | dubeyayushi/Competitive-Programming | Strivers A2Z DSA Sheet/Step-7: Recursion/Lec-3: Trying Out All Combos/06_m_coloring_problem.cpp | // https://www.geeksforgeeks.org/problems/m-coloring-problem-1587115620/1
class Solution{
public:
bool isSafe(int node, int color[], bool graph[101][101], int n, int col){
for (int k = 0; k<n; k++){
if (k!=node && graph[k][node]==1 && color[k]==col){
return false;
... | ALGO | 0.999868 | 6.016873 |
21d3f9ba-e587-4772-b093-78f8a0d1f1c8 | Farnob/CODE | morning_jogging.cpp | #include<bits/stdc++.h>
using namespace std;
void print_(int a) {cerr << a;}
void print_(long long a) {cerr << a;}
void print_(char a) {cerr << a;}
void print_(string a) {cerr << a;}
void print_(bool a) {cerr << a;}
void print_(double a) {cerr << a;}
void print_(long double a) {cerr << a;}
void print_(unsigned long lo... | ALGO | 0.999981 | 3.305003 |
23da1370-91c2-4d95-ae2e-021e5651f305 | clockzhong/WrapLAMP | Boost/libs/geometry/example/05_a_overlay_polygon_example.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <boost/foreach.hpp>
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geome... | ALGO | 0.981144 | 6.777542 |
bb6aaed6-7da7-4407-b049-36662f6a75f5 | Fang0105/APCSpractice | uva/uva-10684.cpp | #include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
int max(int a,int b){
return a>b?a:b;
}
signed main(){
ios::sync_with_stdio(0);cin.tie(0);
int n;
while(cin>>n&&n){
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int dp[n];... | ALGO | 0.999853 | 3.741078 |
776ff7d7-c6a7-46a7-a6f1-e91c821c53ab | uNbAs/Marlin | Marlin-2.0.9.7/Marlin/src/gcode/probe/G38.cpp | #include "../../inc/MarlinConfig.h"
#if ENABLED(G38_PROBE_TARGET)
#include "../gcode.h"
#include "../../module/endstops.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#include "../../module/probe.h"
inline void G38_single_probe(const uint8_t move_value) {
endstops.enable(true);
G38_move =... | ALGO | 0.954425 | 7.669985 |
c9c0f699-1abe-4ace-9fae-674f2d066ff3 | unlimitedshaver/TopoEx | src/torchPHext/torchex_PHext/pershom/pershom_cpp_src/data_structure/lazy_propagation_red_black_tree.range_affine_range_sum.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/range_affine_range_sum"
#include "../data_structure/lazy_propagation_red_black_tree.hpp"
#include "../monoids/plus_count.hpp"
#include "../monoids/linear_function.hpp"
#include "../monoids/linear_function_plus_count_action.hpp"
#include "../modulus/mint.hpp"
#include "..... | ALGO | 0.999435 | 5.739116 |
c6e782e0-4f67-4b5b-b657-4270b576d68d | CuongDo203/DSA | heCoSoK.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int k; string a, b;
cin >> k >> a >> b;
while (a.length() < b.length()) {
a = "0" + a;
}
while (b.length() < a.length()) {
b = "0" + b;
}
string s = ""; int nho = 0;
for (int i = a.length() - 1; i >= 0; --i) {
... | ALGO | 0.999901 | 4.646392 |
21bd319d-3db8-472b-888b-5e7e0624e823 | Amna903/coding. | lab3/fer.cpp | #include <iostream>
using namespace std;
main ()
{
float p, c, a, fp, fs;
cout<< "Enter the size of the fertilizer bag in pounds: ";
cin>> p;
cout<<"Enter the cost of the bag: $";
cin>>c;
cout<<"Enter the area in square feet that can be covered by the bag: ";
cin>>a;
fp=c/p;
cout<< "Cost of fertilizer per poun... | ALGO | 0.978488 | 3.901527 |
a576ab02-068b-4df8-97bf-f3f01b5d7e58 | stevebak4/Project-2-Time-Series-Search-and-Clustering-using-K-means-LSH-Hypercube-Projection-and-Frechet | implementation/btree_node.cpp | #include "btree_node.h"
btree_node *btree_create_node(btree_node *node){
node = new btree_node;
node->left = NULL;
node->right = NULL;
return node;
}
btree_node *btree_create_and_fill(btree_node *root,int height,int current_height,int i,int data_dimension,vector<Info_node> cluster){ //current heig... | ALGO | 0.997156 | 3.438076 |
caae13a0-2569-4e7b-af7c-5f17f2b7e82d | jeyssson4k/ProgCPP-NumMethods-Comp-HPC | Comp-HPC/Tareas/tarea1/diferencias_numericas.cpp | #include <iostream>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <cstdio>
float f(int k);
float S1(int N);
float S2(int N);
int main(){
int N = 2'500'000;
const std::string output = "out.txt";
std::ofstream outputFile(output);
outputFile << std::fixed << std::setprecision(16);
... | ALGO | 0.98073 | 3.433716 |
2176fb63-72c4-4704-9d92-5010f306670c | Skywt2003/codes | Temp/Duipai/std.cpp | // POJ 3715
#include <cstdio>
#include <cstring>
#include <vector>
const int MAXN = 205;
int N, M, T, col[MAXN];
namespace FastIO {
template <typename T>
void read(T & x) {
x = 0; register char ch = getchar();
for (; ch < '0' || ch > '9'; ch = getchar());
for (; ch >= '0' && ch <= '9'; x = (x << 3) + (x << 1)... | ALGO | 0.99997 | 4.269108 |
ddf6d95b-7a8e-466f-858b-9ff247c5ed27 | zxf-work/GraphProfile | boost_1_63_0/libs/type_traits/examples/copy_example.cpp | #include <iostream>
#include <typeinfo>
#include <algorithm>
#include <iterator>
#include <memory>
#include <boost/test/included/prg_exec_monitor.hpp>
#include <boost/timer.hpp>
#include <boost/type_traits.hpp>
using std::cout;
using std::endl;
using std::cin;
namespace opt{
//
// opt::copy
// same semantics as std... | ALGO | 0.942689 | 5.917429 |
110ddeb5-a1a7-479f-b1ea-b17e982c5181 | alphaninja27/-CrackYourInternship | Binary Trees/Merge Two Binary Trees.cpp | class Solution {
public:
TreeNode* mergeTrees(TreeNode* root1, TreeNode* root2) {
if(!root1){
return root2;
}
if(!root2){
return root1;
}
root1->val += root2->val;
root1->left = mergeTrees(root1->left, root2->left);
root1->right = merge... | ALGO | 0.999995 | 6.242187 |
9d80b2fb-a36f-4e23-892d-a48c688e52f4 | xide-projext/simple_ui_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.998799 | 6.776823 |
aefcc9fa-0a77-4253-91ce-c6d31c4fcbed | jinyang-ang/geom-compiler | geom_compiler/dependencies/eigen-master/unsupported/doc/examples/MatrixPower.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
Matrix3d A;
A << cos(1), -sin(1), 0,
sin(1), cos(1), 0,
0 , 0 , 1;
std::cout << "The matrix A is:\n" << A << "\n\n"
"The matrix power A^(pi/4) is:\n"... | ALGO | 0.9999 | 3.787745 |
d4ccd636-ba97-440f-89d1-b85f4c5eb461 | Psycojoker/seeks | src/lsh/LSHSystemHamming.cpp | #include "LSHSystemHamming.h"
#include "Random.h"
#include <iostream>
#include <stdlib.h>
#include <limits.h>
#include <assert.h>
namespace lsh
{
LSHSystemHamming::LSHSystemHamming(const unsigned int &k, const unsigned int &L)
:LSHSystem(k,L),_g(NULL),_controlHash(NULL),_mainHash(NULL),_initialized(false)
{... | ALGO | 0.993627 | 5.417032 |
38bc4b39-e5e9-4925-9ded-20ba0d064542 | Shahraaz/CP_S5 | codeforces/practice/DIV1_526E.cpp | //Optimise
#include <bits/stdc++.h>
using namespace std;
// #define multitest 1
#ifdef WIN32
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
#define pc(...) PC(#__VA_ARGS__, __VA_ARGS__);
template <typename T, typename U>
ostream &operator<<(ostream &out, const pair<T, U> &p)
{
out << '[' << p.first << ", " << p.secon... | ALGO | 0.999847 | 4.714855 |
279b5c7b-83c5-4ba8-88a8-e9450204ce6d | gafeol/competitive-programming | Contests/Winter17/w1/3/br17furniture.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(st... | ALGO | 0.999473 | 3.663745 |
5c8d52f9-a0e2-4d9a-a942-091d195d3b72 | GoatGirl98/Walkthrough-of-ACCoding-in-BUAA | 2015级-软件学院-算法分析与设计/C6-2015级算法第六次上机/BUAAOJ619 FFT 前缀和 计算补集.cpp | #include <stdio.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <algorithm>
using namespace std;
typedef long long ll;
// fast input
char buf[1 << 21], *p1 = buf, *p2 = buf;
inline char nc() { return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++; }
int rd()
... | ALGO | 0.99949 | 3.997945 |
0d07395a-5064-4850-8548-e8dc1d703aca | dam900/Parallel_and_Distributed_programming | lista2/neh_solver/src/main.cpp | #include <mpi.h>
#include <omp.h>
#include <fstream>
#include <iostream>
#include <vector>
#include "neh_data_reader.hpp"
#include "rng.hpp"
#include "simulated_annealing_solver.hpp"
typedef std::vector<int> solution_t;
int main(int argc, char** argv) {
MPI_Init(&argc, &argv);
int rank;
MPI_Comm_rank(MP... | ALGO | 0.999944 | 4.035198 |
7c3e053d-be4e-4815-be49-f9658713b91c | archie94/Codes | SPOJ/BWIDOW-BlackWidowRings.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int t;
cin>>t;
while(t--) {
long long n;
cin>>n;
long long r[n],R[n];
for(int i=0;i<n;i++) cin>>r[i]>>R[i];
long long maxr=r[0],rpos=0;
for(int i=1;i<n;i++) {
if(maxr<r... | ALGO | 0.999903 | 3.687453 |
7da7887f-72df-43be-90b0-8d650f2a7097 | nguyenhoang4875/CompetitiveProgramming | itv/B_Discounts.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(a) (int)(a).size()
#define el '\n'
#define F first
#define S second
#define For(i, a, b) for (int i = a; i <= (int)b; i++)
#define Ford(i, a, b) for (int i = a; i >= (int)b; i--)
#defi... | ALGO | 0.999823 | 3.92932 |
dc43ada0-5ca0-461c-8b16-72abdb9f96bc | ishandutta2007/codeforces | hujiwara/normal/759/D.cpp | #include <bits/stdc++.h>
using namespace std;
const long long mod=1000000007ll;
void ad(long long &a,long long b){a+=b;a%=mod;}
void mn(long long &a,long long b){a+=mod-b;a%=mod;}
void ml(long long &a,long long b){a*=b;a%=mod;}
long long sq(long long a){return a*a%mod;}
long long pw(long long a,long long n)
{
return ... | ALGO | 0.999994 | 3.979781 |
e1af025f-63bb-4169-ba2f-74808ecbb369 | ayanisation/DSA-practice-questions | Binary_Tree/p26_populateWithInorderSuccessor.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
struct Node *next;
Node(int x)
{
data = x;
left = NULL;
right = NULL;
next = NULL;
}
};
void printInorder(Node *node)
{
if (node == NULL)
{
... | ALGO | 0.99994 | 5.483858 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.