uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
794ebde4-2c74-41fa-b9b1-5d9fb291e1e4 | mayuresh-tech/Competitive_Practise | codeforces/A-Next_Round.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
int main() {
fast_cin();
int n = 0, k = 0, count = 0;
cin >> n >> k;
int arr[10000];
for(int i = 0; i < n; i++) {
cin >> arr[i];
... | ALGO | 0.999968 | 3.883174 |
6c2e68fb-d32d-4fa7-b346-ffad69263244 | Janengh69/numerical_methods | Solving equations with one unknown/main.cpp | #include "Header.h"
int main() {
int* length = (int*)malloc(sizeof(int));
vector<tab> iterNumb1;
vector<tab> iterNumb2;
range* temp = rangeSelection(length);
if ((*length) > 0) {
tableIter(temp, length, iterNumb1);
tableTangent(temp, length, iterNumb2);
tableCompare(iterNumb1, iterNumb2);
}
system("pause... | ALGO | 0.86982 | 3.479362 |
b313331b-d849-4422-828d-07a5810d607c | interviewing/questions | my100.cpp | #include <iostream>
#include <cstdio>
int find_count(const int target, const int current, const int* numbers, const int size)
{
int total = 0;
for (int i = 0; i < size; ++i) {
const int value = numbers[i];
const int new_current = current + value;
if (new_current == target) {
... | ALGO | 0.999774 | 5.133119 |
d1c4bfb7-d41a-4c18-a307-22c6299e9fd7 | TuringKi/llvm-project-12-wasi | llvm/tools/llvm-xray/xray-converter.cpp | #include "trie-node.h"
#include "xray-registry.h"
#include "llvm/DebugInfo/Symbolize/Symbolize.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_o... | TOOL | 0.951106 | 7.581527 |
069b91c7-c171-47c8-baca-16b3977dfd79 | dllu/puppybrot | buddhabrot.cpp | #include <chrono>
#include <complex>
#include <future>
#include <iostream>
#include <png++/png.hpp>
#include <random>
#include <thread>
#include <vector>
using idx = std::ptrdiff_t;
using pt = std::complex<double>; // a point in real life
using px = std::pair<idx, idx>; // pixel in the image
class buddhabrot {
... | ALGO | 0.999599 | 5.81656 |
9bef5e3e-2c1b-4207-ae43-b744f554e2fe | ak91456/my-codes | min heap.cpp | #include <iostream>
#include <vector>
class MinHeap {
private:
std::vector<int> heap;
void siftUp(int index) {
int parentIndex = (index - 1) / 2;
if (index > 0 && heap[index] < heap[parentIndex]) {
std::swap(heap[index], heap[parentIndex]);
siftUp(parentIndex);
... | ALGO | 0.998925 | 5.639264 |
bdc13424-6e83-43b0-b39e-ef491d5a784f | JohnItoo/Solvay | codeforces/rounds/CF-1497C2.cpp | // Problem: C2. k-LCM (hard version)
// Contest: Codeforces - Codeforces Round #708 (Div. 2)
// URL: https://codeforces.com/problemset/problem/1497/C2
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
using namespace std;
#define _CRT_SECURE_NO_DE... | ALGO | 0.999808 | 4.395349 |
1b342466-7742-4ace-85cd-a429d27451a9 | JedizR/POSN64_Camp1 | technique/stock.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[1000100],a[1000100];
int main()
{
int n,i,q,r,s;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
dp[i]+=dp[i-1];
if(a[i]>a[i-1])
dp[i]+=(a[i]-a[i-1]);
}
scanf("%d",&q);
while(q--)
{
... | ALGO | 0.999869 | 3.717453 |
8f1b8f7f-c241-481d-b765-5df48d03db29 | leehayeong/Algorithm | BOJ_cpp/backtracking/15650.cpp | #include <cstdio>
#include <vector>
using namespace std;
/*
ߺ , =
N ߿ M ̱
*/
int n, m;
bool visited[8];
vector<int> v;
void dfs(int idx, int cnt) {
// m ̱Ⱑ
if (cnt == m) {
for (int i = 0; i < v.size(); i++) {
printf("%d ", v[i]);
}
printf("\n");
return;
}
// m ̱. index.
for (int i = idx; i ... | ALGO | 0.999949 | 3.989611 |
b0c1b658-2f51-45d1-b64a-04f48835b957 | aidy813/neoscoin | src/bitcoinrpc.cpp | #include "chainparams.h"
#include "init.h"
#include "util.h"
#include "sync.h"
#include "ui_interface.h"
#include "base58.h"
#include "bitcoinrpc.h"
#include "db.h"
#include <boost/algorithm/string.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/bind.hp... | WEB | 0.973195 | 4.672088 |
b422d086-123d-4062-af46-268ac8b10536 | PranavMahara/CPP | Online Projects/Project-19.cpp | // Write a program in C++ to compute the total and average of four numbers.
#include<iostream>
using namespace std;
int main(){
int a, b, c, d;
cout<<"Enter a, b, c, d --> ";
cin>>a>>b>>c>>d;
cout<<"The average of 4 numbers are "<<(a+b+c+d)/4.0;
return 0;
} | ALGO | 0.993764 | 3.841636 |
ccfac48f-92c6-43be-9647-579abf5fafca | linneszyx/CP-Problems | 820-find-eventual-safe-states/find-eventual-safe-states.cpp | class Solution {
public:
bool dfs(vector<vector<int>>& graph, int cur, vector<int>& color) {
if (color[cur] > 0) return color[cur] == 2;
color[cur] = 1;
for (int i : graph[cur]) {
if (color[i] == 2) continue;
if (color[i] == 1 || !dfs(graph, i, color)) return false;
... | ALGO | 0.999957 | 6.1428 |
02fd7e13-552d-4472-bc97-45bf60cadf9a | David-5-5/tutorial | cplus/leetcode/202506/algo0823.cpp | #include <bits/stdc++.h>
using namespace std;
// 动态规划 - 其他
class Solution {
public:
int numFactoredBinaryTrees(vector<int>& arr) {
// 自行解答,不需要质因子分解
// 质因子分解的组合数还挺复杂
int n = arr.size(), mod = 1e9 + 7;
sort(arr.begin(), arr.end());
unordered_map<int,int> hash;
for (int... | ALGO | 0.999983 | 5.553261 |
4ee96c6d-fbda-4a1b-b196-6d0bca72572f | sneha390/DSA_Track | uptoianTree.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
/*
* Complete the 'utopianTree' function below.
*
* The function is expected to return an INTEGER.
* The function accepts INTEGER n as parameter.
*/
int utopianTree(int n) {
int height = 1;
for(in... | ALGO | 0.999947 | 6.120136 |
d0501aff-0425-4fbd-9471-8e44f0d324ca | boris768/csgochanger | CSGOSimple/Utils.cpp | #include "Utils.hpp"
#include <random>
#include <fstream>
#include "XorStr.hpp"
#include "CustomWinAPI.h"
#include "Hooks.hpp"
#include <ctime>
#define INRANGE(x,a,b) ((x) >= (a) && (x) <= ((b)))
#define getBits( x ) (INRANGE(((x)&(~0x20)),'A','F') ? (((x)&(~0x20)) - 'A' + 0xa) : (INRANGE(x,'0','9') ? (x) - '0' : ... | TOOL | 0.963816 | 4.89316 |
bba90679-e5d5-470b-9c2e-8fca47b9c439 | Ryednap/Contest | Ujjwal/Halim/Ch2/Linear/11039.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "uj.h"
#endif
// Direct easy problem greedy just use up all the best items O(nlogn) complexity.
int main( ) {
int qq;
scanf("%d", &qq);
while( qq-- ) {
int n;
scanf("%d", &n);
int arr[n];
for(int i = 0 ; i < n; ++i) {
scanf("%d", &arr[... | ALGO | 0.999952 | 4.310751 |
5bbdc989-3815-40a1-ada9-f2a080247b7e | naresh2002/Leetcode-Practice | 0337-house-robber-iii/0337-house-robber-iii.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.999963 | 6.433822 |
66474e55-4bd3-45ef-adc6-ad6d7c1536bf | SeongmoAhn/ProblemSolving | 2110.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define endl '\n'
int N, C, ans = 0;
vector<int> house;
void initInput() {
cin >> N >> C;
for (int i = 0; i < N; i++) {
int input; cin >> input;
house.push_back(input);
}
sort(house.begin(), house.end());
}... | ALGO | 0.999994 | 4.54713 |
f74fa100-0f8c-4bbf-9e07-e115a60ef557 | mgalang229/Revisiting-Machine-Problems-from-1st-Year-2nd-Term | b.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
int main() {
string tmp, s;
cout << "Enter a word: ";
getline(cin, tmp);
for(char c : tmp)
if(c!=' ')
s+=c;
transform(s.begin(), s.end(), s.begin(), ::tolower);
bool ok=1;
for(int i=0; i<(int)s.size(); ++i)
if(s[i]!=s[(i... | ALGO | 0.999782 | 4.720541 |
7b6151fe-1ee5-4f3f-967d-f47ff79001d2 | raincross7/code-similarity | codes/train_code/problem282/problem282_407.cpp | /*
*/
#include<iostream>
#include<iomanip>
#include<ios>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<string>
#include<algorithm>
#include<utility>
#include<math.h>
#include<cstdlib>
#define rep(i, n) for(int i=0;i<n;i++)
#define repb(i, a, b) for(int i=a;i<b;i++)
#define MAX_N 10000
using ... | ALGO | 0.999813 | 3.459832 |
b46a58b4-4747-4c22-bd48-2501279e1da7 | tanishq1200/DSA | Arrays/FindFirstRepeatingElement.cpp | //GFG:- https://practice.geeksforgeeks.org/problems/array-of-alternate-ve-and-ve-nos1401/1?utm_source=geeksforgeeks&utm_medium=ml_article_practice_tab&utm_campaign=article_practice_tab
class Solution {
public:
// Function to return the position of the first repeating element.
int firstRepeated(int arr[], int ... | ALGO | 0.999951 | 5.118902 |
b40124e8-a789-4831-82eb-318f1a54c548 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9329_0.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("-Ofast", "-funroll-all-loops")
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 110, M = 1e6 + 10;
int n, q, s, t, d[N], st[N], vis[N], low[N], up[N], res;
int head[N], nex[M], to[M], flow[M], w[M], tot = 1;
inline void ade(int a, int b, int c, int d) {
to[... | ALGO | 0.999762 | 4.386618 |
67c761ef-d72c-4db8-b2da-9a7a4f6196a2 | C-2024-1-3/2306-xuzicheng | test4_2-2.cpp | //дһַʽʾһ16תΪ10вԡ
//ԭ int parseHex(const char* const hexString);
//磺ú parseHex(A5); 165
//#include <iostream>
//#include <string>
//#include <cstring> // cstringͷļʹstrncpy_s
//
//int main() {
// // һstd::string
// std::string str = "Hello, World!";
//
// // һ㹻char洢ַͿַ'\0'
// const size_t strLength = str.leng... | ALGO | 0.993722 | 4.251441 |
cf566939-4378-483b-ad42-23a8062d48cd | SuperBigFive/Charming_XCPC | Codeforces/Div2/474div1+div2#/E#.cpp | #include <bits/stdc++.h>
#define ll long long
#define int ll
using namespace std;
const int N = 2e5 + 5;
const int MOD = 1e9 + 7;
int n;
void init () {}
void charming () {
init ();
cin >> n;
vector <int> a (n);
vector <vector <int> > G (n);
for (int &ai : a) cin >> ai;
for (int i = 0, u, v; i < n - 1; ++i) {
... | ALGO | 0.999815 | 4.158708 |
e668ded2-aa2e-428c-841a-79843c6eaea9 | DepartmentOfSoftwareEngineeringFEFU/M9123-09.03.04rpis-Markov | src/benchmark/Experiment.cpp | #include "Experiment.h"
#include <numeric>
#include <vector>
Experiment::Experiment(const std::shared_ptr<IFourierTransformAlgorithm> &algorithm,
const std::shared_ptr<IMeasurer> &measurer,
const size_t runs,
const size_t n,
f... | ALGO | 0.90081 | 5.427051 |
a320472c-e2a2-4880-8580-1db9cf30705a | Khushboo-Baheti/coding-problems | removeduplicates.cpp | // characters is not maintained in this program
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
/* Function to remove duplicates in a sorted array */
char *removeDupsSorted(char *str)
{
int i=0;
int k = 0;
int j = i+1;
while(*(str+i) != '\0')
{
... | ALGO | 0.999303 | 4.607157 |
9f022581-287e-425d-984c-63b27e6e03bd | Srizon143005/LightOJ-Solutions | 1241.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll t, i, n, j, ans;
cin >> t;
for(i=1; i<=t; i++)
{
cin >> n;
ll a[n+3];
for(j=1; j<=n; j++)
cin >> a[j];
a[0]=2;
ans=0;
for(j=0; j<n; j++)
{
... | ALGO | 0.999023 | 3.428018 |
e37877dc-a6c7-47db-a0ed-7ed0d74b7266 | krsahab/Algorithms | DSA/C++/GeekForGeeks/DPMinCoins.cpp | #include<bits/stdc++.h>
using namespace std;
int findMinCoin(int num, int coins[], int s)
{
if(s==0)
return 0;
if(num==0)
return 1;
if(coins[s-1]<=num)
{
int res = 1+findMinCoin(num-coins[s-1],coins,s)
}
return 1+findMinCoin(num-coins[s-1],coins,s),findMinCoin(num,coins,s-1));
... | ALGO | 0.999921 | 3.297159 |
bfcd1418-b91d-4fe1-8b6a-5d2809b308a3 | PranshuSwaroop15/MyLeetcode-Solved | 0590-n-ary-tree-postorder-traversal/0590-n-ary-tree-postorder-traversal.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val) {
val = _val;
}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
*/
class Solution {
public:
vector<int> postorder(Node*... | ALGO | 0.999828 | 6.276399 |
1db80d70-b258-4a3e-9be9-4f15e269e2f6 | nunu111/lab26_Containers | lab26_2.cpp | #include<iostream>
#include<list>
#include<algorithm>
using namespace std;
void printList(list<string> s){
list<string>::iterator i;
for( i = s.begin(); i != s.end(); i++){
cout << *i << " ";
}
cout << "\n";
}
int main(){
list<string> line_up;
list<string>::iterator loc;
line_up.push_back("Alice");
... | TOOL | 0.986988 | 3.987074 |
c7cdb509-cd4a-4aa6-8136-c6411bfdc1f7 | imSuvankar/LeetCode-Solutions | 2180-count-integers-with-even-digit-sum/2180-count-integers-with-even-digit-sum.cpp | class Solution {
public:
int countEven(int num) {
int ans = 0;
for(int i = 0; i <= num; i++) {
int sum = 0;
for (int curr = i; curr; sum += curr % 10, curr /= 10);
if(!(sum & 1)) ans++;
}
return ans-1;
}
};
| ALGO | 0.999875 | 5.868352 |
052684bb-efbb-4980-b6f4-b21d18128025 | ishandutta2007/codeforces | 777777777plus/normal/1276/C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 4e5+5;
int n,a[N];
vector<int>del[N],ans[N];
struct nd{
int c,w;
friend bool operator < (nd a,nd b){
return a.c>b.c||(a.c==b.c&&a.w<b.w);
}
}b[N];
int main(){
scanf("%d",&n);
for(int i=1;i<=n;++i)scanf("%d",&a[i]);
sort(a+1,a+n+1... | ALGO | 0.999997 | 3.131129 |
be9195cf-7a77-456c-bcdd-033a10f28661 | cou929/topcoder | KindAndCruel.cpp | // BEGIN CUT HERE
// END CUT HERE
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <numeric>
// BEGIN CUT HER... | ALGO | 0.998929 | 3.825361 |
406e3e2e-fbe3-49db-a84a-6c92f570e228 | gmitch215/benchmarks | benchmarks/binary-search/main.cpp | #include <iostream>
#include <chrono>
int binarySearch(int arr[], int x) {
int low = 0;
int high = sizeof(arr) / sizeof(arr[0]) - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
if (arr[mid] == x)
return mid;
if (arr[mid] < x)
low = mid + 1;
... | ALGO | 0.998973 | 6.974722 |
15967942-1de6-4a03-857f-96767dfc3ed4 | faqwerly/c- | T4_33.cpp | /*һע
*ļT4_33.cpp
*ߣYitong Han
*䣺H2101870137@163.com
*ڣ2022.3.19
*ѧԺSchool of Computer Information and Engineering
*ܣֱεı
*/#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if(a>0&&b>0&&c>0)
{
if(a+b>c&&a+c>b&&b+c>a)
{if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c=... | ALGO | 0.999709 | 3.809113 |
9b85a3a7-e134-47b9-a8ec-2fc8dc4747ab | QiangSu/MFE-GSB | kmer_counter.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <vector>
#include <sstream>
#include <zlib.h>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <queue>
#include <atomic>
#include <filesystem>
namespace fs = std::filesystem;
// Helper function to split a string ... | DATA | 0.95279 | 7.708801 |
705d668d-4ea1-4b45-a572-56f4dc179ddb | valehp/OCI_2020 | Clase 3/Ej 3.cpp | #include <iostream>
using namespace std;
int main() {
int largo,ancho,alto;
cin >> largo >> ancho >> alto;
cout << "el volumen de la caja es "<<largo*ancho*alto << "\n";
return 0;
} | TOOL | 0.947241 | 3.772921 |
95495fa8-d800-4cfa-9f2f-64442c3f2087 | Ainur-1/AIP_11 | AIP_11.cpp | #include <iostream>
#include <string>
#include <conio.h>
using namespace std;
void ex_1();
void ex_2();
int main() {
setlocale(LC_ALL, "Russian");
//ex_1();
ex_2();
return 0;
}
void ex_1() {
char ch, str[128];
float prob;
int k = 0, quantility = 0;
cout << "Введите строку > "; gets_s(str);
cout << "Введи... | ALGO | 0.98552 | 3.518348 |
34fec500-16be-4089-9df4-e0cd712ee44e | psornsiri/UltrasoundSimulator-FinalProject | sdk-3.15.0/externals/Eigen/doc/examples/Tutorial_BlockOperations_corner.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::Matrix4f m;
m << 1, 2, 3, 4,
5, 6, 7, 8,
9, 10,11,12,
13,14,15,16;
cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl;
cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << ... | ALGO | 0.998123 | 4.092313 |
7075f5a1-e40c-4c2f-a515-3470535d6b92 | alesaiko/android_frameworks_av | media/libstagefright/codecs/amrwb/src/qisf_ns.cpp | /*
------------------------------------------------------------------------------
Filename: qisf_ns.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-----------------------------------------------------------------------------... | ALGO | 0.995864 | 6.456701 |
06a1717f-c049-44ef-8a00-9c97556bdb2f | kangsunwoo827/algorithm_ps_cpp | 1735.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int choidae(int a, int b){
if (a<b){
swap(a,b);
}
if (b==0){
return a;
}
else{
return choidae(b,a%b);
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
... | ALGO | 0.999857 | 4.161259 |
1e04a11e-3f6d-43b9-9584-d84b491a55dd | cczhong11/hihocoder | test95.cpp | #include<iostream>
using namespace std;
int gcd(long a,long b)
{
if(a%b==0)
return b;
return gcd(b,a%b);
}
struct answer{
int x;
int y;
answer(int x0,int y0)
{
x = x0;
y = y0;
}
};
answer e_gcd(int A,int B)
{
if(A%B==0)
return answer(0,1);
answer a = e_gcd(B,A... | ALGO | 0.999974 | 3.39967 |
57302008-7a46-48e7-b031-ac3f5cc191d9 | happypildo/Algorithm_stduy | Study_cpp/Algorithm_solution_codes/BOJ_G5_15686_치킨배달/BOJ_G5_15686_치킨배달/code.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void find_via_combination(int& min_dist, int num_of_chicken, int start, vector<bool>& combination, vector<vector<int>>& chck_dist_by_house, int depth, int target_depth) {
if (target_depth == depth) {
//cout << "[find_via_combination]" << e... | ALGO | 0.999847 | 4.379026 |
6365e949-c82e-4a8d-ba87-9fe63c2801e7 | TheCalculas/LeetCode | Right View of Binary Tree - GFG/right-view-of-binary-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
r... | ALGO | 0.999546 | 6.307985 |
4a7c2437-654c-4b9f-b697-08f079c057ca | Ritika122001/6Companies30Days | Adobe/05NonNegativeIntegerswithoutconsecutiveones.cpp | // 600. Non-negative Integers without Consecutive Ones
// Given a positive integer n, return the number of the integers in the range [0, n] whose binary representations do not contain consecutive ones.
// Example 1:
// Input: n = 5
// Output: 5
// Explanation:
// Here are the non-negative integers <= 5 with their corre... | ALGO | 0.999992 | 6.573298 |
cb7f6393-fd00-42bc-bdcc-1d9e9a16571d | Saifu0/CP | Graph/kruskal_algo.cpp | #include<bits/stdc++.h>
using namespace std;
struct Graph {
int src, dist, weight;
};
bool compare(Graph g1, Graph g2){
return g1.weight < g2.weight;
}
int getparent(int src, int* parent){
if(parent[src] == src){
return src;
}
return getparent(parent[src],parent);
}
int main(){
int v,e;
cin >> v >> e;
Gra... | ALGO | 0.999995 | 3.92547 |
4d91233c-ea5e-49b6-8464-66cb81675b11 | Nurik1505/Home-work-and-Labs | list04.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <string>
using namespace std;
// Function to input vector elements
void inputVector(vector<int> &vec, const string &name) {
size_t n;
cout << "Enter the size of vector " << name << ": ";
... | ALGO | 0.999469 | 6.260268 |
7a4eda69-f7fd-418a-8684-a554ebdd05b8 | ishandutta2007/codeforces | pyqe/normal/1030/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long n,i,k;
bool g=false;
scanf("%lld",&n);
for(i=0;i<n;i++)
{
scanf("%lld",&k);
if(k==1)
{
g=true;
}
}
if(g)
{
printf("HARD\n");
}
else
{
printf("EASY\n");
}
} | ALGO | 0.999667 | 3.267935 |
64c9ffd4-fbb7-4e91-962c-1df05f5e9c00 | jollyjinx/idl4k | boost_1_53_0/libs/geometry/doc/src/examples/algorithms/unique.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[unique
//` Shows how to make a so-called minimal set of a polygon by removing duplicate points
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/adapted/b... | ALGO | 0.947186 | 5.848797 |
0601d844-d4e9-4b11-b384-a9acf42ae94f | Clepoy3/LeakNet | vguimatsurface/MatSystemSurface.cpp | #include <windows.h>
#include "vstdlib/strtools.h"
#include "tier0/dbg.h"
#include "FileSystem.h"
#include <vgui/vgui.h>
#include <Color.h>
#include "UtlVector.h"
#include "Clip2D.h"
#include <vgui_controls/Panel.h>
#include <vgui/IInput.h>
#include <vgui/Point.h>
#include "TextureDictionary.h"
#include "Cursor.h"
#inc... | TOOL | 0.886523 | 3.308475 |
df59fbde-8c64-4b26-b660-51c64ae0e3ef | Priyo002/DSA | CSES/Graph/Investigation.cpp | #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 ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define int long long
#define pb push_back
#define endl '\n'
const... | ALGO | 0.999921 | 4.210926 |
d898a650-041b-4306-b24a-8439d15678d7 | TheMakarov/cocos_roller_splay | Scene3.cpp | #include "Scene3.h"
#include "audio/include/AudioEngine.h"
USING_NS_CC;
Scene* Scene3::createScene() {
return Scene3::create();
}
Sprite* ball_scene3;
Sprite* map;
void Scene3::move_sound() {
auto arbit = rand() % 100;
if ( arbit > 70) AudioEngine::play2d("move_ball_1.wav");
else AudioEngine::play2d("move... | TOOL | 0.94014 | 4.099755 |
bfd9cc5b-eded-4c7a-b688-76fe586f6a0a | sxungchxn/cppexercise | sourcecodes/Pointclass.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
class Point
{
int x; /* 기본적으로 private으로 설정된다 */
int y;
public:
Point();
Point(int pos_x, int pos_y);
int GetPointX();
int GetPointY();
};
class Geometry
{
// 점 100 개를 보관하는 배열.
private:
Poin... | ALGO | 0.945982 | 4.30034 |
0f2b2e80-3f91-487c-ab77-8a7dd707e4cf | 4ms/stm32mp1-baremetal | third-party/DaisySP/Source/Control/phasor.cpp | #include <math.h>
#include "phasor.h"
#include "dsp.h"
using namespace daisysp;
void Phasor::SetFreq(float freq)
{
freq_ = freq;
inc_ = (TWOPI_F * freq_) / sample_rate_;
}
float Phasor::Process()
{
float out;
out = phs_ / TWOPI_F;
phs_ += inc_;
if(phs_ > TWOPI_F)
{
phs_ -= TWOPI_... | ALGO | 0.978366 | 4.794363 |
d139a513-69bf-4c45-8643-9cd56dc73a60 | shernshiou/CarND | Term3/01-CarND-Path-Planning-Project/src/Eigen-3.3/bench/benchmarkXcwise.cpp | // g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef VECTYPE
#define VECTYPE VectorXLd
#endif
#ifndef VECSIZE
#define VECSIZE 1000000
#endif
#ifndef REPEAT
#define REPEAT 1000
#endif
int main(int argc, c... | ALGO | 0.971927 | 3.896122 |
effa4573-5b62-4538-b4df-81a5f708ef85 | xYajun/XianLaiGame | XianLGame/cocos2d/tools/simulator/libsimulator/lib/platform/win32/SimulatorWin.cpp |
#pragma comment(lib, "comctl32.lib")
#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='<IP_ADDRESS>' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#include "stdafx.h"
#include <io.h>
#include <stdlib.h>
#include <malloc.h>
#i... | TOOL | 0.897921 | 5.824581 |
b4d6af0c-5b6a-48a2-9f56-7004ed365382 | ishandutta2007/codeforces | peti1234/normal/1188/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int c=1000005;
long long mod=998244353, n, fakt[c], inv[c], ans, cnt, db;
bool v[c];
priority_queue<pair<int, int> > q;
long long oszt(long long a) {
long long ans=1, p=mod-2;
while (p) {
if (p%2) {
ans=ans*a%mod;
}
a=a*a%m... | ALGO | 0.999964 | 4.136486 |
a9fe7bbd-0da9-4ca7-a613-d8e829d38a7c | lukasmonk/lucaschess | Engines/Linux64/cheng/src/cheng4/protocol.cpp | #include "protocol.h"
#include "engine.h"
#include "version.h"
#include "movegen.h"
#include "thread.h"
#include "tune.h"
#include "utils.h"
#include "filterpgn.h"
#include <deque>
#include <cctype>
#include <algorithm>
// these because of pbook
#include <set>
#include <vector>
#include <iostream>
#include <fstream>
... | ALGO | 0.99781 | 5.62034 |
46ce6764-2dac-4e4b-bcc1-e25df14e8152 | sarvex/leetcode-g-forth | solution/0500-0599/0558.Logical OR of Two Binary Grids Represented as Quad-Trees/Solution.cpp | /*
// Definition for a QuadTree node.
class Node {
public:
bool val;
bool isLeaf;
Node* topLeft;
Node* topRight;
Node* bottomLeft;
Node* bottomRight;
Node() {
val = false;
isLeaf = false;
topLeft = NULL;
topRight = NULL;
bottomLeft = NULL;
... | ALGO | 0.999979 | 6.398693 |
c5f17b8a-fcda-4870-8e45-dadfce676456 | wanghengg/LeetCode | medium/0011containerWithMostWater.cpp | #include <iostream>
#include <vector>
using namespace std;
int maxArea(vector<int>& height) {
int left = 0;
int right = height.size() - 1;
int res = 0;
while (left < right) {
if (height[left] < height[right]) {
res = (res > height[left] * (right - left)) ? res : height[left] * (righ... | ALGO | 0.999495 | 6.139009 |
ad6d1ca0-1f71-4d80-a0dc-e833bfda65e6 | srishtiprasadmanit12/Data-Structure-Algorithm | BST/deleteNodeBST.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999997 | 6.58073 |
edca69d3-5ed5-4bec-b41c-fc7897e27c83 | josuerocha/KinecTank | point_cloud_processing/LIBRARY/src/Calculations.cpp | #include "Calculations.h"
using namespace std;
using namespace pcl;
template <class T>
Calculations<T>::Calculations(){
//ctor
}
template <class T>
Calculations<T>::~Calculations(){
//dtor
}
template <class T>
void Calculations<T>::estimateNormals(class PointCloud<T>::Ptr input_cloud,NormalCloud_ptr normals... | ALGO | 0.99942 | 5.811077 |
2214325c-ab32-41f8-928a-7ae96f0640d4 | ishandutta2007/codeforces | t1dus/normal/1542/A.cpp | // --------------------------------------------------<TEMPLATE>--------------------------------------------------
// --------------------<optimizations>--------------------
/*
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
*/
// -------------------</optimizations>--------------------
/... | ALGO | 0.999844 | 4.370955 |
09b0a0c5-f258-41ea-b51f-057db9de1948 | CharellKing/leetcode | 125_valid_palindrome.cpp | class Solution {
public:
char forward(const string& s, int& begin) {
while (begin < s.size()) {
if ((s[begin] >= 'a' && s[begin] <= 'z') || (s[begin] >= 'A' && s[begin] <= 'Z') || (s[begin] >= '0' && s[begin] <= '9')) {
break;
}
begin ++;
}
... | ALGO | 0.999938 | 6.228018 |
9a2486aa-d39b-4fb1-a414-2b334efacaa1 | takashigoto1207/atcoder | abc3xx/abc376/abc376_b.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using namespace atcoder;
using ll = long long;
int move(int n, int from, int to, int ng) {
if (from > to) swap(from, to);
if (from < ng and ng < to)
return n + from - to;
else
return to - f... | ALGO | 0.999692 | 3.822916 |
952c98b9-cd45-4c5c-8db8-63b237f3037a | brynchristineloftness/ColoradoMesaUniversity_Classes | Year 1/Semester2/ComputerScience2/Class Assignments/Class Assignment 2/program2/driverfile.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ifstream inf;
ofstream outf;
inf.open("datafile.txt");
outf.open("outputfile.txt");
vector<int> intveclist;
vector <int>::iterator intveclistiterator;
float num=0;
outf <... | ALGO | 0.999112 | 3.991586 |
16746663-8086-4691-92a2-763a269163ca | ishandutta2007/codeforces | semiexp/normal/1503/D.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define MOD
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typ... | ALGO | 0.999977 | 3.636594 |
b56a4b60-3f6b-4edd-b868-fab7068d989e | antoine-chan-lock/PolarInterpolants | CommonLibraries/libigl/include/igl/AABB.cpp | template <typename DerivedV, int DIM>
template <typename DerivedEle, typename Derivedbb_mins, typename Derivedbb_maxs, typename Derivedelements>
IGL_INLINE void igl::AABB<DerivedV,DIM>::init(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedEle> & Ele,
const Eigen::MatrixBase<Derivedbb_... | ALGO | 0.99837 | 5.196433 |
4e38c9fd-4090-4b9f-8225-8c8d3548574a | kishanchauhan01/DSA-CPP | queue/circularQueue.cpp | #include <bits/stdc++.h>
class CircularQueue {
public:
int *arr;
int front;
int rear;
int size;
CircularQueue(int n) {
size = n;
arr = new int[size];
front = rear = -1;
}
// Enqueues 'X' into the queue. Returns true if it gets pushed into the
// stack, and fa... | ALGO | 0.999623 | 5.048044 |
3a37fb02-d1da-4754-8e95-c37a5d0abe09 | Nitin-Pilkhwal/Leetcode_Problems | Easy Problems/219. Contains Duplicate II.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <unordered_map>
#include <vector>
using namespace std;
class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
map<int,int> mp;
for(int i=0;i<nums.size();i++){
if(mp.count(nums[i])){
if(abs(m... | ALGO | 0.999941 | 5.617558 |
a8690697-0142-484c-ad32-2cee4fff7851 | Pu5hk4r/SELF-DSA-ProblemSolving | 9_Backtracking/2_Astar.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <unordered_set>
using namespace std;
// Structure for a point or cell in the grid
struct Point {
int x, y;
Point(int x, int y) : x(x), y(y) {}
};
// Structure for a cell in the grid for A* search
struct Cell {
Point parent;
... | ALGO | 0.99997 | 4.623653 |
95d6ddc9-50fc-435c-abe5-20da960281da | sarvex/leetcode-fish | solution/0700-0799/0795.Number of Subarrays with Bounded Maximum/Solution.cpp | class Solution {
public:
int numSubarrayBoundedMax(vector<int>& nums, int left, int right) {
auto f = [&](int x) {
int cnt = 0, t = 0;
for (int& v : nums) {
t = v > x ? 0 : t + 1;
cnt += t;
}
return cnt;
};
retur... | ALGO | 0.999994 | 6.226674 |
f24a4310-0ff5-4041-9801-0d2384a9f368 | karan984/Complete-DSA-For-Placements | Sorting/count1.cpp | #include<iostream>
using namespace std;
void count_sort(int a[], int n)
{
int i, max_e=a[0], j, c;
for(i=1; i<n; i++){
max_e=max(max_e, a[i]);
}
//O(n)
int count[max_e+1];
for(i=0; i<=max_e; i++){
count[i]=0;
}
for(i=0; i<n; i++){
count[a[i]]++;
}//O(n)
... | ALGO | 0.999969 | 4.679339 |
8c053356-7e69-4c42-93bb-37818053ae73 | depanshu357/CP-codes | sieve.cpp | #include <bits/stdc++.h>
using namespace std;
int is_prime[int(1e6) + 1];
int main()
{
int maxN = 1e6;
for (int i = 0; i < maxN; i++)
is_prime[i] = 1;
is_prime[0] = is_prime[1] = 0;
for (int i = 2; i * i <= maxN; i++)
{
if (is_prime[i])
{
for (int j = i * i; j <=... | ALGO | 0.999481 | 4.606203 |
31219d7e-1ab4-443c-b0dc-dc5d98a9d427 | Shannju/njucser_helphelp | Algorithm算法/Code/3/.history/1_20220424162854.cpp | #define DEBUG
/*
题目:并查集
题目描述:
如题,现在有一个并查集,你需要完成合并和查询操作。
输入格式
第一行包含两个整数N,M,表示共有N个元素和M个操作。
接下来M行,每行三个整数Zi,Xi,Yi。
当Zi=1时,将Xi与Yi所在的集合合并。
当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。
输出格式
对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。
样例输入
4 7
2 1 2
1 1 2
2 1 2
1 3 4
2 1 4
1 2 3
2 1 4
样例输出
N
Y
N
Y
数据范围
1 <= N <= 10^6
1 <= M <= 10^6
1 <... | ALGO | 0.99995 | 4.17629 |
cc7aa132-b45f-4d94-9843-deb93f0d8bf8 | jiangfanfly/VIO_course | ch5/BA_schur/backend/edge_prior.cpp | //
// Created by heyijia on 19-1-30.
//
#include <sophus/se3.hpp>
#include "edge_prior.h"
#include "backend/vertex_pose.h"
#include <iostream>
#define USE_SO3_JACOBIAN 1
namespace myslam {
namespace backend {
#ifndef USE_SO3_JACOBIAN
template <typename Derived>
static Eigen::Matrix<typename Derived::Scalar, 3, 3>... | ALGO | 0.994108 | 5.061127 |
8e00e987-3562-4d80-a76b-8bb5925e7d1f | an4s/bitcoin_tx_analyzer_v0.20.1 | src/policy/fees.cpp | #include <policy/fees.h>
#include <clientversion.h>
#include <streams.h>
#include <txmempool.h>
#include <util/system.h>
static constexpr double INF_FEERATE = 1e99;
std::string StringForFeeEstimateHorizon(FeeEstimateHorizon horizon) {
static const std::map<FeeEstimateHorizon, std::string> horizon_strings = {
... | ALGO | 0.991416 | 7.033765 |
d4ad9abe-150c-45e7-afdd-921983273a2e | marekpetrik/craam2 | include/eigen3/bench/spbench/test_sparseLU.cpp | // Small bench routine for Eigen available in Eigen
// (C) Desire NUENTSA WAKAM, INRIA
#include <iostream>
#include <fstream>
#include <iomanip>
#include <unsupported/Eigen/SparseExtra>
#include <Eigen/SparseLU>
#include <bench/BenchTimer.h>
#ifdef EIGEN_METIS_SUPPORT
#include <Eigen/MetisSupport>
#endif
using namesp... | ALGO | 0.997763 | 4.273294 |
aebc1380-06ee-45c9-93c6-7c9ae95862cb | jakublabenski/cpp17.samples | parallelized algorithms/main.cpp | #include <iostream>
#include <algorithm>
#include <execution>
#if __has_include(<parallel>)
#include <parallel>
namespace s = std;
#define experimental_v 0
#else
//#include <experimental/parallel>
namespace s = std::experimental;
#define experimental_v 1
#endif
int main(int argc, const char * argv[]) {
int a[409... | ALGO | 0.998368 | 3.280877 |
ed4cc800-18f5-4ca4-b955-a638c26d45a7 | Lynthex/XLYN-core | src/crypto/aes.cpp | #include "aes.h"
#include "crypto/common.h"
#include <assert.h>
#include <string.h>
extern "C" {
#include "crypto/ctaes/ctaes.c"
}
AES128Encrypt::AES128Encrypt(const unsigned char key[16])
{
AES128_init(&ctx, key);
}
AES128Encrypt::~AES128Encrypt()
{
memset(&ctx, 0, sizeof(ctx));
}
void AES128Encrypt::Encr... | TOOL | 0.95854 | 7.648374 |
001659c0-7b4f-4da2-833c-b96d90744db4 | Bilal-Khan12/string-repo | LastOccurrenceOfaSubstringinString.cpp | #include<stdio.h>
int subStringIndex(char str1[],char str2[],int len, int len2);
int main() {
char str[100];
char substr[20];
int len1,len2;
printf("Enter the length of first string\n");
scanf("%d",&len1);
printf("Enter the length of 2nd string\n");
scanf("%d",&len2);
getchar();
printf("Enter strin... | ALGO | 0.997624 | 3.39844 |
b12518f3-68af-4639-8a7a-18d526d04b7e | haipng/cj | clab/DP/BINPACKING.cpp | #include <bits/stdc++.h>
using namespace std;
int l,n;
int a[100010];
void solve() {
if(n>20) return;
int ans = 1e9;
for(int i=0; i < (1<<n); i++) {
int nbox = 2;
int b1 = 0;
int b2 = 0;
for(int j=0; j<n; j++) {
if(i & (1 << j)) {
if(b1+a[j] > l) {
nbox++;
... | ALGO | 0.999991 | 3.917099 |
ad7ac422-e176-445b-be5b-b188e8957ca7 | Himanshu14Ag/DSA | DSA_Sorting/AllocateNoOfPages.cpp |
#include<iostream>
#include<limits.h>
using namespace std;
//Naive Solution -------------------
int sum(int arr[],int b,int e){
int s=0;
for(int i=b;i<e;i++)
s += arr[i];
return s;
}
int minPages(int arr[],int n,int k){
if(k==1)
return sum(arr,0,n-1);
if(n==1)
return ... | ALGO | 0.999921 | 5.043422 |
e9d12f3b-ef65-4dc3-8e0b-85dbf378d22f | kunalkakati/DSA | Linked list/LinkedList.cpp | #include<iostream>
using namespace std;
typedef struct Node
{
int data;
struct Node* next;
}Node;
void DisplayList(Node*);
int main(){
Node * head = new Node;
Node * second = new Node;
Node * third = new Node;
head->data = 7;
head->next = second;
second->data = 44;
second->next ... | ALGO | 0.971213 | 4.098919 |
32ffd1a2-d532-4d42-ae78-c05f65b80742 | Hans1984/CineGS | SIBR_viewers/src/core/imgproc/MeshTexturing.cpp | #include "MeshTexturing.hpp"
#include "PoissonReconstruction.hpp"
#include <core/system/LoadingProgress.hpp>
namespace sibr {
MeshTexturing::MeshTexturing(unsigned int sideSize) :
_accum(sideSize, sideSize, Vector3f(0.0f, 0.0f, 0.0f)),
_mask(sideSize, sideSize, 0)
{
}
void MeshTexturing::setMesh(const sibr:... | ALGO | 0.937193 | 7.16843 |
a9510b5c-042d-4924-a231-13143e6d152d | sanchit-sinha/CP | Contests/Codeforces/CF-Contest/Codeforces_-_Grakn_Forces_2020/A. Circle Coloring/sol.cpp | /**
* Author: Sanchit Sinha
* Created: 30.09.2020 20:06:27
**/
#include "bits/stdc++.h"
using namespace std;
#define ll long long
inline ll gcd(ll a,ll b) {if(b==0)return a;a%=b;return gcd(b,a);}
inline ll max(ll a,ll b) {return((a>b)?a:b);}
inline ll min(ll a,ll b) {return((a>b)?b:a);}
ll powermod(l... | ALGO | 0.999975 | 3.641777 |
19006dcf-c549-43a8-a28d-dcff2d5ed010 | WindZQ/C_Plus_Plus_Concurrency_in_Action | Chapter_4_Synchronizing_Concurrent_Operations/4.13.cpp | template<typename T>
std::list<T> parallel_quick_sort(std::list<T> input)
{
if(input.empty())
{
return input;
}
std::list<T> result;
result.splice(result.begin(), input, input.begin());
T const& pivot = *result.begin();
auto divide_point = std::partition(input.begin(), input.end(), ... | ALGO | 0.999876 | 5.715543 |
e742341c-1c3f-462f-8348-50ce27246c91 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_364_6.cpp | #include <bits/stdc++.h>
using namespace std;
int getn() {
int h;
scanf("%d", &h);
return h;
}
template <class T, class U>
ostream& operator<<(ostream& out, const pair<T, U>& par) {
cout << "[" << par.first << ";" << par.second << "]";
return out;
}
vector<vector<int> > mini;
int n;
int nacitaj(int i, int j) ... | ALGO | 0.999816 | 3.068898 |
68fbe8f7-2a4e-462b-ac34-efdcfdeb4707 | johnvgomes/C-programs | Exercicios em dev C++/JOHN VICTOR GOMES -Lista10/Exercicio3_ordenar+_10_valores/Exercicio3_ordenar+_10_valores.cpp | #include <stdio.h>
#define MAX 10
int main (){
int vetor[MAX];
int *pVetor = vetor;
int i;
int j;
int aux;
//recebimento dos valores
for (i=0; i<MAX;i++){
printf("Entre com um numero para a posicao %i: \n", (i+1));
scanf("%i", (pVetor+i));
}
//ordenao bolha
for (i=0;i<MAX-1;i++){
for (j=0;j<MAX-1;j++){
if ... | ALGO | 0.999792 | 4.09657 |
76e5bd3d-2302-4bd2-9c47-3107f71b2f0f | lasoto/Fully-Stable-Working-Mangos-Core | dep/tbb/src/old/spin_rw_mutex_v2.cpp | #include "spin_rw_mutex_v2.h"
#include "tbb/tbb_machine.h"
#include "../tbb/itt_notify.h"
namespace tbb {
using namespace internal;
static inline bool CAS(volatile uintptr &addr, uintptr newv, uintptr oldv) {
return __TBB_CompareAndSwapW((volatile void *)&addr, (intptr)newv, (intptr)oldv) == (intptr)oldv;
}
//!... | TOOL | 0.976158 | 7.085324 |
b39d7f2d-acd5-4c1b-b981-186e8215f5cf | AhmedEssamYassin/Problem-Solving | CP Sheets Solutions/ICPC Assiut - Newcomers/Contest #1/I/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("Output.txt", "w", stdout);
#endif // !ONLINE_JUDGE
int Number, First_digit, Second_digit;
cin ... | ALGO | 0.999915 | 5.236811 |
8976b03f-ab6a-41c9-a494-bdc99761a52b | kasthoor/CN | Arrays & 2D Arrays/TrimSpaces.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s = "abc def g hi";
string ans;
for(int i=0;i<s.size();i++){
if(s[i] != ' '){
ans.push_back(s[i]);
}
}
cout << "Output :"<< ans<< endl;
return 0;
} | ALGO | 0.998394 | 3.713019 |
3026f2df-74c4-4828-8035-ee7fe29ed56d | abdelrhmanghaly-whp/Problems-Solutions | Sum of round numbers(1352A).cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include <string>
#include <cctype>
#include <iostream>
#include <cstring>
int main()
{
// key is an ykon fe nested loop, required ane atl3
// fun
int t;
std::cin >> t;
while (t--)
{
// body
std::string x;
... | ALGO | 0.999313 | 4.546279 |
7c3d434f-00e8-4c41-bbc2-afbb24b12da2 | zaifee/Course_Codes | BasicPrograms/convertNumberToDigit.cpp | #include <iostream>
#include <cmath> // Change math.h to cmath for C++
using namespace std;
void convertIntoDigits(int &n) {
int ans = 0;
int i = 0;
while (n > 0) {
int digit = n % 10;
ans = ans + (digit * pow(10, i));
n = n / 10;
i++;
}
cout << ans;
}
int main(... | ALGO | 0.997497 | 4.748416 |
e070cb93-4159-4b30-a03c-d58d6679873e | Sarwar05/LightOJ | 1374 - Confusion in the Problemset.cpp | #include<bits/stdc++.h>
using namespace std;
int arr[1000005];
int main()
{
int tc,n,a;
scanf("%d",&tc);
for(int cas = 1; cas<=tc; cas++){
memset(arr, 0, sizeof arr);
scanf("%d",&n);
bool ans = true;
for(int i=0; i<n; i++){
scanf("%d",&a);
arr[a]++;
... | ALGO | 0.99992 | 4.072462 |
83f79e40-637e-4607-83ce-33df7ee42299 | Soham-Chaudhuri/My-CPP-practice | 1353C.cpp | #include<bits/stdc++.h>
#include<vector>
#include<string.h>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
using namespace std;
typedef unsigned long long ull;
typedef long double ld;
typedef long long ll;
typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<in... | ALGO | 0.99985 | 4.415529 |
dd2b2457-3251-4503-912d-c2cf479bbae1 | palak9898/LEETCODE-practice | 0680-valid-palindrome-ii/0680-valid-palindrome-ii.cpp | class Solution {
public:
bool ispalindrome(string s,int i,int j){
while(i<j){
if(s[i]!=s[j]){
return false;
}
i++;
j--;
}
return true;
}
bool validPalindrome(string s) {
int i = 0;
int j = s.length() - 1;... | ALGO | 0.999993 | 6.270356 |
1ba3d6e0-4b85-4269-86c4-6f657b0e82c1 | IsmoilovMuhriddin/competitive-programming | CSES/1629.cpp | #include<iostream>
#include<vector>
#include<stack>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include <bitset>
typedef long long ll;
#define IOS ios::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL);
#define rep(i,a,b) for(ll i=a; i<=b; i++)
#defi... | ALGO | 0.999876 | 4.618856 |
e7e70f61-6a29-4ab3-8345-84fe1953484e | prpal9122001/practise-leetcode | (dc)2218. Maximum Value of K Coins From Piles.cpp | //https://leetcode.com/problems/maximum-value-of-k-coins-from-piles/description/
class Solution {
public:
int maxValueOfCoins(vector<vector<int>>& piles, int k) {
int n = piles.size();
vector<vector<int>> dp(n + 1, vector<int>(k + 1, 0));
for (int i = 1; i <= n; i++) {
... | ALGO | 0.999821 | 5.932513 |
1436eb82-31e3-4c2d-b7f2-299ac4239146 | sarvex/leetcode-chicken | solution/1700-1799/1751.Maximum Number of Events That Can Be Attended II/Solution.cpp | class Solution {
public:
int maxValue(vector<vector<int>>& events, int k) {
sort(events.begin(), events.end(), [&](auto& l, auto& r) -> bool { return l[1] < r[1]; });
int n = events.size();
vector<vector<int>> dp(n + 1, vector<int>(k + 1));
for (int i = 0; i < n; ++i) {
i... | ALGO | 0.999927 | 6.029352 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.