uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ddbfca71-4aca-4b83-a9d7-2e41d17ae0e7 | Octavi-OS/bionic | libc/bionic/swab.cpp | #include <unistd.h>
void swab(const void* void_src, void* void_dst, ssize_t byte_count) {
const uint8_t* src = static_cast<const uint8_t*>(void_src);
uint8_t* dst = static_cast<uint8_t*>(void_dst);
while (byte_count > 1) {
uint8_t x = *src++;
uint8_t y = *src++;
*dst++ = y;
*dst++ = x;
byte_c... | TOOL | 0.94444 | 4.884395 |
d2d52006-7cd2-40f3-8939-901bd13154b8 | branislavblazek/notes | C++/kniha/kody/kap16/16.17 usealgo.cpp | //usealgo.cpp -- pouit nkolika prvk STL
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <iterator>
#include <algorithm>
#include <cctype>
using namespace std;
char toLower(char ch) { return tolower(ch); }
string & ToLower(string & st);
void display(const string & s);
int... | ALGO | 0.961937 | 4.565622 |
624f7de4-21a5-4812-9837-cc54643517b1 | KBYSHanahira/Data-Structure | 8.Graph/GraphArrayV2.cpp | #include<stdio.h>
#include<conio.h>
#define MaxNode 6
int graph[MaxNode][MaxNode]={
{0,1,1,1,0,0},
{1,0,1,0,1,0},
{1,1,0,0,0,0},
{1,0,0,0,1,1},
{0,1,0,1,0,0},
{0,0,0,1,0,0}
};
char NodeName[MaxNode]={'A','B','C','D','E','F'};
void DispArray2D(){
int i,j;
printf(" ");
for (j=0 ; j<=MaxNode ; j++){
... | ALGO | 0.99133 | 3.762832 |
b1d5bbdc-85b8-44e8-9a1b-39b3d992ce71 | yimandre/HackerRankC-Portfolio | Staircase.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
for(int i = n; i>=1 ;i--){
for(int j=1; j<i; j++){
cout<<" ";
}
for(int k=n;k>=i;k--){
cout<<"#";
}
... | ALGO | 0.99986 | 3.474531 |
9d29578c-c6e5-4ea5-a124-7e362ccf8b9a | tsuchishinka/graduation_paper | depends_package/visp/tutorial/detection/object/tutorial-detection-object-mbt.cpp | //! \example tutorial-detection-object-mbt.cpp
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpIoTools.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/io/vpVideoReader.h>
#include <visp3/mbt/vpMbGenericTracker.h>
#include <visp3/vis... | ALGO | 0.996592 | 5.674354 |
c806930a-5c7e-4366-b6e3-14bd71c3f261 | SlowRobot/Languages | C++/vector.cpp | #include <iostream>
#include <vector>
int main() {
std::vector<int> v;
v.push_back(5);
v.push_back(7);
v.push_back(9);
v.push_back(4);
v.push_back(6);
v.push_back(8);
for(int i : v) {
std::cout << i << '\n';
}
} | ALGO | 0.992411 | 3.286062 |
c67077fa-e4b1-4736-b142-445ec5c1d7f9 | RamazanFIT/algorithms | part1/dp_part2/dp2.cpp | #include <bits/stdc++.h>
#define ENDL "\n"
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define endd return 0;
#define goodluck ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
using ll = long long;
using namespace std;
int MAXX = 300000;
vector<int> piramida(MAXX + 3, 0);
vect... | ALGO | 0.999921 | 4.041418 |
a753eb32-fafd-4a7c-8755-31f45c199474 | mushkul/Vanderbilt-CP | solutions/claude-3-5-sonnet-20241022/1749.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5+5;
int tree[4*N], a[N];
int n;
void build(int node, int start, int end) {
if(start == end) {
tree[node] = 1;
return;
}
int mid = (start + end) / 2;
build(2*node, start, mid);
build(2*node+1, mid+1, end);
tree[node]... | ALGO | 0.999996 | 4.183995 |
2b5bc32a-7e97-434d-ad87-4d02beef25fb | hyunicode/tsp_ga | ga/GAPopulation.cpp | // $Header$
#include <string.h>
#include <math.h>
#include "GAPopulation.h"
#include "GASelector.h"
#include "garandom.h"
#include "GABaseGA.h" // for the sake of flaky g++ compiler
// windows is promiscuous in its use of min/max, and that causes us grief. so
// turn of the use of min/max macros in this file. tha... | ALGO | 0.993807 | 6.839501 |
f68ef832-42f5-486f-b08e-2c8e4b4449cd | MorshedAl/Array_all.cpp | max_min_array.cpp | #include<iostream>
using namespace std;
int main()
{
// maximum
int A[]= {9,8,7,55,0,-9,5};
int max=A[0];
for(int i=0; i<7; i++)
{
if(A[i]>max)
{
max=A[i];
}
}
cout<<"maximum="<<max<<endl;
// minimum
int min=A[0];
for(int i=0; i<7; i++)
{
... | ALGO | 0.997722 | 3.257192 |
cd160b03-6a1e-4070-8a1c-59cb0f8b59b9 | madeinserver/lithtech | tools/PreProcessor/Packer_PC/PCRenderTri.cpp | //////////////////////////////////////////////////////////////////////////////
// PC-Specific rendering triangle implementation
#include "bdefs.h"
#include "pcrendertri.h"
#include "pcfileio.h"
/********************************************************/
/* AABB-triangle overlap test code */
/* by... | ALGO | 0.998087 | 5.084503 |
909db537-fc8f-4685-be92-47d80e96b72e | ryuta06012/atcoder | APG4b_n/bit.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#define span_all(a) a.begin(),a.end()
using namespace std;
int main () {
int N, K;
cin >> N >> K;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
}
bool ans = false;
// すべての選び方を試して、総和がKに... | ALGO | 0.999928 | 4.129312 |
97e40b30-c315-4368-acc1-05e4dfbfe07f | ink19/LeetCode | 2021_12/258/main.cpp | #include <iostream>
class Solution {
public:
int addDigits(int num) {
while (num >= 10) {
int temp_n = num;
num = 0;
while (temp_n != 0) {
num += (temp_n % 10);
temp_n /= 10;
}
}
return num;
}
}; | ALGO | 0.999293 | 6.556584 |
5e5dc744-4520-42d2-9a7a-b793fc69bbfc | runno0331/cvgl_exp | other/opencv/opencv-2.4.9/samples/cpp/convexhull.cpp | #include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <fstream>
#include <iostream>
using namespace cv;
using namespace std;
static void help()
{
cout << "\nThis sample program demonstrates the use of the convexHull() function\n"
<< "Call:\n"
<< "./convexhull\n" ... | ALGO | 0.988162 | 5.780695 |
28528d43-410d-49b9-95a8-cf59a72bdeea | Ashish1916/UML-COMPUTING-IV | portfolio/ps1a/main.cpp | #include <iostream>
#include "FibLFSR.hpp"
using PhotoMagic::FibLFSR;
int main() {
FibLFSR lfsr("1011011000110110");
std::cout << "Initial state: " << lfsr << std::endl;
// Perform some steps
for (int i = 0; i < 5; ++i) {
std::cout << "Step " << (i + 1) << ": " << lfsr.step() << ", State: " ... | ALGO | 0.998693 | 5.85611 |
56e8e7a7-ff35-4543-aeaf-1d7e01e528a7 | The-Streamliners/Data-Structures-and-Algorithms | Algorithms-Implementation/Searching/jump-search.cpp | //program to implement the jump search algorithm
#include<bits/stdc++.h>
using namespace std;
int jumpsearch(int a[],int x,int n)
{
int step = sqrt(n);
int previous = 0;
while(a[min(step,n)-1] < x)
{
previous = step;
step += sqrt(n);
if(previous >= n)
{
ret... | ALGO | 0.99996 | 5.156028 |
02ac9a97-d395-435c-8fdc-ad93d73f9cb1 | dharmik-anghan/Bootcamp-in-C | Assignment-39-STL-Forward-List/1_forwardL.cpp | #include <iostream>
#include <forward_list>
#include <iterator>
using namespace std;
int main()
{
forward_list<int> f1;
forward_list<int> f2;
forward_list<int> f3;
f1.assign({3,1,6,9,2,8,12,13,13});
f2.assign(5,10);
f3.assign(f1.begin(), f1.end());
f1.sort();
for(auto i : f1)
{
... | ALGO | 0.998084 | 4.470204 |
66859c39-6464-46be-a900-9d8a322ed2f3 | flyingbest/Algorithm_coding | Sorting/selection_sort.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
void display(int arr[], int size){
for(int i=0; i<size; i++){
cout << arr[i] << " ";
}
cout << endl;
}
void selectionSort(int arr[], int size){
int first, tmp;
for(int i=size-1; i>0; i--){
first = 0;
for(int j = 1; j <= i; j++){
... | ALGO | 0.999568 | 4.533663 |
bd7d0a07-65f0-4828-bdab-af3069ec9594 | priyesh-raj-singh/July-Leetcode-Practice | 1049-last-stone-weight-ii/1049-last-stone-weight-ii.cpp | class Solution {
public:
int lastStoneWeightII(vector<int>& nums) {
int n = nums.size();
int s = accumulate(nums.begin() , nums.end() , 0);
vector<vector<bool>> dp(n+1 , vector<bool> (s+1, false));
dp[0][0] = true;
for(int i = 0 ; i<=n ; i++)
dp[... | ALGO | 0.999932 | 5.453222 |
52b8eea6-0570-4830-ac5d-8901e5236f76 | cai0dada/cpe | must-take49/best-answer/08.cpp | #include <iostream>
using namespace std;
int x[256],l;
int main()
{
char n;
while(cin>>n)
{
l++;
x[toupper(n)]++;
}
while(--l)
{
for(n='A';n<='Z';n++)
{
if(x[n]==l)cout<<n<<" "<<x[n]<<endl;
}
}
} | ALGO | 0.997244 | 3.590467 |
442b896f-faa7-40b2-af64-b0d6c3b9221d | pierrecoric/leet_code_problems | 168_excel_column_title.cpp | class Solution {
public:
string convertToTitle(int columnNumber) {
string title = "";
while(columnNumber > 0) {
columnNumber --;
int remainder = columnNumber % 26;
title = char('A' + remainder) + title;
columnNumber /= 26;
}
return titl... | ALGO | 0.999889 | 6.161392 |
e2ef4e27-9bfb-4538-a64a-5ac848f4c019 | S-Swaroop/CodeForces_Solutions | CodeForces/1754/A.cpp | /*
************************************
* Author : SHARAN SWAROOP *
* https://linktr.ee/sharan_swaroop *
************************************
*/
#include<bits/stdc++.h>
#define endl '\n'
#define int int64_t
#define debug(x) cerr << #x << " : " << x << endl ;
using namespace std ;
void solve() {
int n ;
... | ALGO | 0.998424 | 4.270614 |
5f8502ea-7574-4d4c-9289-318fcbcd1d1a | renegeizu/UGR-FP | Codigos/Sesion 13/Ejercicio 8.cpp | /*
* Sobre la clase SecuenciaCaracteres, aada un mtodo EliminaRepetidos que quite los elementos repetidos, de forma que
* cada componente slo aparezca una nica vez. Se mantendr la primera aparicin, de izquierda a derecha. Por ejemplo, si
* la secuencia contiene {'b','a','a','h','a','a','a','a','c','a','a','a','g'} ... | ALGO | 0.999143 | 5.525602 |
bfaf8742-81a1-4283-9bc8-5ae57dae0c75 | MihirSinghYadav/programming-basics | C++/TheNewBoston/c22.cpp | #include <iostream>
using namespace std;
int main()
{
for (int x = 1; x < 10; x++)
{
cout << x << endl;
}
for (int y = 5; y < 50; y += 5)
{
cout << y << endl;
}
return 0;
} | TOOL | 0.980247 | 3.200484 |
eceb22b6-ec93-4349-bee8-d22fa6d2317d | SAR-forGit/TheLearnings | C++ Experience/Functions/Factorial_Using_Function.cpp | // Q: Factorial Using Function
#include <iostream>
using namespace std;
int Factorial (int givenNum) {
int num=1;
for (int i=1; i<=givenNum; i++) {
num *= i;
}
return num;
}
int main() {
int theNumber;
cout << "Write a number to know it's Factorial; ";
cin >> theNumber;
... | ALGO | 0.999835 | 5.062209 |
0255ecb1-2ed3-4d4c-b463-6c234140c4d3 | wylu/leetcodecn | src/cpp/p900to999/938.二叉搜索树的范围和.cpp | /*
* @lc app=leetcode.cn id=938 lang=cpp
*
* [938] 二叉搜索树的范围和
*
* https://leetcode-cn.com/problems/range-sum-of-bst/description/
*
* algorithms
* Easy (80.82%)
* Likes: 191
* Dislikes: 0
* Total Accepted: 66K
* Total Submissions: 81.7K
* Testcase Example: '[10,5,15,3,7,null,18]\n7\n15'
*
* 给定二叉搜索树的... | ALGO | 0.999991 | 6.930462 |
d35d230f-6775-4307-8e95-efb579697e88 | Pulkith/Competitive | Kickstart/2022/a/c.cpp | /**
* author: DespicableMonkey
* created: 03.21.2022 12:43:30
* Potatoes FTW!
**/
#include<bits/stdc++.h>
#if LOCAL
#include <DespicableMonkey/Execution_Time.h>
#include <DespicableMonkey/Debug.h>
#define debug_active 1
#endif
using namespace std;
#define pb push_back
#define f first
#define s second
#def... | ALGO | 0.999863 | 3.845155 |
6ee3f4db-3826-4b54-b228-eb2cb8243962 | Alvinsjq/LiCo_Exam | offer61.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
bool IsContinuous( vector<int> numbers ) {
if(numbers.size()<1)
return false;
//1.
sort(numbers.begin(),numbers.end());
int i;
int zero_num = 0;
int di... | ALGO | 0.99994 | 4.948919 |
cab36655-fd43-4659-9f3b-bc60f83923ae | HristoSpasov/C-Plus-Plus | 3 13.03.2017 - JudjeAssignment1/Task 3 – Fill Matrix.cpp | #include<iostream>
using namespace std;
void arrScan (char **arr, const int& rows, const int& cols, int startRow, int startCol, const char& searchChar, const char& replaceChar);
int main()
{
/// Read row and col number
int rows, cols;
cin >> rows >> cols;
cin.ignore();
char **arr; /// Declare arr... | ALGO | 0.956662 | 3.919387 |
00bdef03-4345-4d8e-b0c1-18d26802c56b | TechnicalPlayerZd/Infernal-Blueberries-Leetcode | 1656-count-good-triplets/count-good-triplets.cpp | class Solution {
public:
int countGoodTriplets(vector<int>& arr, int a, int b, int c) {
int count = 0, n = arr.size();
for (int i = 0; i < n - 2; ++i) {
for (int j = i + 1; j < n - 1; ++j) {
if (abs(arr[i] - arr[j]) > a) continue;
for (int k = j +... | ALGO | 0.999763 | 5.949979 |
81da31cb-d45f-4b19-9311-caf450b28279 | ashish-3916/competitive-programming | CP/dynamic programming-2/knapsack.cpp | int knapsack(int W[] , int V [] , int n , int req)
{
int dp [n+1][req+1];
for(int i = 0;i<=n ;i++)
{
for(int j=0 ;j<=req ;j++)
{
if(i==0 or j==0)
dp[i][j]=0;
else
{
if(W[i-1] > j) /// take care of indexing
dp[i]... | ALGO | 0.999975 | 5.008968 |
cfc0ffc0-d376-4fcf-9173-17c72d8271f1 | divanshurawat/crackYourPlacement | Day 24/Recover-BST-(99).cpp | class Solution {
private:
TreeNode* first;
TreeNode* prev;
TreeNode* middle;
TreeNode* last;
public:
void inorder(TreeNode* root){
if(!root) return;
inorder(root->left);
if(prev!=NULL && (root->val<prev->val)){
if(first==NULL){
first=prev;
... | ALGO | 0.999998 | 6.264388 |
4fbe32c6-a375-4efc-9543-247c7936245e | Rolight/ACM_ICPC | CodeForces/R285Div2/A.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <list>
#include <vector>
#include <string>
using namespace std;
int calc(int p, int t) {
return max(3 * p / 10, p - p / 250 * t);
}
int main() {
in... | ALGO | 0.999815 | 3.877774 |
0e659a03-b5ef-435c-94b9-1e963cdcfe56 | AbdElRahmanOsama182/LeetCode-Problems | 2485-find-the-pivot-integer/2485-find-the-pivot-integer.cpp | class Solution {
public:
int pivotInteger(int n) {
double x = sqrt(n*(n+1)/2);
if (x == int(x)) return x;
return -1;
}
}; | ALGO | 0.999838 | 5.83916 |
0512bfd3-6cd3-4e07-b173-1e2d00f081cc | KrzysztofSobol/Data-Structures-and-Algorithms | Problem_Monetarny/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
using namespace std;
vector<int> cashType;
vector<int> cashAmount;
int Min(int &a, int b){
return a < b ? a : b;
}
int NewAmount(int &a, int &b, int **arr, int &n){
int minCoins = 20001, remaining, coinsForRemaining;
for(int k = 1; k <= a / b; k++)... | ALGO | 0.998428 | 3.742117 |
1595ac9f-dd18-4789-bed6-fc7ced55960d | thanoschild/Leetcode | 1502-construct-k-palindrome-strings/1502-construct-k-palindrome-strings.cpp | class Solution {
public:
bool canConstruct(string s, int k) {
bitset<26> odd;
for(char c : s) odd.flip(c - 'a');
return odd.count() <= k && k <= s.length();
}
}; | ALGO | 0.999968 | 6.160223 |
8d408831-447c-4fea-92ea-8cb2f8f7fd15 | darkshuige/codecode | c code/树形dp 树的直径.cpp | #include<bits/stdc++.h>
#define jiasu ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define int long long
#define endl "\n"
#define lc p<<1
#define rc p<<1|1
#define inf 0x3f3f3f3f3f3f3f3f
using namespace std;
const int maxn=100005;
vector<pair<int,int> >g[maxn];
int ans=INT_MIN;
int n;
int dfs(int u,int fa)
{
i... | ALGO | 0.999893 | 3.97805 |
c2876ec1-3956-4ba6-8b41-0d12bca8bb5b | dakshsardana/LeetCode | my-folder/0041-first-missing-positive/solution.cpp | class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
sort(nums.begin(),nums.end());
int i=0;
while(i<nums.size() && nums[i]<=0) {
i++;
}
if(i==nums.size()) return 1;
int c=1;
while(i<nums.size()) {
if(nums[i]!=c)
... | ALGO | 0.99999 | 4.87471 |
0a0b7d2c-0f0a-4437-861a-fe3e5e19dcb9 | bharatsunny/OPEN-CV | samples/cpp/fback.cpp | #include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
static void help()
{
cout <<
"\nThis program demonstrates dense optical flow algorithm by Gunnar Farneback\n"... | ALGO | 0.998553 | 6.266588 |
17aad6d1-9538-449f-ba38-1678038efe6f | raincross7/code-similarity | codes/train_code/problem213/problem213_185.cpp | #include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#include <iomanip>
#include <numeric>
#pragma region Macros
#define int long long
#define double long double
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
#define ... | ALGO | 0.99993 | 3.88707 |
3ca6dfa4-cf1c-4b98-9961-cf6f110a9ecd | afikur/UVA-Solutions | 11461 Square Numbers.cpp | /*
Afikur Rahman (afikur)
UVA 11461
Date: 18.02.17
*/
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a,b,counter;
while(cin>>a>>b) {
if(!a && !b) break;
counter = 0;
for(int i = a ; i <= b ; i++) {
if (sqrt(i) == (int)sqrt(i)) {
... | ALGO | 0.999794 | 3.932441 |
e6cfae5f-85de-4a2d-907a-27204a3de153 | LauZyHou/Algorithm-To-Practice | LeetCode/350.cpp | class Solution {
public:
vector<int> intersect(vector<int>& v1, vector<int>& v2) {
int n1 = v1.size();
int n2 = v2.size();
vector<int> ans;
if(!n1 || !n2)
return ans;
sort(v1.begin(), v1.end());
sort(v2.begin(), v2.end());
int i = 0;
int j = 0;
while(i<n1 && j<n2) {
while(i<n1 && v1[i]... | ALGO | 0.99999 | 5.292581 |
84d5623b-fda8-43be-b516-0376a27acf0f | Avinash0308/GFGProblemOfTheDaySolution_2023 | OCT_02_2023_No_Of_Different_Subsequences_Solution.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
long long int mod = 1e9+7;
int distinctSubsequences(string s)
{
// Your code goes here
vector<long long int> count(26);
int n = s.size();
long long int cur = 1;
for(int i = n-1; i>=0; i--){
long long int val =... | ALGO | 0.999998 | 5.767985 |
72fb18e3-1905-498a-8215-cc7416522bf4 | ishandutta2007/codeforces | froggyzhang/normal/1195/C.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
#define N 100010
typedef long long ll;
inline ll read(){
ll x=0,f=1;
char c=getchar();
while(c<'0'||c>'9'){
if(c=='-')f=-1;
c=getchar();
}
while(c>='0'&&c<='9'){
x=(x<<1)+(x<<3)+c-'0';
c=getchar(... | ALGO | 0.999806 | 3.58373 |
37b82bd1-597a-4394-8d7e-c6e3d29743e7 | westondhill/bc_mr_gpu | lonestar/tutorial_examples/TorusImproved.cpp | #include "galois/Galois.h"
#include "galois/Timer.h"
#include "galois/graphs/Graph.h"
#include <iostream>
//! Graph has int node data, void edge data and is directed
typedef galois::graphs::MorphGraph<int, void, true> Graph;
//! Opaque pointer to graph node
typedef Graph::GraphNode GNode;
class Point2D {
int v[2];
... | ALGO | 0.997782 | 6.996299 |
7af57bfb-911a-4b73-a8c6-029d3b724fe7 | ergawy/usaco-solutions | 05 Milk2/Main3.cpp | /*
ID: kareem_2
PROG: milk2
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
struct Event {
int time;
int type;
};
bool compareEvents(Event e1, Event e2) {
if (e1.time != e2.time) {
return e1.time < e2.time;
}
return e1.type > e2.type;
}
int main() {
ifstrea... | ALGO | 0.9999 | 4.45296 |
5130187c-844d-4be5-b7bd-795b70d172d7 | Md-Sabbir-Ahmed/EEE2110 | Laboratory 4 [Iteration]/Problem02/problem02.cpp | /*
NAME: MD. SABBIR AHMED
ID:20200105021
SECTION:A
----------------------
CHAPTER:04
PROBLEM:02
*/
#include <iostream>
using namespace std;
int main() {
int n,sum=0;
cout<<"Enter the value of n: ";
cin>>n;
int i=1;
while(i<=n)
{
sum=sum+i*i;
i=i+2;
}
cout<<"The sum is: "<<sum;
}
| ALGO | 0.996789 | 4.2618 |
397c40e6-7c47-4919-9390-a6844d6b35ff | GoldenCheetah/GoldenCheetah | src/Core/Quadtree.cpp | #include "Quadtree.h"
// add a node
bool
QuadtreeNode::insert(Quadtree *root, GPointF value)
{
if (!contains(value)) return false;
// here will do
if (leaf && contents.count() < maxentries) {
if (!contents.contains(value)) contents.append(value); // de dupe
return true;
}
// full,... | TOOL | 0.993193 | 5.833807 |
79105a82-a312-4dcc-84b1-0f8a5fb53efd | Shell-Wataru/AtCoder | ARC/ARC075/C.cpp | #include<iostream>
#include <algorithm>
#include <vector>
#include <deque>
using namespace std;
int main()
{
// 整数の入力
long long total,i,N,minVal,temp;
cin >> N;
total = 0;
minVal = 101;
for (i=0;i<N;i++){
cin >> temp;
total += temp;
if (temp % 10 != 0 && temp < minVal ){... | ALGO | 0.999933 | 3.814028 |
8c71d5e0-87ee-488c-aaff-3f142b34be9a | akanksha-coditas/e_commerce_assignment | 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.99887 | 6.783439 |
27287b97-85c8-46ce-b474-e826fc2601ea | anantsingh404/Leetcode | 2616-maximal-score-after-applying-k-operations/maximal-score-after-applying-k-operations.cpp | class Solution {
public:
long long maxKelements(vector<int>& nums, int k) {
long long ans=0;
priority_queue<int>pq(nums.begin(),nums.end());
while(k--)
{
int x=pq.top();
pq.pop();
ans+=x;
int p=x/3;
if(x%3)
{++p;
}
pq.push(p);
... | ALGO | 0.999983 | 5.245636 |
064a94d7-9efc-4a62-a24a-6cbe60184101 | ishandutta2007/codeforces | rafbill/normal/793/B.cpp | #ifndef __clang__
#pragma GCC optimize "-O3"
#pragma GCC target "tune=native"
#endif
#ifdef ONLINE_JUDGE
#define NDEBUG 1
#endif
#include <stdio.h>
#include <bits/stdc++.h>
#define DESTRUCT2(p, a, b) \
auto a = get<0>(p); \
auto b = get<1>(p);
#define DESTRUCT3(p, a,... | ALGO | 0.999963 | 4.093428 |
0487735e-d62d-4b80-b731-d029197be4d4 | ishandutta2007/codeforces | dvdg6566/normal/1088/B.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef vector<pi> vpi;
typedef double dl;
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define MOD 1e9+7
#define lb lower_bound
#define ub upper_bound
#define dst distancer
#d... | ALGO | 0.999976 | 3.326113 |
35178b6c-ce8d-4976-8fc3-76b94611c6fb | Beast921/codes | bit manipulation/countSetBits.cpp | #include<iostream>
using namespace std;
int main(){
int n, c=0;
cin>>n;
while(n){
if(n & 1) c++;
n = n >> 1;
}
cout<<c;
return 0;
} | ALGO | 0.999839 | 4.513616 |
ac4ee681-ff26-4166-b8b4-50d87fae81c4 | Ramyasowjanya/MissionRnD-C-Arrays-Worksheet | spec/topKStudentsSpec.cpp | #include "stdafx.h"
#include "CppUnitTest.h"
#include "../src/topKStudents.cpp"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace spec
{
TEST_CLASS(topKStudentsSpec)
{
public:
void swap(int *a, int *b) {
*a = *a + *b;
*b = *a - *b;
*a = *a - *b;
}
void sort(int arr[], int le... | TEST | 0.977641 | 5.611877 |
abc223c2-1e85-467f-8016-e2f6ef96289b | BeautifulCodes/LeetCode | fizz buzz.cpp | class Solution {
public:
vector<string> fizzBuzz(int n) {
vector<string>ans;
string save;
for(int i=1;i<=n;i++){
if((i%3==0) and (i%5==0)){
save="FizzBuzz";
}else if(i%5==0){
save="Buzz";
}else if(i%3==0){
sa... | ALGO | 0.999863 | 6.56181 |
d27226c2-b218-4a51-92d6-6f1af72606b9 | sgvaidyas/Cplus_9June_6_9 | 8_leftshiftnum.cpp | /*
left shift of num
1) get the count of digits (store n in n1)
n = 1234 expected output : 2341
n1=n = 1234
cnt=0
n cnt n=n/10
---------------------------
1234 1 123
123 2 12
12 3 1
1 4 0
0------------------------>
n1=1234
n=n1 = 1234
cnt = 4
x = (int)pow(10,cnt-1)
a = n%x
=123... | ALGO | 0.999815 | 3.753178 |
44173800-1d75-42b5-bd87-e52a752cb6fe | johebkhan32/6companies30Days | Adobe/convert_array_AtoB13.cpp |
class Solution
{
public:
int solve(vector<int> vec)
{
vector<int> res;
for (int i = 0; i < vec.size(); i++)
{
auto it = lower_bound(res.begin(), res.end(), vec[i]);
if (it == res.end())
{
res.push_back(vec[i]);
}
... | ALGO | 0.999989 | 4.906324 |
b30743b5-9318-4ee6-a756-053312f8b9ee | phidiaLam/GAMES | GAMES101_Homework_S2021/Homework8/Assignment8/CGL/src/matrix3x3.cpp | #include "matrix3x3.h"
#include <iostream>
#include <cmath>
using namespace std;
namespace CGL {
double& Matrix3x3::operator()( int i, int j ) {
return entries[j][i];
}
const double& Matrix3x3::operator()( int i, int j ) const {
return entries[j][i];
}
Vector3D& Matrix3x3::operator[]( int j ) {
... | TOOL | 0.900377 | 6.895061 |
f8feccdb-2b33-4b2b-8ce0-64861bb975b0 | PM-30/1132_DataStructure | LAB06.cpp | #include <iostream>
#include <cctype>
#include <cstring>
using namespace std;
// 定義 Stack 的節點結構
struct Node {
char data; // 存儲字符 (運算子或括號)
Node* next; // 指向下一個節點
};
// 使用 linked list 實作 Stack
class Stack {
private:
Node* top; // 指向堆疊頂端
public:
Stack() { top = nullptr; } // 初始化堆疊
// Push 操作:將元素放入堆... | ALGO | 0.999965 | 5.848207 |
62ba4224-3a0a-4f80-9617-6fb29437c133 | SenhuWong/tmp | src (1)/mathTools/triangle.cpp | #include <cmath>
#include "Operations.h"
#include "triangle.h"
#include "AxisSeperating.h"
Triangle::Triangle()
{
}
Triangle::Triangle(const Triangle &another)
{
for (int i = 0; i < 3; i++)
{
this->mPoints[i] = another.mPoints[i];
}
this->normal = another.normal;
this->source = another.sourc... | ALGO | 0.998012 | 4.814003 |
0c744d08-9931-4d81-80d7-aebf32ba7e34 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt35/Codenet/p01146/403266209/response_0.cpp | #include <bits/stdc++.h>
#define r(i, n) for (int i = 0; i < n; i++)
#define INF 1e9
using namespace std;
int main() {
#pragma GCC optimize("O3")
int n, m, l, k, a, h, t1, t2, t3;
while (cin >> n >> m >> l >> k >> a >> h, n) {
vector<vector<int>> b(n, vector<int>(n, INF));
vector<vector<int>> x(n, vecto... | ALGO | 0.999857 | 3.551135 |
aba0ce1b-0eab-48ec-b1b2-dcf416eaf94a | reallymanya/DSA | pattern problems/ques24.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int row = 1;
int num = 1;
while(row<=n){
//space print
int space = n - row;
while(space) {
cout<<" ";
space = space - 1;
}
//num
int col = 1;
... | ALGO | 0.99998 | 4.094528 |
81d63fb4-3a5e-4f4e-a70f-4ac44bc15b5f | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9374_2.cpp | #include <iostream>
using namespace std;
int main(){
int d[6],tmp;
char s;
for(int i=0;i<6;i++){
cin >> d[i] ;
}
while(cin >> s){
if(s=='E'){
tmp=d[0];
d[0]=d[3];
d[3]=d[5];
d[5]=d[2];
d[2]=tmp;
}
if(s=='N'){
tmp=d[0];
d[0]=d[1];
d[1]=d[5];
d[5]=d[4];
d[4]=tmp;
}
if(s... | ALGO | 0.999913 | 3.362902 |
503c4068-b811-4844-86b8-b93a5856381f | DwyaneTalk/AlgorithmsAndDataSturctures | algorithmSolution/leetCodeC++/173_Binary Search Tree Iterator.cpp | /* DwyaneTalk@gmail.co_m
* by lutao
* leetCodeC++ : Binary Search Tree Iterator
* : https://leetcode.com/problems/binary-search-tree-iterator/
*/
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>... | ALGO | 0.999995 | 6.145735 |
35df3978-972f-4660-ab51-c5f055cd78b1 | ishandutta2007/codeforces | mrscherry/normal/1161/D.cpp | #include <bits/stdc++.h>
#define sz(V) ((int)(V).size())
#define all(V) (V).begin(), (V).end()
#define vsort(V) sort(all(V))
#define vunique(V) (V).erase(unique(all(V)), (V).end())
#define vcomp(V) vsort(V), vunique(V)
#define fs first
#define se second
#define pp push_back
#define ep emplace_back
using namespace std... | ALGO | 0.999997 | 4.32257 |
bd4961b9-ecbc-430a-9d0b-2fbfe82e0fec | Patel7Manav/Leetcode-Solutions | 786-k-th-smallest-prime-fraction/786-k-th-smallest-prime-fraction.cpp | class Solution {
public:
vector<int> kthSmallestPrimeFraction(vector<int>& arr, int k) {
vector<pair<double,pair<int,int>>>vect;
int n=arr.size();
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
vect.push_back({double(arr[i])/arr[j],{arr[i],arr... | ALGO | 0.999974 | 4.910797 |
b8443a30-f586-4efd-9c84-57b93a9f866b | zulianp/utopia | utopia_fe/backend/libmesh/amputated/materials/utopia_libmesh_Transport.cpp | #include "utopia_libmesh_Transport.hpp"
#include "utopia_make_unique.hpp"
#include "utopia_libmesh_Legacy.hpp"
/// Legacy includs
#include "utopia_Flow.hpp"
#include "utopia_StabilizeTransport.hpp"
#include "utopia_UIScalarSampler.hpp"
namespace utopia {
namespace libmesh {
class Transport::Impl {
... | TOOL | 0.860694 | 6.943006 |
71683d58-637e-421a-bd95-7a069a7b6ba1 | SChernykh/p2pool | src/console_commands.cpp | #include "common.h"
#include "console_commands.h"
#include "p2pool.h"
#include "stratum_server.h"
#include "p2p_server.h"
#ifdef WITH_RANDOMX
#include "miner.h"
#endif
#include "side_chain.h"
#include "p2pool_api.h"
#include "params.h"
LOG_CATEGORY(ConsoleCommands)
static constexpr int DEFAULT_BACKLOG = 1;
namespace... | TOOL | 0.859174 | 7.239518 |
c9e26b0f-05d3-4615-b67d-b72ba1b88206 | DPChanny/ps | Baekjoon/2293.cpp | #include<iostream>
using namespace std;
int n, k, ns[100], dp[10'000 + 1]{ 1, 0 };
int main(void) {
cin >> n >> k;
for (int _n(0); _n < n; _n++) {
cin >> ns[_n];
for (int _k(ns[_n]); _k < k + 1; _k++)
dp[_k] = dp[_k] + dp[_k - ns[_n]];
}
cout << dp[k];
} | ALGO | 0.999947 | 3.129069 |
ede8dc27-81c7-4df1-af65-da5ce95dacd4 | ishandutta2007/codeforces | tzc_wk/normal/1630/D.cpp | #include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/hash_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define fi first
#define se second
#define fill0(a) memset(a, 0, sizeof(a))
#define fill1(a) memset(a, -1, sizeof(a))
#define fillbig(a) memset(a, 63, sizeof(a))
... | ALGO | 0.999971 | 3.279621 |
a1c71556-a07d-43b0-9d17-43010986a883 | Zhenghao-Liu/LeetCode_problem-and-solution | 1886.判断矩阵经轮转后是否一致/solution.cpp | class Solution {
public:
bool findRotation(vector<vector<int>>& mat, vector<vector<int>>& target) {
return dfs(mat,target,0);
}
bool dfs(vector<vector<int>>& mat, vector<vector<int>>& tar,int cnt) {
if (mat==tar) {
return true;
}
if (cnt>=4) {
return f... | ALGO | 0.99998 | 6.043531 |
2ab3f2da-9201-4f56-93a0-7d3d335267ba | zarif98sjs/Competitive-Programming | CodeForces/Contest/Round 652/B.cpp |
/** Which of the favors of your Lord will you deny ? **/
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define MP make_pair
#define F first
#define S second
#define ALL(x) (x).begin(), (x).end()
#define DBG(x) cerr << __LINE__ << " says: " << #x ... | ALGO | 0.999963 | 3.91022 |
3804e93e-bbdb-49bf-8f8d-4f36d00009fb | MojoAlpha/CSES-Problemset | Mathematics/Nim_Game_I.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 100005
#define MOD 1000000007
#define fo(i, b, n) for (long i = b; i < n; ++i)
#define rfo(i, b, n) for (long i = b; i >= n; --i)
#define all(ar) ar.begin(), ar.end()
#define rall(ar) ar.rbegin(), ar.rend()
#define mem(ar, val) memset(ar, val, sizeof(ar))
#defin... | ALGO | 0.999918 | 4.770085 |
519c808e-df1d-4f2e-8ad6-fd2cbf5b94b1 | Radha27112021/DSA_Bootcamp_assignments | Day6ArraySum.cpp | #include <iostream>
#include <limits.h>
using namespace std;
// Function to find the sum of array elements
int arraySum(int arr[], int n)
{
int sum = 0;
for (int i = 0; i < n; i++)
{
sum += arr[i];
}
return sum;
}
// Function to find the largest element in an array
int largestElement(int ar... | ALGO | 0.999264 | 5.175178 |
fbd0dcf8-7eec-4a09-b950-20d968b5a0d0 | fr3ak2402/GalaxySlicer | src/libigl/igl/unproject_onto_mesh.cpp | template < typename DerivedV, typename DerivedF, typename Derivedbc>
IGL_INLINE bool igl::unproject_onto_mesh(
const Eigen::Vector2f& pos,
const Eigen::Matrix4f& model,
const Eigen::Matrix4f& proj,
const Eigen::Vector4f& viewport,
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<Deri... | ALGO | 0.854441 | 6.427085 |
fb781b5d-6176-44a9-b4c8-0d421afaa43c | Hailaylin/Algorithm | DataStructure_YanWeiMin2_BookCode/第6章/6_10_Dij.cpp | /*
* @Description:
* @Author: HailayLin
* @Date: 2021-11-12 16:57:41
* @LastEditTime: 2021-12-15 11:25:17
* @FilePath: \Algorithm\DataStructure_YanWeiMin2_BookCode\第6章\6_10_Dij.cpp
*/
//算法6.10 迪杰斯特拉算法
#include <iostream>
using namespace std;
#define MaxInt 32767 //表示极大值,即∞
#define MVNum... | ALGO | 0.999874 | 4.524851 |
f1249afb-0dda-4a9e-8049-f17b95046811 | raincross7/code-similarity | codes/train_code/problem123/problem123_347.cpp | /*
ID: anonymo14
TASK: wormhole
LANG: C++
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vpii;
#define F first
#define S second
#define PU push
#define PUF push_front
... | ALGO | 0.999619 | 3.759913 |
8ff39200-cbb8-467a-981c-79c163032e14 | Brave123555/leetcod1 | lcp/LCP 67. 装饰树/Solution.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.999978 | 6.307571 |
cd14f310-35d3-4fb2-9f58-8ebd5da007bd | AIOCodeBase/LCPOTD | Problems & Solutions/93. Restore IP Addresses/21 January 2022/Approach 2 - Iterative/Restore IP Addresses.cpp | class Solution {
bool valid(const string& s, int start, int length) {
return length == 1 || (s[start] != '0' && (length < 3 || s.substr(start, length) <= "255"));
}
public:
vector<string> restoreIpAddresses(string s) {
vector<string> ans;
int length = s.length();
for (int le... | ALGO | 0.999185 | 6.018457 |
f1fc6447-fa80-4b7f-bebf-43b35c35967f | treephesians/Flutter | u_and_i/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.997983 | 6.76073 |
2b440b32-d4bc-4286-b61c-04e073a0c704 | cklaha1947/C-Learning-Stack-basics | Perfect Number.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int i,n,sum;
cout<<"Enter a number : ";
cin>>n;
sum=0;
for(i=1;i<=n/2;i++)
{
if(n%i==0)
{
sum=sum+i;
}
}
if(sum==n)
{
cout<<"It is a perfect Number.";
}
else
{
cout<<"It is not a Perfect Number.";
}
}
| ALGO | 0.999749 | 4.169136 |
27c25b5c-189c-4b74-bd12-5f817c43eb0f | tum-i4/dta-vs-osc | sc-virt/src/lib/CodeGen/MachineTraceMetrics.cpp | #include "llvm/CodeGen/MachineTraceMetrics.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/... | TOOL | 0.985108 | 7.849658 |
1e85486d-ae44-4a60-ae0c-6df587ff99b2 | saptarsi96/Codes | 49A.cpp | #include <bits/stdc++.h>
#include<ctype.h>
using namespace std;
#define ar array
#define ll long long
const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;
void solve() {
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
string vowels = "aei... | ALGO | 0.999926 | 4.975864 |
2df6c1c3-1e70-4bb1-a00a-a6e137182bb6 | raincross7/code-similarity | codes/train_code/problem214/problem214_133.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y... | ALGO | 0.999968 | 3.709521 |
63437df5-b371-401f-8be7-abc0bb797ae7 | kadirsenol/IoT | RoboticProject/Robotic.cpp | #include <Servo.h>
Servo servo1, servo2, servo3, servo4;
int data;
const int trig = A1;
const int echo = A0;
const int trigsa= A3; const int echosa =A2;
const int trigso = A5;
const int echoso = A4;
const int sol_i = 2;
const int sol_g = 4;
const int sol_p = 5;
const int sag_i = 7;
const int sag_g= 8;
const int sag_p... | TOOL | 0.973001 | 3.843706 |
025a567c-8e59-4164-8b38-3926d97a148a | Rakibul-Hassan32/Cpp-stl-programming | unordered_maps.cpp | #include<bits/stdc++.h>
using namespace std;
void print(unordered_map<int, string> &m){
cout<<m.size()<<endl;
for(auto &it : m){
cout<<it.first<<" "<<it.second<<endl;
}
}
int main(){
unordered_map<int, string> m;
m[1]="abc";
m[5]="cdc";
m[3]="acd";
m.insert({4,"afg"});
a... | ALGO | 0.992374 | 4.049382 |
e39ca4e3-50f9-4d46-a5d2-966f1c53c91f | asayushranjansinha/LeetCode-Submissions | 0875-koko-eating-bananas/0875-koko-eating-bananas.cpp | class Solution {
public:
int minEatingSpeed(vector<int>& piles, int h) {
int low = 1;
int high = 1e9;
int ans = INT_MAX;
while(low <= high){
int eatingSpeed = (low) + (high - low)/2;
long int timeTaken = 0;
for(auto it : piles){
... | ALGO | 0.999941 | 6.082507 |
c2abd506-8f2e-4bae-a03b-56b20640670c | WYK15/swift-Ollvm10 | libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires ShuffleIterator<Iter>
// && LessThanComparable<Iter::value_type>
// void
// stable_sort(Iter first, Iter last);
#include <algorithm>
#include <iterator>
#include <random>
#include <cassert>
#include "test_macros.h"
std::mt19937 randomne... | TEST | 0.997932 | 7.637092 |
d77c72d2-ee53-471e-823a-9551a5d56602 | liupengzhouyi/LeetCode | c20200627/Paly349/Paly349.cpp | //
// Created by 刘鹏 on 2020/6/27.
//
#include "Paly349.h"
::std::vector<int> Paly349::intersection(std::vector<int> &nums1, std::vector<int> &nums2) {
::std::set<int> returnSet;
::std::vector<int> returnList;
int number1 = nums1.size();
int number2 = nums2.size();
int index1 = 0, index2 = 0;
s... | ALGO | 0.999225 | 4.914763 |
ca9fe615-cda2-4947-950d-ecc00cf21aa0 | Ciprian1922/Code_Works | Y2S1/ADS - seminary/LabWork5/asg_1.cpp | #include <vector>
#include <set>
#include <iostream>
#include <istream>
#include <sstream>
using namespace std;
class graph {
protected:
int nV; //number of nodes
int nE; //number of edges
vector<set<int>> vec; //representation with adjacency lists
public:
explicit graph(istream& src) {
nV = nE... | ALGO | 0.999962 | 5.263228 |
c91b5932-c138-4aba-a146-0ed794b2ab64 | blackdurumi/AlgorithmStudy | 2263.cpp | #include<iostream>
#include<stack>
#define N 100005
using namespace std;
int in[N], post[N];
void dq(int a, int b, int c, int d)
{
int i, p;
for(i=a; i<=b; i++){
if(in[i]==post[d])
break;
}
cout << in[i] << " ";
if(a==b && c==d) return;
if(i!=a) dq(a, i-1, c, c+i-a-1);
... | ALGO | 0.999985 | 3.587721 |
1d181995-5b1b-4700-92ef-9fca70a5b89f | sidvisw/CodingBlocksCompetitiveProgramming | Graph/SakshiAndArt.cpp | /*
Concept on Euler Path-
In graph theory, an Eulerian trail (or Eulerian path) is a trail in a finite graph that visits every edge
exactly once (allowing for revisiting vertices). Similarly, an Eulerian circuit or Eulerian cycle is an
Eulerian trail that starts and ends on the same vertex.
Euler's Theorem:
A connec... | ALGO | 0.99985 | 4.967534 |
d877cce0-2dcd-4e86-bbc6-e6b4d8176e6f | iamzaidsoomro/Robert-Lafore-Exercises | chapter 4-struct/chapter 4 task2.cpp | /*
chapter 4 task 2
by ZAMEER ALI(046)
construct structure contain x-axis and y-axis
*/
#include <iostream>
using namespace std;
struct point{
int x_coordinate;
int y_coordinate;
};
int main(){
point p1,p2,presult;//variables of structure
cout<<"Enter x coordinate of first point : ";
cin>>p1.x_coordinate;
... | ALGO | 0.926336 | 4.452994 |
e006ddb4-4cbf-4bbf-a705-163aedd7174e | capstone-engine/llvm-capstone | libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp | // <algorithm>
// template<InputIterator InIter1, InputIterator InIter2, typename OutIter>
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && HasLess<InIter2::value_type, InIter1::value_type>
// && HasLess<InIter1::value_type, InIte... | TEST | 0.982613 | 6.595222 |
1a253371-4b81-46b8-ac78-e4e95469b3dc | SeokhunEom/Coding_Test | Programmers/Lv.0/무작위로 K개의 수 뽑기.cpp | #include <algorithm>
#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> arr, int k) {
vector<int> answer;
int len = arr.size();
for (int i = 0; i < len; i++) {
if (answer.size() == k) {
break;
}
if (find(answer.begin(), answer.end(), arr[i]) == answer.en... | ALGO | 0.99993 | 5.538984 |
93194d56-4590-47c0-afc8-90d3ad84e14f | ishandutta2007/codeforces | kude/normal/1517/D.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < int(n); ++i)
#define rrep(i,n) for(int i = int(n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
template<class T> void chmax(T& a, const T& b) {a = max(a, b);}
template<class T> void chmin(T... | ALGO | 0.999899 | 3.268903 |
a0437bd3-f0e5-4555-81ba-2834b07945e6 | ishandutta2007/codeforces | cirno_9baka/normal/1340/C.cpp | #include<bits/stdc++.h>
using namespace std;
const int M=998244353;
const int N=200005,E=524288;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
int i,j,n,m,x[N],g,r,f[10005][1005];
int q[10000005],a,b,tmp[100005],t;
long long ans=1000000000000000ll;
int main()
{
#ifndef ONLINE_JUDGE
freo... | ALGO | 0.999974 | 3.248069 |
a90275e7-cd81-497f-8b77-1a51341b4a8a | piyushWaikar/Cpp | Loops/if_else.cpp | #include<iostream>
using namespace std;
int main() {
int savings;
cin>>savings;
if(savings<5000) {
if(savings<=2000){
cout<<"Dinner";
} else {
cout<<"Road Trip";
}
}
else if(savings>5000 && savings<20000 ){
if(savings<7000) {
... | TOOL | 0.864845 | 4.068021 |
97069255-6e8a-4665-ad45-65266da1c2c3 | ishandutta2007/codeforces | tearinfree/normal/578/F.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <utility>
using namespace std;
typedef long long lli;
typedef pair<int,int> pii;
lli mod;
lli power(lli a,lli p) {
lli res=1;
while(p) {
if(p&1) res=res*a%mod;
a=a*a%mod;
p>>=1;
}
return res;
}
lli inv(lli ... | ALGO | 0.999984 | 4.02784 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.