uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
53b05436-425a-4443-b1eb-28f1ba0e5889 | Rtk10000/DIAS-Summer-Internship | C++/D2-Branes/eigen/doc/examples/Tutorial_ArrayClass_interop.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = (m.array() + 4).matrix() * m;
cout << "-- Combination 1: --" << endl << result << endl << e... | ALGO | 0.99949 | 4.531452 |
d92b6e14-f902-4c91-84b4-bbdf6645d31d | clay-arras/cp-practice | usaco/gold/skicourserating.cpp | #include "bits/stdc++.h"
using namespace std;
#ifdef LOCAL
#include "algo/debug.h"
#define open(x) freopen(x, "r", stdin);
#else
#define open(x)
#endif
struct Edge{ long long u, v, w; };
bool operator<(const Edge& x, const Edge& y) { return x.w < y.w; }
// Vim capital p
vector<long long> h;
vector<long long> stp;
l... | ALGO | 0.999943 | 3.875309 |
b844880f-4e0b-447a-8957-6435556c3805 | prasad647/ds | DS LAB JOURNALS/EXPT6/6a/EXPT6a.cpp | #include <iostream>
using namespace std;
class BST
{
int data;
BST *left, *right;
public:
// Default constructor.
BST();
// Parameterized constructor.
BST(int);
// Insert function.
BST* Insert(BST *, int);
// Inorder traversal.
void Inorder(BST *);
};
// Default Constr... | ALGO | 0.999979 | 6.142689 |
0c7268f9-e96f-4282-8b47-9ef47ee4e402 | piyush121728/leetcode-potd2024 | Feb/1.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<vector<int>> divideArray(vector<int> &nums, int k)
{
sort(nums.begin(), nums.end());
if (nums.size() % 3 != 0)
{
return {};
}
vector<vector<int>> ans;
for (int i = 0; i < ... | ALGO | 0.999929 | 5.897971 |
56faa634-57ee-44c1-8a20-73e8ce5c8ca0 | vaughn-k/Algorithm | disjointSet/PPP_bj1717.cpp | /*
๋ฐฑ์ค 1717๋ฒ - ์งํฉ์ ํํ
์๊ณ ๋ฆฌ์ฆ : ์ํธ ๋ฐฐํ์ ์งํฉ
๋ฌธ์ ๊ฐ์ : ๊ฐ ์์๋ค์ ํฉ์งํฉ ์ฐ์ฐ๋ค์ด ์ฃผ์ด์ง๊ณ ๋์์๋ฅผ ์ฃผ์์๋ ๋์ด ๊ฐ์ ์งํฉ์ธ์ง ์๋์ง ํ๋ณ
+ ์๊ฐ์ด๊ณผ
ios_base::sync_with_stdio(false);
cin.tie(NULL);
๋ก ํด๊ฒฐํ๊ธฐ
*/
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int n,m;
vector<int> v;
queue<int> q;
int findRoot(int k){
q... | ALGO | 0.999971 | 5.288476 |
cc9d6ed6-2701-4bc6-a889-9713db715aca | ValeriiKoniushenko/VaKon2D | dependencies/boost_1_80_0/libs/math/example/normal_misc_examples.cpp | // normal_misc_examples.cpp
// Example of using normal distribution.
// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//[normal_basic1
/*`
First we need some includes to access the normal distribution
(and some std output of course).... | ALGO | 0.997528 | 5.079186 |
53d9ad17-3313-4fd4-b11e-3547242ec356 | Yrds/2048im | src/2048im.cpp | #include "raylib.h"
#ifdef __EMSCRIPTEN__
#include "emscripten.h"
#endif
#include <array>
#include <iostream>
#include <string>
#include <vector>
constexpr auto gridSize = 4;
constexpr auto cellSize = 50;
constexpr Vector2 gridPosition = {10, 45};
constexpr Vector2 windowSize = {20 + gridSize * cellSize, 250};
auto... | ALGO | 0.927084 | 6.035849 |
9ac494d8-d06d-44ea-b9d5-2bb43e8991c2 | Manash04/DataStructue-And-Algorithms | 0035-search-insert-position/0035-search-insert-position.cpp | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int low = 0, high = nums.size() - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
if (nums[mid] == target)
return mid;
else if (nums[mid] > target) {
... | ALGO | 0.999961 | 6.602743 |
7de1da8a-5a99-4985-bb11-08839478a616 | lkoiescg2031/APSS | Baekjoon Online Judge/14002.cpp | #include <cstdio>
#include <stack>
using namespace std;
#define MAX 1000
int n,a[MAX+1], d[MAX+1], pre[MAX+1];
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
pre[i] = i;
}
for (int i = 1; i <= n; i++)
for (int j = 0; j < i; j++)
if (a[j] < a[i] && d[i] < d[j] + 1)
... | ALGO | 0.999974 | 3.325047 |
8ad51662-1f53-4ac1-ae58-d72c8f968c73 | OscarOu0421/leetcode | 433.cpp | // Time: O(8n), n is the bank size
// Space: O(2n)
class Solution {
public:
void mutation(queue<string> &queue, unordered_set<string> &set, string &str, int i, char c) {
str[i] = c;
if (set.count(str))
queue.push(str);
}
int minMutation(string startGene, string endGene, vector<st... | ALGO | 0.999817 | 5.136411 |
491cc514-0459-4d1e-95eb-5accc1f5d90b | raincross7/code-similarity | codes/train_code/problem140/problem140_25.cpp | #include <iostream>
#include<string>
#include<cmath>
#include<ciso646>
#include<cstring>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
using ll = long long;
int M = 10000001;
int main()
{
int n, m;
c... | ALGO | 0.999977 | 3.628658 |
3c797ca7-c111-4548-be26-67371fe83e3c | omanias/Teclab | api2/ejercicio2.cpp |
#include <iostream>
using namespace std;
int main()
{
char continuar;
do
{
double a, b, c;
cout << "Ingrese la medida del lado a: ";
cin >> a;
cout << "Ingrese la medida del lado b: ";
cin >> b;
cout << "Ingrese la medida del lado c: ";
cin >> c;
... | ALGO | 0.993804 | 3.861985 |
94fdd4c2-a71a-473f-ad97-b9bbe1531d0c | luckyyd/Geeks | Compute modulus division by a powerof2number.cpp | #include<stdio.h>
/* This function will return n % d.
d must be one of: 1, 2, 4, 8, 16, 32, โฆ */
unsigned int getModulo(unsigned int n, unsigned int d)
{
return (n & (d-1));
}
/* Driver program to test above function */
int main()
{
unsigned int n = 6;
unsigned int d = 4; /*d must be a power of 2*/
printf("%u moduo... | ALGO | 0.999357 | 4.211223 |
0a062cc4-d1e5-4479-b6b7-8c77685c886e | sikuner/book-code | Exploring C++ 11/chapter13/list1303.cpp | // Listing 13-3. Local Variable Definitions in a Nested Block
#include <algorithm>
#include <cassert>
#include <iostream>
#include <iterator>
#include <string>
#include <vector>
int main()
{
std::vector<int> data{};
data.insert(data.begin(), std::istream_iterator<int>(std::cin),
std::is... | TOOL | 0.987069 | 4.077453 |
ad6f27f5-aef2-454a-a583-3c57a5ee05a4 | NikitaUssyukin/PP1_2024_Spring | Practice/G2/Week9/secret_2.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
getline(cin, s);
for(int i = 0; i < s.size(); i++) {
if(isalpha(s[i])) {
if(s[i] == 'Z' || s[i] == 'z') {
s[i] -= 25;
} else {
s[i] += 1;
}
... | TOOL | 0.970942 | 5.174441 |
79ad585f-39ef-45dc-a829-412bcceed721 | GustavoHenriqueGB/Competitive-Programming | PapaiNoel.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
int x, n, maior_pilha, aux;
char c;
stack<pii> saco;
cin >> n;
for(int i = 0; i < n; i++){
cin >> c >> x;
if(c == 'A'){
if(saco.empty())
maior_pilha = x;
else{
tie... | ALGO | 0.999357 | 4.397383 |
c392ad34-a060-4556-85b0-be5bf19843fb | PRANAVJARANDE/Leetcode-Solutions | medium/Maximum XOR of Two Numbers in an Array.cpp | class Solution {
public:
class node
{
public:
bool endd;
node* next[2];
node()
{
endd=0;
for(int i=0;i<2;i++)
{
next[i]=NULL;
}
}
};
node* trie;
void insertt(int n)
{
... | ALGO | 0.999956 | 5.596564 |
c9705949-4fca-44af-9b10-cf8c2de7ac0d | wususu/codingpower | oj_code/11079.cpp | #include <iostream>
#include <algorithm>
#include <limits.h>
using namespace std;
bool cmp(int a, int b)
{
return a>b;
}
bool cmp_n(int a, int b)
{
return a<b;
}
int main()
{
int n, k, m, x=0, y=0, max=0, min=0;
cin>>n;
cin>>k;
int a[n], a2[n+k];
int b[n], c[n];
for(int i=0; i<n; ... | ALGO | 0.999989 | 3.596319 |
e036990b-ff0e-4eba-bb9d-c60ab8031943 | BaoVStorm/CTDL-GT | phong hop4.cpp | #include<iostream>
#include<fstream>
using namespace std;
int n,A[100000],B[100000];
void doc()
{
ifstream ff("abc.inp");
ff>>n;
for(int i=1;i<=n;i++)
{
ff>>A[i]>>B[i];
}
ff.close();
}
void QS(int d, int c)
{
int i=d,j=c,x=B[(d+c)/2];
while(i<=j)
{
while(B[i]<x) i++;
while(B[j]>x) j--;
if(i<=j)
{
... | ALGO | 0.999971 | 3.599952 |
1f9d19fa-dadc-4f51-a21f-975337948f60 | Abhijayshah/LeetCode-Practice | 0450-delete-node-in-a-bst/0450-delete-node-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.999988 | 7.166913 |
de285762-8f9c-4fee-bcb3-1f4aa6d5c480 | sarat-ravi/old-intersect | intersect/util/eigenCppLibrary/eigenRelease/doc/snippets/compile_Tridiagonalization_decomposeInPlace.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(int, char**)
{
cout.precision(3);
MatrixXd X = MatrixXd::Random(5,5);
MatrixXd A = X + X.transpose();
cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl;
VectorXd diag(5);
VectorXd subdiag(4... | ALGO | 0.998367 | 3.88701 |
254aa026-fd20-402d-979c-8fdd0088b036 | deepakvit007/LeetCode | 152-maximum-product-subarray/maximum-product-subarray.cpp | class Solution {
public:
int maxProduct(vector<int>& nums) {
int n = nums.size();
int ans = INT_MIN;
int prefix = 1;
int suffix = 1;
for(int i=0;i<n;i++)
{
if(prefix == 0)
{
prefix = 1;
}
if(suffix == 0)
... | ALGO | 0.99999 | 5.746704 |
77b97676-17ea-4e07-b03d-af5ac00cae08 | tanvieer/ProblemSolving | imprtnt codes/stack.cpp | #include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <stack>
#include <string.h>
using namespace std;
int main()
{
stack<int> s;
int x;
while(cin>>x)
{
s.push(x);
cout<<"top = "<<s.top()<<endl;
//cout<<s.pop()<<endl;
s.pop();
}
printf("Answer is %d\n", s.top());
return 0;
... | ALGO | 0.999056 | 3.59895 |
cb348fd5-39f3-4fcd-a069-734e5a497a29 | ishandutta2007/codeforces | sun_xiao_chuan/normal/1547/G.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn = 400500, maxm = 400500;
int x[maxm], y[maxm];
int mark[maxn],st[maxn],n,m,t,ans,cnt,f[400500],num[400500],f2[400500],num2[400500];
bool vis[10050000];
vector<int> lv[maxn],rv[maxn],clr,v[maxn];
void dfs1(int x){
vis[x]=1;
for(auto i:lv[x]){
if(i==x){f2[x... | ALGO | 0.999922 | 4.00825 |
067b856d-3508-496f-8e31-8616c4c829a4 | PranjalAgni/210DaysLeetCode | day-34.cpp | /*
Number Complement
Solution
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.
Example 1:
Input: 5
Output: 2
Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. So you need to output 2.
... | ALGO | 0.999986 | 6.416073 |
48466ab6-34f1-4262-9dc0-a08d7941569c | ryosuzuki/kinect-drawing | engine/include/igl/null.cpp | template <typename DerivedA, typename DerivedN>
IGL_INLINE void igl::null(
const Eigen::PlainObjectBase<DerivedA> & A,
Eigen::PlainObjectBase<DerivedN> & N)
{
using namespace Eigen;
typedef typename DerivedA::Scalar Scalar;
JacobiSVD<MatrixXd> svd(A, ComputeFullV);
svd.setThreshold(A.cols() * svd.singularVa... | ALGO | 0.99668 | 3.441766 |
7c158d64-1625-47cc-8215-5fc8f51180a1 | MrWhitezz/Coding-during-Learning | C++/ProblemSolving/Term 2/Week 6/B/test.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
multiset<int> Q;
int n;
string s;
cin >> n;
getchar();
for (int i = 0; i < n; ++i){
getline(cin, s);
if (s[0] == '+') Q.insert(stoi(s));
else if (s[0] == '-'){
if (!Q.empty()) Q.erase(Q.begin());
... | ALGO | 0.999888 | 4.329257 |
dc26d88b-7436-400c-a542-103cbeaceeb4 | Shmona/Leetcode | Array/Leetcode_35_search_insert_position.cpp | /*
Given a sorted array of distinct integers and a target value, return the index if the target is found.
If not, return the index where it would be if it were inserted in order.
You must write an algorithm with O(log n) runtime complexity.
Example 1:
Input: nums = [1,3,5,6], target = 5
Output: 2
Example 2:
Input: ... | ALGO | 0.999987 | 6.580607 |
04890f63-ac50-4506-b3ba-20c377de3afa | noah-glassford/Child_Of_Time | Klock_Trials_Of_time/Klock_Trials_Of_time/include/Box2D/Collision/b2TimeOfImpact.cpp | #include "Box2D/Collision/b2Collision.h"
#include "Box2D/Collision/b2Distance.h"
#include "Box2D/Collision/b2TimeOfImpact.h"
#include "Box2D/Collision/Shapes/b2CircleShape.h"
#include "Box2D/Collision/Shapes/b2PolygonShape.h"
#include "Box2D/Common/b2Timer.h"
#include <stdio.h>
float32 b2_toiTime, b2_toiMaxTime;
int3... | ALGO | 0.999839 | 6.510186 |
9015c1b5-08b2-4ad8-9159-940acae502e5 | RebeccaPhu/NUTS | NUTS/AboutBox.cpp | #include "stdafx.h"
#include "AboutBox.h"
#include "resource.h"
#include "PluginDescriptor.h"
#include "Plugins.h"
#include "NUTSMacros.h"
#include <commctrl.h>
#include <Richedit.h>
#include <WindowsX.h>
#include <ShellAPI.h>
#include <vector>
HWND pCurrentTab = nullptr;
INT_PTR CALLBACK CreditsDlgFunc(HWND hDlg... | TOOL | 0.861421 | 3.411158 |
b85cd750-b3ad-457b-b40b-a46876153129 | DanDanCool/seer | lib/opencv/samples/cpp/videocapture_gphoto2_autofocus.cpp | #include <cstdlib>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;
const char * windowOriginal = "Captured preview";
const int FOCUS_STEP = 1024;
const int MAX_FOCUS_STEP = 327... | TOOL | 0.989467 | 5.910912 |
69db7288-5eaf-4e38-a03d-149c811ce122 | priyanshukoshta5/MOB100-Leetcode-GFG | 0445-add-two-numbers-ii/0445-add-two-numbers-ii.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* addTwoNumbe... | ALGO | 0.999948 | 6.337939 |
d1025024-02d7-420f-9195-15d87ec6ec7c | ishandutta2007/codeforces | rivalq/normal/6/A.cpp | //https://codeforces.com/contest/6/problem/A
#include<bits/stdc++.h>
#define rep1(i,n,a) for(int i=0;i<n;i+=a)
#define rep2(i,n,a) for(int i=a;i<n;i++)
#define rep3(n) for(int i=0;i<n;i++)
#define inarr(arr,n) rep1(i,n,1)cin>>arr[i]
#define ll long long int
#define pb push_back
#d... | ALGO | 0.999812 | 4.464874 |
03fb905b-b40b-48ec-b616-64bc2a1cf622 | Himanshu07-debug/Competitive-Programming | 04-Number Theory/Problems/Problem-09.cpp | // Gvien an Psoitive integer n , it can consists of atmost 100 digits and no leading zeroes.
// Determine is it possible to remove some of the digits(possibly not remove any digit at all) so that the result contains atleast one digit,
// no leading zeroes and is divisible by 8
// 3454 ---> Yes 344
// 10 ----> Yes 0... | ALGO | 0.999294 | 5.646496 |
36b36ac5-d4c1-4f06-9c44-613381fdeb85 | abhinine4/cpp_long | gcd.cpp | #include <iostream>
int main(){
int a = 200;
int b = 100;
int gcd;
for (int i = 1; i <= ((a<b) ? b : a); i++){
if (a%i==0 && b%i==0){
gcd = i;
}
}
std::cout << "The GCD of " << a << " and " << b << " is " << gcd << std::endl;
return 0;
} | ALGO | 0.976277 | 4.765932 |
ab8dbefd-e575-485f-b099-cdb417126141 | SagoRohit/Daily-Leetcode | String/leetcode-1528.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
string restoreString(string s, vector<int>& indices) {
string t = s;
for(int i=0; i<indices.size(); i++){
s[indices[i]]=t[i];
}
return s;
}
}; | ALGO | 0.999408 | 5.73356 |
bd4ec88d-4bee-47f4-9c91-bf121728e29a | KEPCKUK/SEM_1_24 | Project7/Source.cpp | #include <iostream>
#include <time.h>
#include <math.h>
using namespace std;
void init(int* a, int u) {
for (int i = 0; i < u; i++) {
*(a + i) = rand() % 100;
}
}
void display(int* a, int u) {
for (int i = 0; i < u; i++) {
cout << *(a + i) << ' ';
}
}
void filtr(int* a, int u) {
int k{ 0 };
int t{ 0 };
cout ... | ALGO | 0.996237 | 3.742512 |
eee6276e-eb71-4175-9e78-07024e1d3652 | harvin20/retoapp | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
ef92f5a0-037f-4f71-9f03-43e742b821ec | gangwargajendra/cpp-python-WebDev-basics | CPP Basics(APNA COLLEGE)/19printArrayRecursion.cpp | #include<iostream>
using namespace std;
void printArray(int *arr , int st , int end){
if(st == end + 1){
return ;
}
cout << arr[st] << " ";
printArray(arr, st+1 , end);
}
int factorial(int n){
if(n == 0 || n == 1){
return 1;
}
return n * factorial(n-1);
}
void printNumberD... | ALGO | 0.999369 | 5.015178 |
da41f339-c704-4bf6-b59f-9843f7d7dbe9 | iamtasir/Competitive-programming | 2022/March/B_Subtract_Operation.cpp | ///* ***Bismillahir Rahmanir Rahim*** */
/*
Algorithm Used:
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double dl;
typedef unsigned long long ull;
#define pb push_back
#define eb emplace_back
#define PB pop_back
#define nn "\n"
#define O_O \
i... | ALGO | 0.999949 | 4.010116 |
9421f054-02c5-42ad-9a04-154cc3d8e799 | ompatel22/LeetCode | 0145-binary-tree-postorder-traversal/0145-binary-tree-postorder-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999906 | 6.009513 |
3743436e-6328-48c8-9fa9-28b2984a08e4 | mfiazansari/Data-Structure | queue-new.cpp | #include <stdio.h>
#include <stdlib.h>
struct node
{
int info;
struct node *ptr;
}*front,*rear,*temp,*front1;
int frontelement();
void enq(int data);
void deq();
void empty();
void display();
void create();
void queuesize();
int count = 0;
main()
{
int no, ch, e;
printf("\n 1 - Enque");
p... | ALGO | 0.999696 | 3.764809 |
b8f8cae2-d12b-4904-8ff2-ea0a6152753d | wisdompeak/LeetCode | Priority_Queue/630.Course-Schedule-III/630.Course-Schedule-III.cpp | class Solution {
static bool cmp(vector<int>&a, vector<int>&b)
{
return a[1]<b[1];
}
public:
int scheduleCourse(vector<vector<int>>& courses)
{
sort(courses.begin(),courses.end(),cmp);
priority_queue<int>pq;
int cur = 0;
for (int i=0; i<courses.size(... | ALGO | 0.99985 | 6.094974 |
d88f9cc7-d744-4347-980c-5c0e8ea7e2ca | mohitsinha04/Leetcode-Solving-Experience | 16-3sum-closest/3sum-closest.cpp | class Solution {
public:
int threeSumClosest(vector<int>& nums, int target) {
int res = INT_MAX;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size() && res != 0; i++) {
int left = i + 1;
int right = nums.size() - 1;
while (left < right) {
... | ALGO | 0.999995 | 6.32362 |
d2b665a4-0bf0-4c0e-b1f7-f2d1ecf5771e | DhanushBobby/DSA_Assignment | 6.cpp | #include <iostream>
using namespace std;
void findTwoOdd(int arr[], int n) {
int xor_all = 0, xor_odd = 0, set_bit;
for(int i = 0; i < n; i++) {
xor_all = xor_all ^ arr[i];
}
set_bit = xor_all & ~(xor_all - 1); // Get the rightmost set bit
// Divide the elements into two groups - one w... | ALGO | 0.999927 | 5.043216 |
ae99e165-84e1-4d13-bb85-da8eb2622ed0 | wgsylcl/OI-Template | docs/DS/code/P5787.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int MAXN = 1e5 + 10, MAXV = MAXN << 2, MAXM = 2e5 + 10;
#define mid (((l) + (r)) >> 1)
#define ls ((x) << 1)
#define rs ((x) << 1 | 1)
struct edge
{
int u, v;
} e[MAXM];
// fy -> fx
struct node
{
int fx, fy;
bool added;
};
vecto... | ALGO | 0.999997 | 3.692831 |
adc16cb6-bc36-422d-ac52-668d9a6a8438 | spsingh37/DROID_SAM2 | thirdparty/DROID-SLAM/thirdparty/eigen/doc/snippets/LLT_example.cpp | MatrixXd A(3, 3);
A << 4, -1, 2, -1, 6, 0, 2, 0, 5;
cout << "The matrix A is" << endl << A << endl;
LLT<MatrixXd> lltOfA(A); // compute the Cholesky decomposition of A
MatrixXd L = lltOfA.matrixL(); // retrieve factor L in the decomposition
// The previous two lines can also be written as "L = A.llt().matrixL... | ALGO | 0.999772 | 3.049891 |
b2406658-f3d1-442f-a3b3-bb5dfebc5e5c | LonglongSang/Life_of_XDU | PTA/advanced_level/1034.cpp | #include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
unordered_map<string,unordered_map<string,int> > dp;
unordered_map<string,int> boss;
unordered_map<string,bool> visited;
string my_boss;
void dfs(string name,int &gang_count,int &gang_max,int &calling_time,string &my_b... | ALGO | 0.999875 | 3.41479 |
43835cd5-1301-419b-9433-8d6a95495c47 | jdw1042710/AlgorithmStudy | 1799.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int N;
const int INF = 101;
vector<vector<int>> graph;
vector<bool> diagonals;
vector<bool> invDiagonals;
void Solution();
int PlaceBishop(int row, int col);
int GetDiagIndex(int row, int col)
{
return (N - 1) - row + col;
}
int GetInvD... | ALGO | 0.999562 | 4.494183 |
4b46d51d-6606-45fd-82e1-1e88835e4576 | RitikSapat02/cpp_programs | 3. loops/prime.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int i=2;
while(i<n){
if(n%i==0){
cout<<n<<" is not prime"<<endl;
break;
}
i++;
}
if(i==n){
cout<<n<<" is prime"<<endl;
}
} | ALGO | 0.99985 | 3.714208 |
47fb73ef-5921-40ef-b4d6-703b179c3a8c | varunsharma10/cpp | CodeForces/372Div2B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL);}
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
int cnt[27];
string s;
int n;
bool valid()
{
for(i... | ALGO | 0.999933 | 4.090549 |
70e6ba1e-873b-4e08-b321-ae7609705a66 | Ronak3622/Sem_3_G_P_G | DSA /Practical_16_1.cpp | // Practical No. 16_1 Implement algorithm to delete a node from beginning in singly linked list.
#include <iostream>
using namespace std;
class node{
public:
int data;
node *next;
node(int d){
data = d;
node *next = NULL;
}
};
void insertAtFirstNode(node *&head, int data){
node *n ... | ALGO | 0.999364 | 5.299972 |
c1851c8a-152e-4eb0-b9ef-a71bd09e683a | morishita8256/AtCoder | ABC/121-140/ABC138/E - Strings of Impurity.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
cons... | ALGO | 0.999987 | 4.342532 |
bb0d4285-1b49-45a1-8a65-7a82abd7e7c9 | charsunny/bird | cocos2d/cocos/math/Mat4.cpp | #include "math/Mat4.h"
#include "math/Quaternion.h"
#include "math/MathUtil.h"
#include "base/ccMacros.h"
NS_CC_MATH_BEGIN
Mat4::Mat4()
{
*this = IDENTITY;
}
Mat4::Mat4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24,
float m31, float m32, float m33, float m3... | TOOL | 0.983405 | 7.266848 |
f8a1e454-88b5-49c7-98a3-6ca0f35eefef | Algebraic-Programming/Artifacts | SC_2025_Efficient_Parallel_Scheduling_Sparse_Triangular_Solvers/one-stop-parallel/src/scheduler/SSPInstanceContractor.cpp | /*
Copyright 2024 Huawei Technologies Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | ALGO | 0.99618 | 6.274124 |
3f9e8b8a-51a1-493d-94a7-181cfd01c3f7 | Chess6988/chess6988 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
c9dc4f55-fc91-4bb3-99cb-c817bae78b92 | Rainboylvx/pcs | loj/10114/1.cpp | /*-----------------
* author: Rainboy
* email: <EMAIL>
* time: Fri 03 Apr 2020 04:24:47 PM CST
* problem: loj-10114
*----------------*/
#include <bits/stdc++.h>
#define For(i,start,end) for(i = start ;i <= end; ++i)
#define Rof(i,start,end) for(i = start ;i >= end; --i)
typedef long long ll;
using namespace std;
/* ==... | ALGO | 0.999812 | 4.200051 |
9de4794b-c55f-4d10-baa7-244a1dbb68fd | erangel10/Rangel_Eduardo_CSC5_43952 | Hmwk/Assignment_2/Savitch_9thEd_Ch2_Prob13/main.cpp | /*
* File: main.cpp
* Author: Eduardo Rangel
*Purpose:To see how many candy bars i can eat
* Created on March 9, 2015, 10:20 AM
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//
//
int main(int argc, char** argv) {
//Declare Variables
unsigned short wtlbs,htin,ageyrs... | ALGO | 0.971532 | 3.928751 |
37a85e45-360f-4ffe-a98d-ef1055f03019 | kamilszymczak1/my_solutions | cf/contests/1627/b.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <set>
using namespace std;
void TestCase() {
int n, m; cin >> n >> m;
multiset<int>s;
vector<int>v;
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= m; j++) {
int dx = max(i - 1, (int)abs(n - i));
int ... | ALGO | 0.999663 | 3.102312 |
92e6ad0d-cf0f-4e3c-8284-c213a2006e95 | ishandutta2007/codeforces | enem/normal/1365/E.cpp | //https://codeforces.com/contest/1365/problem/E
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M1 1000000007
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<... | ALGO | 0.999986 | 4.438745 |
6d2fed65-e0db-4854-a29d-cb71b0847b0e | ishandutta2007/codeforces | enanimant/normal/1609/B.cpp | /*
* author: ADMathNoob
* created: 11/28/21 09:35:14
* problem: https://codeforces.com/contest/1609/problem/B
*/
/*
Comments about problem:
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, tt;
cin >> n >> tt;
string s;
cin >> s;
int cnt = ... | ALGO | 0.999675 | 4.58617 |
47708efc-60b3-435f-9537-d48f2dbe8993 | PollobRay/Competitive-Programming | CP Course/Luv/Contest 3/Doraemon and His Pocket of wonder!.cpp | //
// Created by Ray on 8/1/2022.
//
// AC
#include<iostream>
#include<vector>
#include<set>
using namespace std;
/*
int main()
{
int n,m;
int t;
cin>>t;
for (int i = 0; i < t; ++i)
{
multiset<int> A1;
vector<int> A2;
cin>>n;
for (int i = 0; i <n ; ++i)
{
... | ALGO | 0.999956 | 4.46122 |
92368815-a19b-4df9-b546-4d5cd5a8b85a | hhuangae/liggghts-src | compute_temp_deform.cpp | /* ----------------------------------------------------------------------
Contributing author: Pieter in 't Veld (SNL)
------------------------------------------------------------------------- */
#include "mpi.h"
#include "string.h"
#include "compute_temp_deform.h"
#include "domain.h"
#include "atom.h"
#include "up... | TOOL | 0.966808 | 6.567245 |
7153191b-844d-4e47-9266-aa6c9f93f282 | Stepheny755/ECE244 | Labs/Lab_2/playMove.cpp | #include "globals.h"
#include "GameState.h"
void playMove(GameState& game_state) {
int row,col,val;
bool turn;
row = game_state.get_selectedRow();
col = game_state.get_selectedColumn();
val = game_state.get_gameBoard(row,col);
turn = game_state.get_turn();
if(val!=Empty){
game_state.s... | ALGO | 0.99884 | 4.391365 |
75c51cee-bef8-49cc-a6a5-9ff995cc2eb8 | shivtikoo/DSA | Arrays/Leet204.cpp | class Solution {
public:
int countPrimes(int n) {
vector<bool> ans(n+1,true);
int cnt=0;
ans[0]=ans[1]=0;
for(int i=2;i<n;i++){
if(ans[i]){
cnt++;
for(int j=2*i;j<n;j=j+i){
ans[j]=0;
}
... | ALGO | 0.999948 | 5.598799 |
47b59de5-c637-4048-b40d-ed4f78384545 | KandarpJoshi1112/LeetCode | 1537-maximum-score-after-splitting-a-string/maximum-score-after-splitting-a-string.cpp | class Solution {
public:
int maxScore(string s) {
int totalOnes = 0;
int zeroesCount = 0, onesCount = 0, maxScore = 0;
// Count total ones in the string
for (char c : s) {
if (c == '1') totalOnes++;
}
// Iterate through the valid split positions
... | ALGO | 0.999987 | 6.629835 |
0780628d-5520-449f-85cb-fff8935f14c4 | danielhO9/PS | BOJ/28409.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M;
int W[200000], H[200000];
int w[200000], h[200000];
int green[200000];
int height[200000];
vector<int> gray[200000];
unordered_map<int, bool> isend;
void solve() {
cin >> N;
for (int i = 0; i < N; ++i) {
cin >> W[i] >> H[i];
if (i != 0) {
W[i] += W[i - ... | ALGO | 0.999968 | 3.687443 |
f4a2af40-23d0-4c88-b39f-f4cfd952ebde | AInitikesh/CarND-MPC-Project | src/Eigen-3.3/bench/benchEigenSolver.cpp |
// g++ -DNDEBUG -O3 -I.. benchEigenSolver.cpp -o benchEigenSolver && ./benchEigenSolver
// options:
// -DBENCH_GMM
// -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3
// -DEIGEN_DONT_VECTORIZE
// -msse2
// -DREPEAT=100
// -DTRIES=10
// -DSCALAR=double
#include <iostream>
#include <Eigen/Core>
#include <Eigen/QR>
#in... | TOOL | 0.987425 | 5.772861 |
6c208aca-e2b9-4734-8fc1-87d95c6fd00f | huythedev/Code_archive | GENERATE_TESTS/mac/generate.cpp | #include <bits/stdc++.h>
#ifdef _WIN32
#include <direct.h> // Header for Windows-specific functions
#define CREATE_DIR(path) _mkdir(path) // Create directory on Windows
#else
#include <sys/stat.h> // Header for POSIX-specific functions
#define CREATE_DIR(path) mkdir(path, 0777) // Create directory on Linux/macOS wi... | TEST | 0.953029 | 5.564091 |
2e54feb2-c698-4453-9cdd-e7e3701861fb | bharatbudhori/DS-ALGO | Prefix Evaluation.CPP | #include <bits/stdc++.h>
using namespace std;
int prefixEvaluation(string s){
stack<int> st;
for(int i=s.length()-1;i>=0;i--){
if(s[i]>='0' && s[i]<='9'){
st.push(s[i]-'0');
}
else{
int op1=st.top();
st.pop();
int op2=st... | ALGO | 0.999961 | 4.503705 |
4c69d433-6a3a-43d7-aacd-410d67359e28 | TsalemisIasonas/LeetCodeSolutions | 1635-number-of-good-pairs/1635-number-of-good-pairs.cpp | class Solution {
public:
int numIdenticalPairs(vector<int>& nums) {
int count = 0;
for (int i = 0 ; i<nums.size(); i++){
for (int j = 0; j<nums.size(); j++){
if (nums[i] == nums[j] && i<j){
count++;
}
}
}
ret... | ALGO | 0.999973 | 5.860837 |
9530cacb-0fe7-4f85-9bc3-249adf9c4e30 | parkjungsun/algorithm_note | week2/b4949.cpp | /* ๋ฐฑ์ค 4949 | ๊ท ํ์กํ ์ธ์ https://www.acmicpc.net/problem/4949 */
/*
*/
#include<bits/stdc++.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<stdio.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
string para;
while(1) {
... | ALGO | 0.999836 | 5.155031 |
b5846ab5-8c8a-4b9a-bf9b-3a3f627f4ac5 | contradict/ros-vslam | sba/test/run_spa_graph_file.cpp | // run a graph file through sSBA
// sample files are in data/ directory
#include "sba/sba_file_io.h"
#include "sba/sba.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <sys/time.h>
using namespace std;
using namespace Eigen;
using namespace sba;
using namespace frame_common;
/... | ALGO | 0.978192 | 3.521248 |
c586cc69-5004-49a1-9e81-913a12b32238 | etf-tk-sdn/QKDFPGA | sw/boost_1_81_0/libs/compute/perf/perf_accumulate.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/program_options.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/accumulate.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
namespace po = boost::program_options;
namespace ... | ALGO | 0.963449 | 6.193304 |
d81cd033-e0cd-4cca-897a-1ba220947578 | rohitshakya/CodeBucket | 1. Placements/4. Linked List/8. Cycle in a linked list.cpp | /*
* Author : Rohit Shakya
* Date : April-2020
* Compiler : g++ 4.9.2
* Flags : -std=c++14
* Time complexity : O(n)
* Title : cycle in a linked list /floyd's cycle detection algorithm
* Alternate Methods: hashing and structural change (O(N)time + O(n)space) and smallest power of 2
*/
/**
* Definition for ... | ALGO | 0.999855 | 5.571492 |
210bf78a-f8ff-4e92-9554-9cb92a6526b4 | Th-Shivam/WAY_TO_CPP | greater_of_3.cpp | #include <iostream>
using namespace std;
int main()
{
float a, b, c, grater_of_3;
cout << "Enter the first number : ";
cin >> a;
cout << "Enter the second number : ";
cin >> b;
cout << "Enter the third number : ";
cin >> c;
if (a > b && a > c)
{
grater_of_3 = a;
}
els... | ALGO | 0.997331 | 3.604858 |
c83c2c0c-14e2-41f5-a064-a3cc27e422bf | vedalken/How_to_program_Cpp | How_to_programC++/06.Functions_and_an_Introduction_to_recursion/6.14_References_and_reference_parameters/valueReference.cpp | // valueReference.cpp
// Program test two function using call by value
// and call by reference. For larger programs, overhead of copy parameters
// list is not recommended, meanwhile pass-by-reference is performance
// recommended.
#include <iostream>
using std::cout;
using std::endl;
// function prototype with param... | TOOL | 0.969273 | 6.987014 |
7109510f-6876-4ef8-9200-0218be0fd210 | vloic07/leetcode-solutions | medium/24_ swap-nodes-in-pairs/cpp/solution2.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* swapPairs(L... | ALGO | 0.999981 | 5.984518 |
66fb0e38-1f95-4383-affe-220e4d8adeed | ToprakArslann/floyd-dithering | src/main.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
#include <string>
using namespace std;
using namespace cv;
uint8_t s_add(uint8_t val1, uint8_t val2);
int main(){
VideoCapture cap("input.mp4");
if (!cap.isOpened()){
cerr << "Cant Open Video!" << endl;
return -1;
}
int err;
... | ALGO | 0.883814 | 4.288708 |
93f14909-a46b-4322-9996-97283a59a351 | GJ-Lin/SJTUOJ | 1991/main.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
const double eps = 1e-8;
int n, k;
double R, lastR;
double minR, maxR, midR;
double x[100005];
bool AllKill(double tryR)
{
int lf = 0, count = 1;
for (int rh = 1; rh < n; ++rh)
{
if (rh < n && x[rh] - x[lf] - 2 * tryR < eps... | ALGO | 0.999892 | 4.451605 |
58e7aafe-56e0-4bb7-ba31-f43542cd4a1a | Deepti675/DSA_Sheet | Array part II/Teemo Attacking.cpp | https://leetcode.com/problems/teemo-attacking/
class Solution {
public:
int findPoisonedDuration(vector<int>& timeSeries, int duration) {
int ans=0;
if(timeSeries.size()==0) return 0;
for(int i=0;i<timeSeries.size()-1;i++){
ans+=min(timeSeries[i+1]-timeSeries[i],duration);
... | ALGO | 0.999858 | 6.407264 |
660396c2-72b8-4569-9290-e277fccaa10c | sumit-raghukant-soni/Leetcode_Solutions | 1765-merge-in-between-linked-lists/merge-in-between-linked-lists.cpp | class Solution {
public:
ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2) {
ListNode *curr = list1, *aprev = NULL, *bprev = NULL;
int n = 0;
while(curr && n < a){
aprev = curr;
curr = curr->next;
n++;
}
whi... | ALGO | 0.999971 | 5.24878 |
ab5ed0a2-7c0c-4da3-ae8f-2ab8298e63bb | oxygen-hunter/Flashboom | data/leetcode_cpp/number-of-equal-numbers-blocks.cpp | // Time: O(klogn), k = len(set(nums))
// Space: O(1)
// binary search
class Solution {
public:
int countBlocks(BigArray* nums) {
const auto& binary_search_right = [](auto left, auto right, const auto& check) {
while (left <= right) {
const auto mid = left + (right - left) / 2;
... | ALGO | 0.999603 | 6.277878 |
798061f8-a04f-41a5-8f2b-d078c1438bb9 | asu-crypto/mpsica | thirdparty/linux/boost/libs/multi_index/example/non_default_ctor.cpp | #if !defined(NDEBUG)
#define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING
#define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
#endif
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <algorithm>
#include <iostream>
#include <iterator>
us... | TEST | 0.856736 | 6.505741 |
6abc6f6c-9dfe-4a9e-ad23-265b2194696c | prajwalt27/CP-codes | cc/longc/febl2_1.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define vb vector<bool>
#define pii pair<int,int>
#define pb push_back
#define sz(p) p.size()
#define l(p) p.length()
#define all(p) p.begin(), p.end()
#define lpi(i, a, b) for (int i ... | ALGO | 0.998431 | 3.631174 |
78729e6b-f0c1-4879-8251-7d8c92b78530 | MahendraBawanthade/DSA-WITH-LEETCODE-QUES | searchRotatedArray.cpp | #include<vector>
using namespace std;
int getPivot(vector<int>& arr, int n) {
int s = 0;
int e = n-1;
int mid = s + (e-s)/2;
while(s<e) {
if(arr[mid] >= arr[0])
{
s = mid+1;
}
else{
e = mid;
}
mid = s + (e-s)/2;
}
return... | ALGO | 0.999982 | 5.705747 |
473ceed9-64bd-4a4b-ab24-e54235246123 | MD-Arifuzzaman-ARIF/ProblemSolving | C++ Solution/Day01/71a.cpp | #include <iostream>
using namespace std;
int main()
{
int a;
string str;
cin >> a;
for (int i=0; i<a;i++)
{
cin >> str;
if (str.length() > 10)
{
cout << str[0] << str.length() - 2 << str[str.length() - 1] << endl;
}
else
{
co... | ALGO | 0.999089 | 3.553136 |
562c766a-6fcf-43f3-8bcc-e4d28ca20f3a | OneBitPython/Codeforces | EduRound120/C_Set_or_Decrease.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define sz size
#define all(c) c.begin(), c.end()
int sum()
{
return 0;
}
template <typename... Args>
int sum(int a, Args... args) { return a + sum(args...); }
void print() { cout << endl; };
template <typename T, typename..... | ALGO | 0.999965 | 4.673699 |
b712bf90-1e1e-44dc-b0cc-01f1c295efc6 | mishrashree18/problemsolving | binarytrees/binarytree.cpp | #include<bits/stdc++.h>
using namespacestd;
struct Node {
int data;
struct Node* left;
struct Node* right;
Node(int val){
data = val;
left = NULL;
right = NULL;
}
}
int main(){
struct Node* root = new Node(1);
root->left = new Node(2);
root->right = new Node(3)... | ALGO | 0.999811 | 3.47646 |
bfcbf77c-ea18-48f6-a43d-02e0a8f9235d | BSU2016gr09/ShishkarovIvan | CalcIntegral.cpp | // This programm calculate integral of 3 funcs.
#include <iostream>
using namespace std;
float mySin(float x) {
return sin(x);
}
float x2(float x) {
return x * 2;
}
float inv(float x) {
return 1 / x;
}
typedef float (*pf)(float);
float caclIntegral(float a, float b,pf, float e);// ะัััะต ัะฐะบ: float caclIntegra... | ALGO | 0.998913 | 3.972634 |
6566db56-47ee-4cc3-902e-da471b3d36b4 | ishandutta2007/codeforces | anta/normal/675/A.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#define re... | ALGO | 0.999876 | 3.615419 |
370eb228-af8b-44ea-a7d9-19d2cffd8737 | Huaqing77/test | 15/็จๅบๆธ
ๅ/Project1/Project1/error1.cpp | #include<iostream>
#include<cstdlib>
double hmean(double a, double b);
int main()
{
double x, y, z;
std::cout << "Enter two number: ";
while (std::cin >> x >> y)
{
z = hmean(x, y);
std::cout << "Harmonic mean of " << x << " and " << y
<< " is " << z << std::endl;
std::cout << "Enter next set of numbers <q ... | ALGO | 0.935235 | 4.156923 |
a3f5f61c-0476-464f-922c-056ed9d8dfdf | OpenXRay/xray-soc-history | net.ssa/Dima/bge.root/bge/vo/test.cpp | //////////////////////////////////////////////////////////////////////////////////
// Module : midgame solver //
// File : mg_pvs.cpp //
// Creation date : 14.02.2001 //
// Author : Dmitriy Iassenev //
///////////////////////////////////////////////////////////////////////... | ALGO | 0.999856 | 5.632198 |
98ce3369-cf92-40c8-8b48-5e42839e400f | manojnath18/DSA | 33-search-in-rotated-sorted-array/search-in-rotated-sorted-array.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int st =0, end = nums.size() - 1;
while(st <= end) {
int mid = st + (end - st)/2;
if(nums[mid] == target) {
return mid;
}
if(nums[st]<= nums[mid]) {
... | ALGO | 0.999978 | 6.290108 |
bf918dfd-aea2-49f3-9577-c288c600d254 | poojan124/Competitive | cf_561_div2/c.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
#define PI 3.1415926535897932384626433832795
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define lb lower_bound... | ALGO | 0.999981 | 4.12814 |
83827f31-b3ae-46ad-81aa-490a0f0bec3e | gash666/Crapto | ECoin/ECoin/SHA256.cpp | #include <iostream>
#include <iomanip>
#include <bitset>
#include <cstdint>
#include <sstream>
using namespace std;
string paddingVal;
pair <char*, int> hashTo;
void padding(char* input, int inputLen)
{
//add padding to the message to make it a multiple of 512 bits
paddingVal = "";
uint64_t LengthBits = inp... | ALGO | 0.999637 | 5.286072 |
62eefac3-289c-43b1-ae8a-b32b0285c00c | HardikNegi9/CodeForces | 1100/F_Eating_Candies.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
vector<int> a(n);
for(int i=0; i<n; i++){
cin >> a[i];
}
int left = 0, right = n - 1;
int alice = 0, bob = 0;
int ... | ALGO | 0.999907 | 4.16693 |
d886fb29-1afb-4b06-b927-3765706fb144 | online-9/ayyware | Ayyware Remastered/AWall.cpp | #include "Ayywall.h"
trace_t trace;
trace_t trace2;
bool bTraceExit(Vector &vStartyPosy, Vector &vDir)
{
float multiply = 0;
//int v10 = 0;
while (multiply <= 90.0f)
{
multiply += 4.0f;
Vector vDaStart = (vDir * multiply) + vStartyPosy;
Vector vDaEnd = vDaStart - (vDir * 4.0f);
int point_contents = (Int... | TOOL | 0.896351 | 3.97305 |
ff2a5cdc-80f1-4c15-95e5-72800104c4c0 | prashantdhaka1/codeforces_soln | E_Round_Dance.cpp | #include<bits/stdc++.h>
using namespace std;
# define ll long long
# define py cout<<"Yes"<<endl;
# define pn cout<<"No"<<endl;
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b);}
// map<int,int> mp;
// std::map<int,int>::iterator it;
// for( it=mp.begin();it!= mp.end();it++){
// }
#define lb lower_boun... | ALGO | 0.999776 | 3.24117 |
6128fe6a-9aa8-4afb-ab7c-fcd347fd89fa | chunrapeepat/learn-algorithm | solutions/how-do-you-add.cpp | #include <iostream>
using namespace std;
unsigned long memo[101][101] = {{0}};
unsigned long P(int n, int k) {
if (memo[n][k]) return memo[n][k];
if (k == 1) return 1;
if (k == 2) {
memo[n][k] = n + 1;
return n + 1;
}
int S = 0;
for (int i = 0; i <= n; ++i) S += P(n - i, k - 1... | ALGO | 0.999927 | 4.829367 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.