uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ceb7b83a-4152-4688-8823-8abd8037888d | gauravpris/real_estate_flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
c2b353d7-3a24-4748-9797-2d1385efb6e8 | koba-e964/contest | atcoder/kupc2018/j.cpp | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <str... | ALGO | 0.99982 | 3.802705 |
03e62191-21d7-4275-ad99-e6f127bec549 | mireed/LeetCode | 226/226.cpp | /*leetcode 226. Invert Binary Tree
Invert a binary tree.
Example:
Input:
4
/ \
2 7
/ \ / \
1 3 6 9
Output:
4
/ \
7 2
/ \ / \
9 6 3 1
ݹǵݹ
*/
#include <iostream>
#include <queue>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode... | ALGO | 0.999989 | 5.880371 |
856223df-c5d3-41f4-804a-bf27f277d707 | ayushid549/TCS_Striver_Sheet | TCS/Numbers/Positive_Negative.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
//Approach 1
if(n>0)
cout<<"Positive Number"<<endl;
else if(n<0)
cout<<"Negative Number"<<endl;
else
cout<<"Neither Positive nor Negative"<<endl;
// Approach 2
if(n >> 31 == 0)
cout<<"Positive Number"... | ALGO | 0.999923 | 3.719018 |
50cfb4fa-78d6-4b03-bd71-9d1ed71acfda | pranjal9424/Company_coding_question | wipro/21.cpp | #include<iostream>
using namespace std;
int main()
{
long k;
cin>>k;
int m=11;
while(k){
if(m>k%10)
m=k%10;
k/=10;
}
cout<<m;
}
/*
input : 3455627
output : 2
*/ | ALGO | 0.999082 | 3.025366 |
f0595cc4-c99b-45fc-8e4c-a1497e74581a | martinezdiego/competitive-programming | solutions/Leetcode/April Challenge/Week 4/brick_wall.cpp | // There is a rectangular brick wall in front of you with n rows of bricks. The ith row has some number of bricks each of the same height (i.e., one unit) but they can be of different widths. The total width of each row is the same.
//
// Draw a vertical line from the top to the bottom and cross the least bricks. If y... | ALGO | 0.999884 | 6.468631 |
2240a55e-2c54-4b38-8d98-95d3647495ad | avnishsingh516/c-codes | array.cpp | #include<iostream>
using namespace std;
void reverse(int arr[],int size)
{
int l=0;
int r=size-1;
print(arr)
while(l<=r)
{
swap(arr,l,r);
l++;
r--;
}
}
int main()
{
int arr[]={1,2,3,4,5,6,7,8,9};
print(arr,5);
swap(arr,0,4);
print(arr,5);
cout<<(sizeof(arr)/sizeof(int));
return 0;
} | ALGO | 0.996886 | 4.617518 |
ef92f577-ca48-41cf-80c1-21d19fddfc6b | ViktoryaNavasardyan/Repos | vector/vector.cpp | #include "vector.h"
#include <assert.h>
#include <algorithm>
using namespace std;
int vector::m_count = 0;
vector::vector(int s)
{
m_size = s;
m_ptr = new int[m_size];
assert(m_ptr != 0);
for (int i = 0; i < m_size; i++)
m_ptr[i] = 0;
m_count++;
}
vector::vector(int* p, int s)
{
m_size = s;
m_ptr = new int... | TOOL | 0.970922 | 4.291241 |
f92a5fa7-79f3-4688-8205-6c29f36d6be3 | ankitraj311/C-plus-plus | video_71_STL_Vector_float.cpp | #include<iostream>
#include<vector>
using namespace std;
template<class T=float>
void display(T &v) //It will take the object name of vector, which is vec
{
for(int i=0; i<v.size(); i++)
{
cout<<v[i]<<" ";
}
cout<<endl;
}
int main()
{
vector<float> vec; //vector for integer
float element; //varible to take e... | ALGO | 0.921654 | 3.13426 |
26998904-d2a8-45ca-8db4-3489484748cf | rikvdk/codeforces | 1220A.cpp | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int main() {
int n;
string s;
cin >> n;
cin >> s;
for(auto i = count(begin(s), end(s), 'n'); i; --i) cout << "1 ";
for(auto i = count(begin(s), end(s), 'z'); i; --i) cout << "0 ";
}
| ALGO | 0.999736 | 3.432377 |
d88dd223-60ce-47d2-99b8-eabc8f3c750f | dxmvsh/ands | search_range/search_range/main.cpp | //
// main.cpp
// search_range
//
// Created by Dimash on 24.03.2023.
//
//
#include <iostream>
#include "vector"
using namespace std;
vector<int> searchRange(vector<int>& nums, int target) {
vector<int> result;
int n = (int) nums.size(), l = 0, r = n - 1;
int leftmostIndex = -1, rightmostIndex = -1;... | ALGO | 0.999832 | 5.850475 |
915f05ef-0635-426e-ab0f-8e210083aaaa | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4726_2.cpp | #include <bits/stdc++.h>
using namespace std;
const int B = 1000000007;
const int N = 1000001;
int d[N + 5];
int pop(int i) {
int a = 0;
for (; i > 0; i -= i & (-i)) a = (a + d[i]) % B;
return a;
}
int push(int i, int a) {
a = (a + B + B - pop(i) + pop(i - 1)) % B;
for (; i <= N; i += i & (-i)) d[i] = (d[i] +... | ALGO | 0.999973 | 4.344866 |
daf3e73e-21b3-44aa-a797-af2a5e149bad | Gaurav3009/LeetCode | Print N to 1 without loop - GFG/print-n-to-1-without-loop.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void printNos(int N) {
if(N == 0) {
return ;
}
cout<<N<<" ";
printNos(N - 1);
}
};
//{ Driver Code Starts.
/* Driver program to test printNos */
int... | ALGO | 0.999019 | 6.151296 |
dbf10aa9-5111-469c-a62c-e304e9dd5c5e | Jafkrim/TLX-toki-Submissions | Pemrograman Dasar dengan C++/08/B.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
int alas = 1213;
int tinggi = 1619;
double luas = alas * tinggi / 2.0;
cout << fixed << setprecision(1) << luas << endl;
}
| TOOL | 0.993744 | 3.746506 |
61368a56-3c85-478b-b549-60d9f18e86da | raincross7/code-similarity | codes/train_code/problem344/problem344_103.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=ve... | ALGO | 0.999899 | 3.347589 |
fd434351-5d40-4b2f-90a1-381252e41d54 | alswjd20/Computer_Vision | 4주차_Gonzalez 자동 이진화 임계치 결정 프로그램 구현.cpp | #pragma warning(disable:4996)
#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
void Binarization(BYTE* Img, BYTE* Out, int W, int H, BYTE Threshold)
{
int ImgSize = W * H;
for (int i = 0; i < ImgSize; i++) {
if (Img[i] < Threshold) Out[i] = 0;
else Out[i] = 255;
}
}
int GozalezBinThresh(BYTE* Img, ... | ALGO | 0.989611 | 4.096976 |
ba52d058-9d2c-4b84-9770-0396e70929d8 | tomneda/DABstar | src/ofdm/tii-detector.cpp | #include "tii-detector.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(sLogTiiDetector, "TiiDetector", QtWarningMsg)
// TII pattern for transmission modes I, II and IV
static constexpr std::array<const std::byte, 70> cMainIdPatternTable = {
std::byte{0x0f}, // 0 0 0 0 1 1 1 1 0
std::byte{0x17}, // 0 0 0 1... | ALGO | 0.904181 | 5.579762 |
8eb77b96-3eac-4b2f-b6cd-fff5d04e570a | little-czy/luogu | 洛谷题单/1-5 贪心/P4995/P4995.cpp | #include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
ll a[305];
int main()
{
freopen("in.txt", "r", stdin);
ios::sync_with_stdio(false);
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
sort(a + 1, a + n + 1);
ll ans = 0;
int cur = 0;
f... | ALGO | 0.999852 | 3.71777 |
0d169511-1842-4db6-9216-e3971148b2a5 | denis-gubar/Leetcode | all/2150. Find All Lonely Numbers in the Array.cpp | class Solution {
public:
vector<int> findLonely(vector<int>& nums) {
vector<int> result;
int N = nums.size();
vector<int> M(1'000'003);
for (int x : nums)
++M[x + 1];
for (int x = 0; x <= 1'000'000; ++x)
if (M[x] == 0 && M[x + 1] == 1 && M[x + 2] == 0)... | ALGO | 0.999952 | 5.353263 |
8fd4da5e-a6d6-40d6-9c62-0a703de0815f | bartvbl/Shapebench | lib/CGAL-5.6.1/examples/QP_solver/first_nonnegative_lp.cpp | // example: construct a nonnegative linear program from data
// the LP below is the first nonnegative linear program example
// in the user manual
#include <iostream>
#include <cassert>
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
// choose exact integral type
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpz.h>
... | ALGO | 0.963093 | 4.785672 |
d37aa322-8739-407d-8574-12ae27a3a7c0 | Daniel-Alvarenga/Programming_Logic_C | 06.2022/06.13.2022/Vetor par impar.cpp | #include<stdlib.h>
#include<stdio.h>
#include<locale.h>
int main(){
setlocale(LC_ALL,"Portuguese");
int vetor[20], i=0, y=1, vetor1[20], vetor2[20], par=1, impar=1;
const int cont=20;
for(i=0;i<cont;i++){
printf("[%d]Insira um valor desejado:",y);
scanf("%d",&vetor[i]);
system("cls");
... | ALGO | 0.998224 | 3.287677 |
e2a88f06-adb5-4370-a71a-24b5311d50c7 | Danielc2016/LeetCodeCpp | 2265_ Count Nodes Equal to Average of Subtree.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.999781 | 7.253422 |
ff45104c-0d36-45c2-b6e8-afb705b6b810 | ZJU-warren/PAT | PAT - A/Problem_1074.cpp | #include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <string>
#include <map>
#include <stack>
#include <queue>
using namespace std;
#define Fin(i,f,t) for(int i=f;i<=t;++i)
#define Fde(i,f,t) for(int i=f;i>=t;--i)
#define SfI(x) scanf("%d",&x)
#defi... | ALGO | 0.998982 | 3.404676 |
740ac36e-cb9c-477a-90f2-b3068aec48a2 | sirAdarsh/CP-files | CodeForces/466-B.cpp | /*----- || Hare Krishna || -----*/
/* "WHY DO WE FALL, BRUCE?" */
#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
#define elif else if
#define PI 3.1415926535897932384
#define MOD 1000000007
using namespace std;
char alpha[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r... | ALGO | 0.999695 | 3.718233 |
8cfd6dad-93d7-4b2a-a556-572a3a605862 | lxfind/programming | Codechef/JUNE13/WSTRING.cpp | #include <set>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <climits>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#define MID(x,y) ( ( x + y ) >> 1 )... | ALGO | 0.999961 | 3.677952 |
ce3cc85c-b85f-432b-85a3-0715af0c2c8b | emaimona/bsc | Algorithms and Data Structures/optimized_bubble_sort.cpp | #include <iostream>
#include "Funtions.h"
using namespace std;
void sort_arr(vector<int> &a){
int s = a.size();
bool flag; int round = 0;
for(int i = 0; i < s; i++){
flag = false; round++;
for(int j = 1; j < (s-i); j++){
if(a[j] < a[j-1]){
my_swap(a[j], a[j-1]);... | ALGO | 0.999831 | 4.041471 |
502beb53-1277-40b0-8b75-743ec1f9def3 | ipdor/Leetcode | 37. Sudoku Solver.cpp | //https://leetcode.com/problems/sudoku-solver/
//注意:1.验证函数,2.找到一个解就立即返回,此时棋盘就是正确结果
class Solution {
public:
bool valid(vector<vector<char>>& board, int row, int col, int val)
{
for (size_t j = 0; j < 9; j++)
if(board[row][j]==val || board[j][col]==val)
return false;
... | ALGO | 0.999776 | 6.574089 |
fec4b19a-8cea-41cd-b0da-00184f5f8b2a | ROCm/timemory | examples/ex-gpu/v3/ex_kernel_instrument.cpp | #include "gpu_common.hpp"
#include "gpu_device_timer.hpp"
#include "gpu_op_tracker.hpp"
#include "timemory/backends/device.hpp"
#include "timemory/backends/gpu.hpp"
#include "timemory/components/macros.hpp"
#include "timemory/macros.hpp"
#include "timemory/timemory.hpp"
#include <cassert>
#include <chrono>
#include <i... | TOOL | 0.954711 | 6.434191 |
774a7def-e494-4bce-b87a-086f8f5eeb31 | z3t0/godot | thirdparty/graphite/src/direct_machine.cpp | // This direct threaded interpreter implmentation for machine.h
// Author: Tim Eves
// Build either this interpreter or the call_machine implementation.
// The direct threaded interpreter is relies upon a gcc feature called
// labels-as-values so is only portable to compilers that support the
// extension (gcc only as... | TOOL | 0.874561 | 6.405924 |
4938cbff-5200-47cf-b033-98f664184582 | Akash9301/C-DSA | module25 stack/module23 linklist/displayLinklistPointer.cpp | #include<iostream>
using namespace std;
class Node{
public:
int val;
Node *next;
Node(int val){
this->val = val;
next = NULL;
}
};
int main(){
Node * head ;
Node *a = new Node(2);
Node *b = new Node(4);
Node *c = new Node(7);
Node *d = ne... | ALGO | 0.945712 | 3.142362 |
fed160b5-5c74-4868-b68f-2b33400fa338 | StormLight14/godot-4.3-freebsd | thirdparty/squish/singlecolourfit.cpp | #include "singlecolourfit.h"
#include "colourset.h"
#include "colourblock.h"
namespace squish {
struct SourceBlock
{
u8 start;
u8 end;
u8 error;
};
struct SingleColourLookup
{
SourceBlock sources[2];
};
#include "singlecolourlookup.inl"
static int FloatToInt( float a, int limit )
{
// use ANSI ... | ALGO | 0.926155 | 6.218894 |
8b82aef5-0c67-4494-b45f-995574fefd60 | MasoodMohd26/DSA_Practice | LECTURE_27/nextGreaterElt.cpp | #include <iostream>
#include <stack>
using namespace std;
int main()
{
int hts[] ={2,3,2,1,5,4,6,3};
int n = 8;
int ans[n];
stack<int>s;
s.push(0);
for (int i=1; i<n; i++)
{
int current_ht = hts[i];
while(!s.empty() and current_ht > hts[s.top()])
{
ans[s.... | ALGO | 0.999996 | 4.245017 |
1607f1e4-e368-4274-9e70-880cbfb26855 | rzamarefat/cpp_practice | swap_two_numbers.cpp | #include <iostream>
using namespace std;
int main(){
int firstNum = 10;
int secondNum = 20;
int holder;
holder = firstNum;
firstNum = secondNum;
secondNum = holder;
cout << "The first number is " << firstNum << " and the second number is " << secondNum;
return 0;
}
| ALGO | 0.987981 | 3.061541 |
cb9f7f9d-6d3f-4c91-a90c-d2d999929814 | fancy-w-w-w/leetcode-go | internal/cpp/836_matrix_cover.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
bool isRectangleOverlap(vector<int> &rec1, vector<int> &rec2)
{
// x轴上投影
// y轴上投影
// 不重叠
return (min(rec1[2], rec2[2]) > max(rec1[0], rec2[0]) && min(rec1[3], rec2[3]) > max(rec1[1], rec2[1]));
... | ALGO | 0.999024 | 5.13661 |
7e5214cb-c20b-4405-9a15-700272f70662 | bexilin/DVO_SLAM_with_SE_Sync | DVO_SLAM/dvo_slam/src/constraints/constraint_proposal_validator.cpp | #include <dvo_slam/constraints/constraint_proposal_validator.h>
#include <boost/bind.hpp>
#include <algorithm>
namespace dvo_slam
{
namespace constraints
{
ConstraintProposalValidator::Stage::Stage(int id) :
Id(id),
OnlyKeepBest(false)
{
}
ConstraintProposalValidator::Stage& ConstraintProposalValidator::Stage::... | TOOL | 0.968186 | 6.594641 |
b3ae29d4-6d7b-43aa-93c0-478a04f27940 | GaloisInc/verse-ardupilot | libraries/AC_PID/AC_P_1D.cpp | /// @file AC_P_1D.cpp
/// @brief Generic P algorithm
#include <AP_Math/AP_Math.h>
#include "AC_P_1D.h"
const AP_Param::GroupInfo AC_P_1D::var_info[] = {
// @Param: P
// @DisplayName: P Proportional Gain
// @Description: P Gain which produces an output value that is proportional to the current error value
... | ALGO | 0.999248 | 5.985882 |
1e7c348d-b872-4504-96c7-b34c92a86370 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4214_8.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin >> x;
if (x == 0) {
cout << "YES\n1\n2\n2\n3\n";
} else if (x == 1) {
int ip1;
cin >> ip1;
cout << "YES"
<< "\n"
<< 2 * ip1 << "\n"
<< 2 * ip1 << "\n"
<< 3 * ip1 << "\n";
} else if (x == 2... | ALGO | 0.999829 | 3.155123 |
67e6ff4e-2d08-41db-b2e0-8c8e1716c369 | ad-itya-8788/My-C-language-Practice | Pattern 8 Program/invertedstar..cpp | //inverted star
#include <stdio.h>
int main()
{
int n, i, j;
printf("Enter number of rows: ");
scanf("%d", &n);
for(i = n; i >= 1; i--)
{
for(j = 1; j <= i; j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
| ALGO | 0.999817 | 3.676539 |
08c56e46-8584-4b01-8413-e1b6a767e27a | SHUBHAM-BHATTACHARYA/C-Plus-Plus | Part 1/reverse.cpp | #include<iostream>
#include<cstdio>
using namespace std;
class Reverse
{
private:
int i,k,l;
char s[10];
public:
Reverse(int m,int n)
{
i=m;
l=n;
}
void input()
{
cout << "Enter the Name:";
gets(s);
}
void output()
{
for(i=0;s[i]!='\0';i++)... | ALGO | 0.99886 | 3.385638 |
753e5629-f655-4c5e-8ea9-8c23be8cb833 | dldydrhkd/Problem-Solving | 백준/10000~20000/14709.cpp | #include <iostream>
using namespace std;
int arr[6][6];
int main(){
int n;
cin >>n;
for(int i=1; i<=n; i++){
int a,b;
cin >>a>>b;
arr[a][b]=1;
arr[b][a]=1;
}
for(int j=1; j<=5; j++){
if(arr[2][j]==1){
cout<<"Woof-meow-tweet-squeek\n";
... | ALGO | 0.99997 | 3.544525 |
dc1ff578-0bc1-47bf-8e5c-380ed5e7b89c | kushaltiwari18/C-PW | Questions/Linked_list/Singly_linked_list/basicCRUD/deleteAtPosition.cpp | #include<iostream>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int data){
val = data;
next = NULL;
}
};
void insertAtHead(Node* &head, int val){
Node* new_node = new Node(val);
new_node->next = head;
head = new_node;
};
void deleteAtHead(Node* &... | ALGO | 0.99983 | 4.478653 |
9ca345fb-0439-447f-8e13-208d1f849d2b | Zu-rin/AtCoder | AtCoder_Beginner_Contest/ABC153/ABC153F.cpp | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define MOD 1000000007
#define INF 1 << 30
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pp;
int main(void) {
ll num, i, w, k, a... | ALGO | 0.999956 | 3.619796 |
9e8995e5-6af9-4776-890b-8ea98ecfdd60 | raghav161/Leetcode | 1889-check-if-number-is-a-sum-of-powers-of-three/1889-check-if-number-is-a-sum-of-powers-of-three.cpp | class Solution {
public:
bool checkPowersOfThree(int n) {
while (n > 0) {
int remainder = n%3;
if (remainder==2)
return 0;
n /= 3;
}
return 1;
}
}; | ALGO | 0.999623 | 5.513194 |
b11da7d5-3751-4c5a-833b-581758644062 | ishandutta2007/codeforces | itst/normal/1080/D.cpp | #include<bits/stdc++.h>
#define int long long
//This code is written by Itst
using namespace std;
inline int read(){
int a = 0;
char c = getchar();
bool f = 0;
while(!isdigit(c) && c != EOF){
if(c == '-')
f = 1;
c = getchar();
}
if(c == EOF)
exit(0);
while(isdigit(c)){
a = a * 10 + c - 48;
c = getc... | ALGO | 0.999956 | 3.64603 |
4d25b720-0cf3-42f6-b0a8-e79f4b2eed2d | igorlev91/Leetcode | Algorithms/0235.LowestCommonAncestorOfBinarySearchTree/solution.cpp | #include "TreeNode.h"
#include "TreeNodeUtils.h"
#include "gtest/gtest.h"
using CommonLib::TreeNode;
namespace
{
class Solution
{
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) const
{
TreeNode* left = p->val < q->val ? p : q;
TreeNode* right = q->val > p->v... | TEST | 0.999589 | 7.35212 |
2263d7c2-bc7a-4b34-91ee-f710806a7890 | rishab0902/GFG-LEETCODE-DSA-SOLUTIONS | Replace O's with X's - GFG/replace-os-with-xs.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
private:
void dfs(int row,int col,vector<vector<int>> &vis,vector<vector<char>> &mat,int delrow[],int delcol[]){
vis[row][col]=1;
... | ALGO | 0.999872 | 6.429057 |
42b3e480-3b16-4440-a3c9-2626d8099dfd | Katie927/CTDLGT_CodePTIT | DSA01027.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void sinhHoanVi(int arr, int n){
for(int i=0 ; i<n ; i++){
}
}
void Dost()
{
int n;
cin>>n;
int arr[11];
for(int i=1 ; i<=n ; i++){
cin>>arr[i];
}
arr[0] = 0;
sort(arr, arr+n+1);
// for(int i... | ALGO | 0.999991 | 3.654092 |
c7a1207c-27b0-4f8a-8e72-a6387eb9287c | fztfztfzt/leetcode | easy/7 Reverse Integer.cpp | /*
Reverse Integer
Total Accepted: 99382 Total Submissions: 423096 Difficulty: Easy
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
https://leetcode.com/problems/reverse-integer/
*/
12ms
int reverse(int x) {
long long n=0;
if(x==INT_MIN) return 0;
... | ALGO | 0.999744 | 5.272405 |
6e3b322f-449c-4fb2-8c07-fa63f01e25f6 | halogenOS/android_external_aac | libFDK/src/scale.cpp |
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Frderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
T... | TOOL | 0.892806 | 3.655481 |
7f4a491e-f20a-4e27-abf9-3bf02263047b | Shubhamsk1/cp | recursion/larry.cpp | #include<bits/stdc++.h>
using namespace std;
bool issort(vector<int> v)
{
vector<int> k=v;
sort(k.begin(),k.end());
if(k==v)
{
return true;
}
return false;
}
bool rotatepos(vector<int> v)
{
if(issort(v))
{
return true;
}
for(int i=0;i<=(v.size()-3);i++)
{
... | ALGO | 0.999975 | 3.870524 |
5152ca95-2de0-4bc8-9bf5-2cb6e85b465d | dmehrab06/Time_wasters | codeforces/hello19/C.cpp | #include <bits/stdc++.h>
using namespace std;
int first[100005];
int second[100005];
char bracket[500005];
void process(int idx){
int l = strlen(bracket);
int s = 0;
stack<int>bck;
for(int i = 0; i<l; ++i){
if(bracket[i]=='('){
bck.push(1);
}
else{
if((int)bck.size()==0){
s++;
}
else{
... | ALGO | 0.999507 | 4.175639 |
50898d93-0756-4936-b7b1-59cab6e82d0a | rohanxxx/leetcode | 0041-first-missing-positive/0041-first-missing-positive.cpp | class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
vector<int> seen(nums.size()+1, 0);
for(auto num: nums){
if(num > 0 && num <= nums.size()){
seen[num]++;
}
}
for(int i = 1; i <= nums.size(); i++){
if(!seen[i]) ... | ALGO | 0.999933 | 5.08603 |
2c8c044a-29f4-4ceb-8a26-b936cf40f611 | Manoloon/Exercism | Src/prime_factor.cpp | //
// Created by Manoloon on 06/03/2022.
//
#include "prime_factor.h"
namespace prime_factors
{
std::vector<int> of(int number)
{
if(number <=1){return {};}
if(number == 2){return {2};}
std::vector<int>list;
for(int j=2;j<=number;j++)
{
while(number%j==0)
... | ALGO | 0.996908 | 5.084707 |
cdcfd45f-5c4d-466b-9b97-04bfd4f82fc0 | harshul21/Love-Babber-Sde-Sheet | LinkedList/Intersection Point in Y Shapped Linked Lists.cpp | //Problem Link:- https://practice.geeksforgeeks.org/problems/intersection-point-in-y-shapped-linked-lists/1
//Time Complexity:- O(N+M)
/* Linked List Node
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
}; */
//Function to find intersection point in Y shaped Linked Lis... | ALGO | 0.999971 | 4.733799 |
e1c98cb9-1779-444d-8be2-ccf99dfd2d72 | ishandutta2007/codeforces | rush_d_cat/normal/691/E.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cstring>
#include <set>
#include <map>
using namespace std;
#define fi first
#define se second
//#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define rep(i, a, b) for (int i=(a);i<=(b);i++)
#define dd(x) co... | ALGO | 0.999984 | 4.167357 |
02a015a0-3a96-43c4-8156-b6c3100bd6c5 | Zacharias030/llvm_66616 | libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// template<input_iterator I, sentinel_for<I> S, class T1, class T2,
// output_iterator<const T2&> O, class Proj = identity>
// requires indirectly_copyable<I, O> &&
// indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*>
// const... | TEST | 0.898223 | 7.700198 |
2b08ad86-c898-4360-8e4f-744bedd0c8e8 | Lee-Jungyu/algorithm | programmers/42577.cpp | #include <string>
#include <vector>
using namespace std;
bool solution(vector<string> phone_book) {
bool answer = true;
for(int i = 0; i < phone_book.size(); i++)
{
for(int j = 0; j < phone_book.size(); j++)
{
if(phone_book.at(i).size() == phone_book.at(j).size())
... | ALGO | 0.999196 | 4.849579 |
cf118ae3-e68e-42b5-852f-4ae553a056a2 | C-2024-4-6/240502duchi | expr1.cpp | #include <iostream>
using namespace std;
int gcd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
void gcdAndLcm(int m, int n, int& lcm) {
int greatestCommonDivisor = gcd(m, n);
lcm = m * n / greatestCommonDivisor;
}
int main() {
int m, n;... | ALGO | 0.999536 | 4.95391 |
b806e0a1-3e21-4e33-aa3b-195f5f868700 | adoptium/aarch32-jdk8u | hotspot/src/share/vm/opto/mulnode.cpp | #include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "opto/addnode.hpp"
#include "opto/connode.hpp"
#include "opto/memnode.hpp"
#include "opto/mulnode.hpp"
#include "opto/phaseX.hpp"
#include "opto/subnode.hpp"
// Portions of code courtesy of Clifford Click
//===================================... | ALGO | 0.984896 | 7.06306 |
2ee48714-9258-4116-ad0b-81d0bcd73aa1 | JoanaMota/LearnCPP | Algorithms/LinkedLists/merge_k_sorted_lists.cpp | #include <iostream>
#include <vector>
#include <queue>
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) {}
};
struct compare
{
bool operator()(ListNode *l, ListNode *r... | ALGO | 0.999797 | 5.707125 |
e163165c-dee9-40da-b5be-1a631e934d7f | SalmanSi/30_Days_Of_Leetcode | 15-3sum/3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> result;
int len = nums.size();
int conjugate;
int s, e;
vector<int> res;
sort(nums.begin(), nums.end());
for (int i = 0; i < len; i++) {
if (i > 0 && nu... | ALGO | 0.999877 | 5.734975 |
3a77f6ae-90bd-4847-89bb-9d8d5cdf3388 | sevdeaydiin/TerraMobileInterview | 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 |
31e9cefa-fabf-4041-8843-1f70d9795f3b | pavanpvl/cp_problems | Algorithms/endoscope_new.cpp | #include <iostream>
#include <queue>
#define qSize 100
using namespace std;
int arr[51][51];
int a[51][51];
struct positions
{
int x, y;
};
positions Queue[qSize];
int front, rear;
void Push(int x, int y)
{
Queue[rear].x = x;
Queue[rear].y = y;
rear++;
}
positions Pop()
{
return Queue[front++];
... | ALGO | 0.999694 | 3.432085 |
f09cb7c0-3a2b-45bc-9612-b1e011b9af00 | ishandutta2007/codeforces | 01191020csl/normal/1515/B.cpp | #include<bits/stdc++.h>
using namespace std;
bool checksq(int n) {
int l = 1, r = n;
while (l < r) {
int mid = (l + r + 1) / 2;
if (1ll * mid * mid > n) r = mid - 1;
else l = mid;
}
return 1ll * l * l == n;
}
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
if ((n % 4 == 0 && checksq(n/4)... | ALGO | 0.999515 | 5.530048 |
08c3018c-2897-4655-afeb-a593a3eda6e6 | gaiascosta/Coltec | TP/C++/basicProd.cpp | #include <iostream>
#define SUCESSO 0
using namespace std;
int main() {
int a, b;
std::cin >> a;
std::cin >> b;
std::cout << "PROD = " << (a * b) << "\n";
return SUCESSO;
} | ALGO | 0.99628 | 4.330212 |
890937a0-1fee-46bf-be51-fe4560c6d722 | vinodkgupta96/CompetitivePrograms | Codechef/ZCO14003.cpp | // Example program
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
long long N; cin>>N;
vector<long long> vec(N);
for(int i=0;i<N;i++)cin>>vec[i];
sort(vec.begin(),vec.end());
long long sum =0;
for(int i=0;i<N;i++)
{
... | ALGO | 0.999984 | 3.71335 |
736f1a83-70ce-46c6-a4b0-f8b9d536f4bc | EyeRunnMan/DSA | Array/doubleStock.cpp | #include<iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int n=7;
int arr[7];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int maxProfit=0;
for (int i = 2; i < n-2; i++)
{
int oneMax=0;
for (int j = 0; j < i; j++)
{
... | ALGO | 0.999776 | 3.960957 |
22d6da98-cac9-453e-938c-af1d33607272 | djm-1/CodingInterviewPrep | 367-valid-perfect-square/367-valid-perfect-square.cpp | class Solution {
public:
bool isPerfectSquare(int num) {
long long left=1;
long long right=num;
while(left<=right)
{
long long mid=left+(right-left)/2;
if(mid*mid==num)
return true;
if(mid*mid<num)
... | ALGO | 0.999879 | 5.664522 |
058585ec-283e-4133-8253-fce0847a8e22 | ravenn3105/LeetCode | 1993-sum-of-all-subset-xor-totals/sum-of-all-subset-xor-totals.cpp | class Solution {
public:
int subsets(const vector<int>& nums, int index, int currentXOR) {
if (index >= nums.size()) {
return currentXOR;
}
return subsets(nums, index + 1, currentXOR ^ nums[index]) + subsets(nums, index + 1, currentXOR);
}
int subsetXORSum(vector<int>& nums)... | ALGO | 0.99998 | 6.109425 |
815e87a6-d971-42c2-8c2a-ba37c8b67264 | LucaCraft89/C_Class3AIA | 2024.01.23_pok/ex1.cpp | //
// Created by lucac on 2024/01/23.
//
#include <iostream>
#include <fstream>
using namespace std;
const int MAXp=10;
const string fileName = "collection.pok";
struct pokemon
{
string name;
string type;
int level;
int hp;
};
bool pokemonexists(string name, pokemon p[]) {
for (int i = 0; i < MA... | TOOL | 0.869979 | 4.954382 |
a90f55ee-df0a-46f7-b247-01dd5e986d81 | rosmontisu/SolveBOJ | Graph/BFS-DFS/1926 그림.cpp | #include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
queue<pair<int, int>> Q;
bool vis[502][502];
int map[502][502];
int n, m;
int dx[4] = { -1, 0, 1, 0 };
int dy[4] = { 0, 1, 0, -1 };
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
for (int i = 0; i < n; i++)
... | ALGO | 0.999523 | 4.021222 |
87c52290-24e4-460e-a6e9-91a3f50e40b8 | tripathiaman0709/-leetcode | 2976-Minimum-Cost-to-Convert-String-I.cpp | class Solution {
public:
void fw(vector<char>& original, vector<char>& changed,vector<int>&cost,vector<vector<long long>>&adj){
for(int i=0;i<original.size();i++){
int o=original[i]-'a';
int c=changed[i]-'a';
adj[o][c]=min(adj[o][c],(long long)cost[i]);
... | ALGO | 0.999989 | 5.519696 |
115d9175-e4c7-4373-ae90-0ea1bf2c8839 | Bliss-Elite/platform_system_core | init/property_service.cpp | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <stdarg.h>
#include <dirent.h>
#include <limits.h>
#include <errno.h>
#include <sys/poll.h>
#include <memory>
#include <cutils/misc.h>
#include <cutils/sockets.h>
#include <cutils/multiuser.h>... | TOOL | 0.889025 | 7.049738 |
37f4ef4b-b70c-4867-b5fa-1f6eba38d03d | sarvex/leetcode-elm | solution/1300-1399/1305.All Elements in Two Binary Search Trees/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.999983 | 5.779255 |
0538934e-6f1e-4167-aac0-570b346f3feb | ssaha-github/CPP-DSA-by-own | findnoofdigit.cpp | //Find no of digit
#include<iostream>
using namespace std;
int main()
{
int num,count=0;
cout<<"Enter number: ";
cin>>num;
while(num>0)
{
num=num/10;
count++;
}
cout<<count;
return 0;
} | ALGO | 0.999502 | 3.410795 |
5cbd22f6-b058-4396-bbbd-be42db47247f | Hifzu04/dsa_pratice1 | lagestBand.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int count = 1;
int maxm = 0;
vector<int> vec = {1, 9, 3, 0, 18, 5, 2, 4, 10, 7, 12, 6};
sort(vec.begin(), vec.end());
for (auto it : vec)
{
cout << it << " ";
}
cout << endl;
for (in... | ALGO | 0.999767 | 3.867296 |
5b738cb4-a0c1-4478-9ca5-c1888d411926 | SifatSwapnil2022/CodeChef | Largest Subsequence.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string a;
int n;
cin >> n>>a;
int maxCount = 0;
for (int i = 0; i < n; i++) {
if (a[i] == a[0]) {
maxCount = max(maxCount, i + 1)... | ALGO | 0.999734 | 5.025485 |
ae4e941c-e7a3-4c20-a6da-f20326ba562a | GDV-Proyectos3/Motor-Ola | MotorOla_Solution/Dependencies/PhysX-4.1/Src/physx/samples/sampleframework/renderer/src/RendererProjection.cpp | using namespace SampleRenderer;
RendererProjection::RendererProjection(float fov, float aspectRatio, float nearPlane, float farPlane)
{
RENDERER_ASSERT(farPlane > nearPlane, "Cannot construct a Projection Matrix whose nearPlane is further than the farPlane.");
memset(m_matrix, 0, sizeof(m_matrix));
float fd = 1/ta... | ALGO | 0.95792 | 6.748636 |
5bec4453-f84f-4c8e-9f9e-493eb655572e | rajuahmed118124r/Codeforces | 1769_A_Greatest_Convex.cpp | ///BISMILLAHIR RAHMANIR RAHIM
///============================
/*
Problem name : A. Greatest Convex
Problem link : https://codeforces.com/problemset/problem/1768/A
Platform : Codeforces
Author ... | ALGO | 0.999742 | 4.826473 |
d01da487-ddb2-4bf8-a64f-45ecb2f0b85e | mahtab04/Cpp-Programs | CodeChef/atm.cpp | // Pooja would like to withdraw X $US from an ATM. The cash machine will only accept the transaction if X is a multiple of 5, and Pooja's account balance has enough cash to perform the withdrawal transaction (including bank charges). For each successful withdrawal the bank charges 0.50 $US. Calculate Pooja's account ba... | ALGO | 0.999774 | 3.859137 |
b9dc9f74-9a76-470e-baa2-25275e036d62 | AlaminPu1007/leet-code | Leet-Code/84. Combination sum/Combination_sum.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
void findCombination(int ind, int target, vector<int> &arr, vector<vector<int>> &ans, vector<int> &ds, int len)
{
// base case
if (ind == len)
{
if (target == 0)
{
ans.push_bac... | ALGO | 0.999932 | 5.548395 |
682f4170-4042-4d40-bbba-82df71abb728 | shreystudent24/LeetCode | 701-insert-into-a-binary-search-tree/701-insert-into-a-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.999973 | 6.228553 |
c143a55e-0db9-460d-838c-77a0c6310286 | rijulsharma7/problemsolving | CPcontests/primeTimeCodeJam2021.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using mi = map<int, int>;
using ml = map<ll, ll>;
using umi = unordered_map<int, int>;
using uml = unordered_map<ll, ll>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using ti = tuple<int, int, int>... | ALGO | 0.999451 | 4.058794 |
a1bb5f72-f0ad-436c-aed0-b8b520220261 | raincross7/code-similarity | codes/train_code/problem468/problem468_292.cpp | #include <bits/stdc++.h>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<string.h>
using namespace std;
#define pb push_back
#define all(v) v. begin(),v. end()
#define rep(i,n,v) for(i=n;i<v;i++)
#define per(i,n,v) for(i=n;i>v;i--)
#define ff first
#define ss second
#define pp pair<l... | ALGO | 0.999747 | 3.263625 |
1327f214-e153-4dca-984b-3685a37fb32e | zjsxzy/binarysearch | Reverse Graph/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
vector<vector<int>> solve(vector<vector<int>>& graph) {
int n = graph.size();
vector<vector<int>> radj(n);
for (int u = 0; u < n; u++) {
for (auto v: graph[u]) {
radj[v].push_back(u);
}
}
return radj;
}
... | ALGO | 0.999456 | 4.459839 |
204c3941-8de3-48c0-b324-99a6886395bc | ishandutta2007/codeforces | littlelittlehorse/normal/489/B.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
struct node{
node *next;
int where;
} *first[101], a[100001];
int n, e[101], ans, m, r[101], l, v[101];
bool b[101];
inline void makelist(int x, int y){
... | ALGO | 0.999927 | 3.440388 |
bcba17cc-6639-49d4-9b2a-f577dd1c542f | HarshSantoshi/Important-Ques | Microsoft/Rehabilitation.cpp | #include<bits/stdc++.h>
using namespace std;
long long solution(vector<int>&A , int x, int y){
int n = A.size();
vector<long long>prefix(n+1 , 0);
for(int i=0;i<y;i++){
prefix[i] = A[i];
}
for(int i=y;i<n;i++){
prefix[i] = A[i] + prefix[i-y];
}
long long ans = 1e16;
f... | ALGO | 0.999953 | 3.926682 |
ba163b1e-2cab-4ff9-984e-54e777dc4218 | yashsiwach/Leetcode-CPP | 1036-rotting-oranges/1036-rotting-oranges.cpp | class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
int timer=0;
queue<pair<pair<int,int>,int>>q;
int n=grid.size();
int m=grid[0].size();
vector<vector<bool>>visi(n,vector<bool>(m,false));
vector<int>v1={-1,0,1,0};
vector<int>v2={0,1,0,-1... | ALGO | 0.999969 | 6.088007 |
2c1182ed-66fb-4dd3-8ec0-9e52e193f0bc | JoydeepMallick/CODEFORCES | 11.7.24 Codeforces Round 957 (Div. 3)/B.cpp | /*
_________________________
| Written by silent_Joy |
---------~u~---------
*/
#include "bits/stdc++.h"
#pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("bmi,bmi2,lzcnt,popcnt")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") //intel pentium processors
// released post 2020 support avx2, u... | ALGO | 0.999872 | 4.459816 |
a9bd69c4-a16d-48d2-bc2c-06de7930789a | Bhavna-patil/DS_Implementation | DynArrQueue.cpp | #include<iostream>
#include<stdlib.h>
#define Queue_Underflow 1
using namespace std;
class DynArrQ
{
private:
int capacity;
int front;
int rear;
int *ptr;
protected:
void doubleArr();
void halfArr();
public:
DynArrQ(int);
DynArrQ(DynArrQ&);
DynA... | ALGO | 0.998412 | 4.078476 |
deaf6508-435a-432b-b889-5a1d7eee0ff9 | rasazim/COL106 | Assn 7/qna_tool.cpp | #include <assert.h>
#include <sstream>
#include "qna_tool.h"
using namespace std;
size_t find(vector<string>& v, string& s) {
for (size_t i = 0;i < v.size();i++) {
if (v[i] == s) return i;
}
return -1;
}
QNA_tool::QNA_tool(){
// Implement your function here
ifstream word_counter("unigra... | ALGO | 0.985426 | 4.113963 |
42d3c026-a911-48ed-b668-5b5a3a818a26 | zecht12/C | c new/UTS/.history/UTS_220103092_GIlang Prima Ertansyah_20230511121620.cpp | #include <stdio.h>
using namespace std;
int main() {
int arr[] = {50, 32, 54, 12, 95, 31, 11, 91};
int n = sizeof(arr) / sizeof(arr[0]);
int i, index, j;
printf("UTS Pemrograman C\n");
printf("================================================\n");
printf("Nama: Gilang prima Ertansyah\n");
p... | ALGO | 0.999959 | 5.076128 |
ec540452-5193-4ae6-b894-fc84003fe23e | vaibhavpareek/CPPNotes | operator overloading/unary/friend function with return.cpp | #include<iostream>
using namespace std;
class number
{
private:
int x;
public:
number()
{
x=0;
}
number(int n)
{
x=n;
}
void showdata()
{
cout<<endl<<x;
}
friend number operator-(number);
};
number operator-(number obj)
{ number temp;
temp=-obj.x;
return ... | ALGO | 0.973455 | 3.762413 |
b9f91f9d-c4b7-4028-93fa-0e5e5b2d5689 | AdityaDabgotra/dsaQuestions | Take_U_Forward/BINARY_SEARCH/no_of_times_array_rotated.cpp | #include<bits/stdc++.h>
using namespace std;
// Bruteforce Approach
int rotated1(vector<int>&arr){
int min_idx = arr.size();
int min_ele = INT_MAX;
for (int i = 0; i < arr.size(); i++){
if(arr[i]<min_ele){
min_idx = min(min_idx,i);
}
}
return min_idx;
}
// Optimied Ap... | ALGO | 0.999987 | 5.466453 |
ef7fb5d3-0bff-4600-96fb-d62d133e0976 | andrewzolotukhin/leetcode | P01982FindArrayGivenSubsetSums/solution.cpp | class Solution {
public:
vector<int> recoverArray(int n, vector<int> &sums) {
sort(sums.begin(), sums.end());
vector<int> result;
while (sums.size() > 1) {
if (sums.size() == 2) {
result.push_back(sums[0] + sums[1]);
break;
}
vector<int> f, s;
bool firstHasZero = ... | ALGO | 0.999972 | 5.507922 |
4263e767-f00c-4955-91de-0842486d0f3b | SWMFsoftware/AMPS | srcTitan/TGITM_interpolate.cpp | //$Id$
#include <iostream>
#include <fstream>
#include <sstream>
//#include <array>
#include "Titan.h"
using namespace std;
const int nd = Titan::tgitm_exobase::ndes, nc = Titan::tgitm_exobase::nclmns,
np = Titan::tgitm_exobase::nintp,on=1,off=0,nspc=PIC::nTotalSpecies;
double Titan::tgitm_exobase::tgitm_grid[nd... | ALGO | 0.989667 | 3.829475 |
a470dfa7-f855-4e44-be66-5d21040e2039 | DulalDh/Online-Judge | Light OJ/1046 - Rider.cpp | #include<cstdio>
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<queue>
#define inInt(n) scanf("%d",&n)
#define inLong(n) scanf("%ld",&n)
#define inLong2(n,m) scanf("%ld%ld",&n,&m)
#define inLL(n) scanf("%lld",&n)
#defi... | ALGO | 0.99988 | 3.310025 |
45866af1-5aa1-47c2-880a-9f3812307cd4 | gkichaev/PAINTOR_V2.1 | nlopt-2.4.2/eigen/bench/product_threshold.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
#define END 9
template<int S> struct map_size { enum { ret = S }; };
template<> struct map_size<10> { enum { ret = 20 }; };
template<> struct map_size<11> { enum { ret = 50 }; };
template<> struct ... | TOOL | 0.965337 | 5.102006 |
bb9245ee-55e0-45fd-9e78-6293fdeaf5af | Stark032702/lab-px4 | src/modules/commander/mag_calibration.cpp | /**
* @file mag_calibration.cpp
*
* Magnetometer calibration routine
*/
#include "mag_calibration.h"
#include "commander_helper.h"
#include "calibration_routines.h"
#include "lm_fit.hpp"
#include "calibration_messages.h"
#include "factory_calibration_storage.h"
#include <px4_platform_common/defines.h>
#include <p... | TOOL | 0.974682 | 4.444992 |
af67bf5e-0ade-49db-a388-776c39d4664f | ishandutta2007/codeforces | dorost/normal/1513/D.cpp | /* * In the name of GOD */
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
const int N = 201234;
int a[N], p[N], sz[N];
pair <int, int> b[N];
ll mst;
int num;
int get_root (int x) {
if (p[x] == x)
return x;
return p[x] = get_root(p[x... | ALGO | 0.999968 | 3.551138 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.