uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6853860f-f406-492c-becd-6d40a0df4d0f | aaryan182/C_CODES | Questions/q12.cpp | // Calculate the sum of all elements in an array.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = {5, 10, 3, 8, 2};
int size = sizeof(arr) / sizeof(arr[0]);
int sum = 0 ;
for (int i = 0; i < size; i++)
{
sum += arr[i];
}
cout<<"sum of the given array is :... | ALGO | 0.999345 | 5.075455 |
88945182-2461-45de-9326-a9b2a86cea00 | david2du/david_training | sng/2019/01_Spring/U7/作业/7-2-1.cpp | #include <bits/stdc++.h>
using namespace std;
int main ()
{
int x = 0;
for (x = 0;true;x++)
{
if (4 * 7 * x - 4 * 5 * (13 + x) == 20)
{
cout << "7 :" << x << endl << "5 :" << x + 13 << endl;
break;
}
}
return 0;
}
| ALGO | 0.999246 | 3.614772 |
c8d7c492-a3fa-46e0-90ac-595dfcbf271f | LuthfiMayoga44/Semester1 | 21-9-23.cpp | #include <iostream>
using namespace std;
int main()
{
int A,B, d= 0;
cout<<"masukan nilai A: ";
cin>>A;
cout<<"masukan nilai B: ";
cin>>B;
d = A*B;
cout<<" hasil dari d = A * B = "<<d<<endl;
getchar();
}
| ALGO | 0.96805 | 3.302736 |
69efbb9b-b592-4c9e-bc76-59bfd3196399 | chanmin60/Algorithm | 프로그래머스/1/42748. K번째수/K번째수.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> array, vector<vector<int>> commands) {
vector<int> answer;
for (const auto& command : commands) {
int i = command[0];
int j = command[1];
int k = command[2];
vector<... | ALGO | 0.999977 | 5.91047 |
9e00c2b6-a7f6-4974-8619-e208d21a3e2c | divyarochani/Leetcode_Question | 507-perfect-number/perfect-number.cpp | class Solution {
public:
bool checkPerfectNumber(int num) {
int s = 0 , i = 1;
while(i * i < num) {
if(num % i == 0){
s += i;
if( i != 1 && i != num / i){
s +=num / i;
}
}
i++;
}
r... | ALGO | 0.99997 | 5.941638 |
9a628261-da96-40ea-be3a-be99808c3b8c | ishandutta2007/codeforces | syury/normal/1045/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define I(x, a) for(auto x : a)
#define F(i, l, r) for(auto i = l; i < r; ++i)
#define E(i, l, r) for(auto i = l; i <= r; ++i)
#define DF(i, l, r) for(auto i = l; i >= r; --i)
#define clean(a) mems... | ALGO | 0.999997 | 3.169057 |
f1612ed5-ed97-46d6-80eb-c999d9c135a1 | ROHITH1305/csa0661---DAA | Selection Sort.cpp | #include <stdio.h>
int main()
{
int n = 10;
int a[] = {3,2,6,5,4,7,8,9,5,1};
int min_index;
for(int i = 0; i < n - 1; i++)
{
min_index = i;
for(int j = i + 1; j < n; j++)
{
if(a[min_index] > a[j])
{
min_index = j;
}
}
... | ALGO | 0.999952 | 4.400856 |
09e5b773-4465-4b5d-b203-95b7df913c1d | gjGJt/ModuleSevenCOSC1437 | ModuleSevenPointFive.cpp | #include <iostream>
using namespace std;
//
int main() {
// loop for outer rows, iterates till 5 counts
for (int i = 1; i <= 5; ++i) {
// loop for columns, iterates till 3 counts (nested, so that the conditions for printing an asterisk is dependent on its position relative to the outer row).
... | ALGO | 0.996287 | 3.809389 |
35adfa2b-2c10-4aee-9a4d-b95b3c0df3ea | root7277/user_interface_for_api | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998809 | 6.763549 |
1206f704-acc1-4b88-8f0b-dff25a880d92 | DomenicoDErasmo/LeetCode | src/p90/subsets_ii.cpp | #include <iostream>
#include <vector>
#include <algorithm>
class Solution {
public:
std::vector<std::vector<int>> subsetsWithDup(std::vector<int>& nums) {
std::sort(nums.begin(), nums.end());
std::vector<std::vector<int>> result;
std::vector<int> current;
helper(result, nums, curren... | ALGO | 0.999846 | 6.595714 |
2fc47c25-cb21-450f-ae12-3258de5ad938 | arafathosense/Codeforces-Problems-Solution | 1296B Food Buying.cpp | //! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define scl(n) cin>>... | ALGO | 0.999718 | 3.548049 |
2ccb84d5-a225-4b6a-b6c2-2a7b669215f1 | Starry0/ACM | UVa/133/main.cpp | #include <iostream>
#include <cstdio>
#define maxn 25
int n,k,m,a[maxn];
using namespace std;
int go(int p,int d,int t){
while(t--){
do{
p=(p+d+n-1)%n+1;
}while(a[p]==0);
}
return p;
}
int main()
{
while(scanf("%d%d%d",&n,&k,&m)==3&&n){
for(int i=1;i<=n;i++)a[i]=i;
... | ALGO | 0.999918 | 3.150549 |
0eda427e-3c99-42fd-a55a-82bae9bd2b52 | raincross7/code-similarity | codes/train_code/problem318/problem318_297.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
cout<<a+b+c-max(a,max(b,c));
} | ALGO | 0.999575 | 3.582267 |
9e557c26-2067-442d-826f-8f0a196d939d | shsaish006/DSA | 3857-find-maximum-number-of-non-intersecting-substrings/find-maximum-number-of-non-intersecting-substrings.cpp | // class Solution {
// public:
// int maxSubstrings(string word) {
// int n = word.size();
// vector<vector<int>> substrings;
// unordered_map<char, vector<int>> indices;
// for (int i = 0; i < n; ++i) {
// indices[word[i]].push_back(i);
// }
// for (aut... | ALGO | 0.999994 | 6.068416 |
2841e37c-c2dc-4dcb-b417-c595fb0f583b | dhanusuya-348/Leetcode_Problems | 125-valid-palindrome/valid-palindrome.cpp | class Solution {
public:
bool isPalindrome(string s) {
int l = 0, r = s.size() - 1;
while (l < r) {
while (l < r && !isalnum(s[l])) l++;
while (l < r && !isalnum(s[r])) r--;
if (tolower(s[l]) != tolower(s[r])) {
return false;
}
... | ALGO | 0.999241 | 6.584795 |
b4224356-01d4-4d00-9011-4b5ad57df174 | davidchai21/leetcode-solutions | 453 Minimum Moves to Equal Array Elements/MinimumMovesToEqualArrayElements.cpp | class Solution {
public:
int minMoves(vector<int>& nums) {
int move=0;
if (nums.size()==0) return 0;
int mini=mina(nums);
for (int i=0;i<nums.size();i++)
{
move+=nums[i]-mini;
}
return move;
}
private:
int mina(vector<int>& a)
{
... | ALGO | 0.999912 | 5.875459 |
3c2e6e08-70c8-45e7-a313-552e2764d767 | raincross7/code-similarity | codes/train_code/problem393/problem393_225.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
string sh; cin >> sh;
for (int i = 0; i < 3; ++i)
{
if (sh[i] == '7')
{
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0... | ALGO | 0.999271 | 3.400103 |
06755eea-09f1-4829-a1e4-e6bce8c4e862 | Tejpatel1806/DSATutorial | C++AMAN DHATARWAL/nestingvectormap.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
map<pair<string,string>,vector<int>> m;
// pair<int,int> p1,p2;
// p1={1,2};
// p2={2,3};//aa rite pair ma comparision thay tem pair aa order ma map ma jase
// cout<<(p1<p2);//each element compare thay
int n;
cin>>... | ALGO | 0.996279 | 3.502023 |
e73eae86-2d3a-4586-82ea-3f38057f3cd2 | levi178u/Codeforces-codes | A_Coin_Transformation.cpp | // Action Beeeeeaammmmm...... beep beep beep beep beep beep beep....
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define ll long long
#define vi vector<lli>
#define vvi vector<vi>
#define gv(v,n) vi v; for (int i = 0; i < n; i++) { ll xx; cin>>xx; v.push_back(xx); }
#define mod 1e9 +7
#d... | ALGO | 0.999186 | 4.841541 |
eb50fe30-31e0-4a3a-aa7b-d213f44abab3 | JaeAeich/Leetcode-Submissions | 0283-move-zeroes/0283-move-zeroes.cpp | class Solution {
public:
void moveZeroes(vector<int>& v) {
int c = 0;
for(int i = 0; i < v.size(); i++){
if(v[i] == 0){
c++;
}
else v[i-c] = v[i];
}
for(int i = v.size() - c; i < v.size(); i++) v[i] = 0;
}
}; | ALGO | 0.999941 | 6.337021 |
1327af51-50fd-4477-b8bb-15c53f4e9749 | lucic71/llvm-ub-free | bolt/lib/Core/FunctionLayout.cpp | #include "bolt/Core/FunctionLayout.h"
#include "bolt/Core/BinaryFunction.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/edit_distance.h"
#include <algorithm>
#include <functional>
using namespace llvm;
using namespace bolt;
unsigned FunctionFragment::size() const { return end() - begin(); }
bool FunctionFragme... | TOOL | 0.889911 | 7.541986 |
13ede8b6-9182-4e2a-a589-11eeabbf5b76 | kcopenhagen/lammps-myxosim | install-lammps/lammps-working/src/MACHDYN/compute_smd_contact_radius.cpp | // clang-format off
#include "compute_smd_contact_radius.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeSMDContactR... | ALGO | 0.990702 | 6.54249 |
0eb0ceef-ad9c-4099-a5a2-0d869be2d147 | zuowang/Paddle | paddle/utils/CommandLineParser.cpp | #include "CommandLineParser.h"
#ifndef PADDLE_USE_GFLAGS
#include "paddle/utils/StringUtil.h"
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <tuple>
namespace paddle {
static constexpr int kStatusOK = 0;
static constexpr ... | TOOL | 0.894493 | 6.812586 |
8e5a657b-8cc7-4ce8-b671-19354a5559b9 | sahilg50/DSA | GFG/Chocolate Distribution Problem.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
long long findMinDiff(vector<long long> a, long long n, long long m)
{
/*
The steps to solve the problem are as follows:
- It's like a sliding window problem but inly af... | ALGO | 0.999853 | 5.858726 |
58d23672-08aa-465a-8cea-627c9f15238f | afifabroory/CompetitiveProgramming | CodeChef/IPCCERT/solution.cpp | #include <iostream>
using namespace std;
void solve();
int main() {
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
solve();
return 0;
}
void solve() {
unsigned short n, k;
unsigned m, q;
cin >> n >> m >> k;
unsigned t[n][2];
unsigned short tmp;
for (unsigned short i = 0; i ... | ALGO | 0.999913 | 3.371075 |
1a8cd940-176e-455c-92c9-a1fc71388533 | ishandutta2007/codeforces | anz/normal/1385/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b) { for (; b; a %= b, swap(a, b)); return a; }
int main()
{
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int t; cin >> t;
while (t--)
{
set <int> st;
vector <int> ... | ALGO | 0.999829 | 4.403917 |
2f87bff8-d822-4ad0-af3a-5116c35168ea | simon7426/Competitive-Programming-AC-Submissions | Vjudge/UVA-11799.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define pb push_bac... | ALGO | 0.997663 | 4.218997 |
8d074a0d-2e2d-43c6-b126-1b402a000251 | Anikcsejnu/cpp-problem-solving | C++/codeforces/383/Breal.cpp |
#include<bits/stdc++.h>
#define mx 100007
using namespace std;
int a[mx], b[mx];
int main()
{
int x, n, co = 0;
cin>>n>>x;
for(int i = 0;i<n;i++)
{
cin>>a[i];
b[i] = a[i]^x;
}
for(int i = 0;i<n;i++)
{
cout<<b[i]<<" ";
}
//cout<<co<<endl;
}
| ALGO | 0.999941 | 3.418918 |
1aedecd9-9084-496e-bc8e-9147ac14b72a | JrSousaJ/Uri-Solved-Problems | 2569.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s, o, s1;
cin >> s >> o >> s1;
for(int i=0;i<s.size();i++)
{
if(s[i]=='7')s[i]='0';
}
for(int i=0;i<s1.size();i++)
{
if(s1[i]=='7')s1[i]='0';
}
stringstream f;
stringstream h;
long long int b, ... | ALGO | 0.999515 | 3.669356 |
27436e70-b8d3-4536-a1cc-eb4cb61d01cd | matt493/Pathfinding-Demo-OpenGL | main.cpp | #include "Grid.h"
//#include "Headers.h"
#pragma region funcDeclarations
void display();
void init();
void reshape(int, int);
void mouseFunc(int, int, int, int);
void keyboard(unsigned char, int, int);
//returns screen coordinates
Point getMatrixCoord(int, int);
//draw the grid system
void drawGrid();
//draw the pa... | ALGO | 0.973077 | 3.872418 |
8637d9b7-f0c4-4c79-b1e0-67f57de6e712 | GANGESHOTTEOK/yaman-algorithm | 23_programmers_2018_kakao_blind_recruitment/JUNG/캐시.cpp | #include <bits/stdc++.h>
using namespace std;
int solution(int cacheSize, vector<string> cities) {
deque<string> cache(cacheSize);
int answer = 0;
// 캐시 크기가 0이면 cities크기에 5를 곱한 값 반환
if (cacheSize == 0) {
return cities.size() * 5;
}
for (auto it = cities.begin(); it != cities.end(); it... | ALGO | 0.999749 | 5.291283 |
68a6cf21-3921-4ed7-858c-ee2d37d5d9ac | NiaSourceCode/AANAP | eigen3/doc/examples/class_VectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived>
segmentFromRange(MatrixBase<Derived>& v, int start, int end)
{
return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
}
template<typename Derived>
const Eigen::Vec... | TOOL | 0.982985 | 4.389442 |
18f45d3d-45a5-4b28-8e13-eb0826043039 | ishandutta2007/codeforces | riano_/normal/1610/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rrep2(i,n,k) for(int i=n-1;i>=n-k;i--)
#define vll(n,i) vector<long long>(n,i)
#define v2ll(n,m,i) vector<vector<long long>>(n,vll(m,i))
#define v3ll(n,m,k,i) vector... | ALGO | 0.999906 | 4.610496 |
74c89040-699d-4d87-bc47-3f02cb6862cb | pg1049/geodesic | include/igl/edges.cpp | template <typename DerivedF, typename DerivedE>
IGL_INLINE void igl::edges(
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E)
{
// build adjacency matrix
typedef typename DerivedF::Scalar Index;
Eigen::SparseMatrix<Index> A;
igl::adjacency_matrix(F,A);
igl::edges(A,E);
}
templa... | ALGO | 0.992809 | 5.598013 |
ec1d94fd-4294-4e81-b066-99e6ca4c8938 | ckckck1373/LeetCode_cpp | Problem/April_30_Day_Chanllenge/April17_Number_of_Islands.cpp | /*
Date: 4/18/2020
Recurrsion
*/
class Solution {
public:
int numIslands(vector<vector<char>>& grid) {
int num=0;
int x=0;
int y=0;
// special case
if(grid.size()==0){
return 0;
}
for(int i=0;i<grid.size();i++){
for(int ... | ALGO | 0.999981 | 6.275497 |
8779e196-28ab-41a0-b531-0d577aa29fd2 | PoletMontalvo/FP | practica J.cpp | // 1.-
int numeros[10];
int num, i = 0;
num = -1;
while (num != 0)
{
cout << "Numero: ";
cin >> num;
if (num == 0 and i > 9)
{
break;
}
numeros[i] = num;
i++;
}
for (int elemento : numeros)
{
cout << elemento << endl;
}
#include <iostream>
#include <vector>
using namespace std;
... | ALGO | 0.999036 | 3.455167 |
4645a9d6-cf07-400c-a065-97162212af24 | raysjoshua/UnrealEngine | Engine/Source/ThirdParty/hlslcc/hlslcc/src/hlslcc_lib/opt_dead_code.cpp | /**
* \file opt_dead_code.cpp
*
* Eliminates dead assignments and variable declarations from the code.
*/
#include "ShaderCompilerCommon.h"
#include "ir.h"
#include "ir_visitor.h"
#include "ir_variable_refcount.h"
#include "glsl_types.h"
static bool debug = false;
/**
* Do a dead code pass over instructions and ever... | ALGO | 0.900041 | 7.91006 |
504db2f2-6b16-46c1-80d2-135e5a72eb91 | bhushanblaster/July-Leetcode-Challenge | 9.cpp | /*
Maximum Width of Binary Tree
Solution
Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binary tree has the same structure as a full binary tree, but some nodes are null.
The width of one level is defined as the length ... | ALGO | 0.999847 | 6.624262 |
6faf6154-0e69-450d-939d-62c0d7d31e73 | surendiran04/Data-structures-and-Algorithms | Matrix/LowerTriangularmatrixInCpp.cpp | #include <iostream>
using namespace std;
class LTMatrix{
private:
int n;
int* A;
public:
LTMatrix(int n){
this->n = n;
A = new int [n * (n + 1)/2];
}
~LTMatrix(){ delete[] A; }
void Display(bool row=true);
void setRowMajor(int i, int j, int x);
void setColMajor(int i, i... | ALGO | 0.999383 | 3.761571 |
87a78f9e-855a-48ef-949d-e4f8b6df5033 | QuantumGhost/yuzu | externals/vcpkg/packages/boost-build_x64-windows/tools/boost-build/src/engine/headers.cpp | /*
* headers.c - handle #includes in source files
*
* Using regular expressions provided as the variable $(HDRSCAN), headers()
* searches a file for #include files and phonies up a rule invocation:
* $(HDRRULE) <target> : <include files> ;
*
* External routines:
* headers() - scan a target for include fil... | ALGO | 0.867193 | 6.128282 |
73a6e9ca-d4be-495c-a3c0-f970834c3181 | jianminchen/leetcode-cpp | src/MaximumSubarray.cpp | /*
* Problem: http://leetcode.com/onlinejudge#question_53
*/
#include <algorithm>
using namespace std;
class Solution
{
public:
int maxSubArray(int A[], int n)
{
// A[0]+..+A[i] stores in sum[i]
int* sum = new int[n];
sum[0] = A[0];
for( int i=1; i<n; ++i )
sum[i] = sum[i-1] + A[i];
// divide and co... | ALGO | 0.9996 | 6.001115 |
af07adbe-cfd9-492d-b9a5-e6cb14ba0627 | scyllacore/algorithm | C++ 풀이/acmicpc.net/9019(DSLR).cpp | #include <iostream>
#include <queue>
using namespace std;
struct number {
int n;
string cmd;
};
bool visited[10000] = { 0 };
int A, B;
string bfs() {
queue<number> bfsQ;
bfsQ.push({ A,"" });
visited[A] = 1;
int curN;
string curCmd;
while (!bfsQ.empty()) {
curN = bfsQ.front().n;
curCmd = bfsQ.front(... | ALGO | 0.999977 | 5.224986 |
4849c13e-5a9e-4489-8ba7-45b65decabba | GG772/Competitive-Programming | Codeforces/Constructive Algorithm/B. Olya and Game with Arrays.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n; cin >> n;
vector<vector<int>> a(n);
for (int i = 0; i < n; i++) {
int len; cin >> len;
for (int j = 0; j < len; j++) {
int tmp; cin >> tmp;
a[i].push_back(tmp);
}
sort(a[i].begi... | ALGO | 0.999666 | 3.598488 |
69eb3fe5-fcce-47ae-8661-1fdb7f5034ab | nbao0208/leet-code | Binary-Tree-Inorder-Traversal-easy/main.cpp | #include <iostream>
#include<vector>
#include<stack>
using namespace std;
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 *ri... | ALGO | 0.999714 | 5.974012 |
6e0d7d6e-5413-4b9a-970d-59d8ba1bb826 | wylited/solutions | codeforces/1900..1999/1950B.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
vector<string> a = {"##", ".."};
cin >> n;
for (int i = 0; i < n; i++) {
string s = "";
for (int j = 0; j < n; j++) {
if (j % 2 == 0) {
s += a[i % 2];
} else {
s += a[!(i % 2)];
}
}
cout << s ... | ALGO | 0.999684 | 3.417383 |
ce303d70-d4e2-4925-827b-24936ee4b2ac | codingaquarium/ProgrammingCollection | LightOJ/1026 - Critical Links.cpp | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream... | ALGO | 0.999825 | 4.134377 |
cb6f5ea9-776c-468e-92ef-0217c7378e56 | PoisWu/coding | lc/0005. Longest Palindromic Substring/5.cpp | #include <algorithm> // std::max
#include <iostream>
#include <string>
using namespace std;
class Solution
{
public:
string longestPalindrome(string s)
{
int strlen = s.length();
int start = 0;
int length_substring = 1;
for (int center = 0; center < strlen; center++) {
... | ALGO | 0.999957 | 6.264131 |
be8dbb21-95d9-4fe4-b314-a8dd79fc6508 | akj1608/HustleSeries | 217-contains-duplicate/217-contains-duplicate.cpp | class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
map<int,int>m;
for(int i=0;i<nums.size();i++)
{
m[nums[i]]++;
}
for(auto it=m.begin();it!=m.end();it++)
{
if((*it).second>1)
return true;
}
return f... | ALGO | 0.999871 | 5.779443 |
d5d1f718-44b6-4ec9-a957-cea6449b57aa | gosleeper/c_exe | 判断三角形6.cpp | #include<stdio.h>
int main() {
int a, b, c;
while(1){
scanf("%d %d %d",&a,&b,&c);
if(a==0||b==0||c==0){
break ;
}
if(a+b>c&&a+c>b&&b+c>a){
if(a==b&b==c){
printf("a equileteral triangle\n");
continue ;
}
else if(a==b||a==c||c==b)
{
printf("a isosceles triangle\n");
continue ... | ALGO | 0.999853 | 3.633534 |
26a82b88-ad50-43f1-abff-eeeb1347ea65 | yuvrajjsingh0/Scanne-Document-Scanner-Android | tesseract/src/main/cpp/tesseract/src/src/textord/underlin.cpp | #include "underlin.h"
double_VAR (textord_underline_offset, 0.1, "Fraction of x to ignore");
BOOL_VAR (textord_restore_underlines, true, "Chop underlines & put back");
/**********************************************************************
* restore_underlined_blobs
*
* Find underlined blobs and put them back in t... | TOOL | 0.962885 | 5.408533 |
8303309a-c82e-4b2a-b95b-adf29bb74dfb | duckladydinh/randoms | cpalgorithms/euler_path.cpp | #include "init.h"
// https://open.kattis.com/problems/eulerianpath
// Check existence condition before use
vector<int> adj[10000];
vector<int> euler(int i) {
vector<int> o;
stack<int> s;
s.push(i);
while (!s.empty()) {
i = s.top();
if (adj[i].empty()) {
o.emplace_back(i);
... | ALGO | 0.999429 | 4.93417 |
398ff40e-0f22-4a14-97d0-1f0fcd0e6b44 | DawnteaStudio/TIL | coding-test/Baekjoon/17000/17009.cpp | #include <iostream>
#define fast ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
using namespace std;
int main()
{
fast;
int a = 0, b = 0, input;
for (int i = 0; i < 3; i++)
{
cin >> input;
if (i == 0)
a += input * 3;
else if (i == 1)
a += inp... | ALGO | 0.999637 | 4.170636 |
f4286f73-c07a-4b9b-b180-70b77fcfddef | AyushPandey1502/LeetCode-Questions | 2472-build-a-matrix-with-conditions/2472-build-a-matrix-with-conditions.cpp | class Solution {
public:
vector<vector<int>> buildMatrix(int k, vector<vector<int>>& rowConditions, vector<vector<int>>& colConditions) {
vector<vector<int>> rowGraph(k + 1), colGraph(k + 1);
for (auto& rc : rowConditions) {
rowGraph[rc[0]].push_back(rc[1]);
}
for (auto& ... | ALGO | 0.99999 | 6.070769 |
ed661d29-210b-43ac-af21-cb53146320bc | jin3811/BAEKJOON | 14499.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
struct Dice {
int number[4][3] = {
{-1, 0, -1}, // 북
{ 0, 0, 0 }, // 서 상 동
{-1, 0, -1}, // 남
{-1, 0, -1}, // 하
};
int& get_under_num() {
return number[3][1];
}
int& get_top_num() {
return number[1][1];
}
void role_dice(int ... | ALGO | 0.999945 | 4.302182 |
41ff8b10-bec8-475e-81ef-cd6bb415a66d | ArchishmanSengupta/competitive-coding | Microsoft/binary_search_tree.cpp | #include<bits/stdc++.h>
using namespace std;
struct node {
int data;
node *left;
node *right;
node(int d) {
data = d;
left = NULL;
right = NULL;
}
};
// Insert in Binary tree
node* insertBST(node *root, int d) {
//EMPTY NODE
if (root == NULL) {
return new node(d);
}
if (d < root->data) {
root->le... | ALGO | 0.999972 | 5.038682 |
bbedd7f9-52d0-4f8d-9209-3aab40edcd2f | ishandutta2007/codeforces | leaf1415/normal/1076/C.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define rep(x, s, t... | ALGO | 0.999266 | 3.82319 |
baaf8d24-6932-4263-953a-2c16eaa9aa89 | mechiragjain/Data-Structure-Algorithms | Tree/11 - Lowest Common Ancestor in a Binary Tree.CPP | /*Given a Binary Tree with all unique values and two nodes value n1 and n2. The task is to find the lowest common ancestor of the given two nodes. We may assume that either both n1 and n2 are present in the tree or none of them is present*/
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
... | ALGO | 0.999814 | 5.50174 |
1cba1cd6-64d8-4269-a40c-cf6331d9d4a1 | ishandutta2007/codeforces | vercingetorix/normal/794/F.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef long do... | ALGO | 0.999591 | 4.348505 |
2535759e-1e55-460d-baf1-6c31349ac676 | AMICI-dev/AMICI | models/model_dirac/deltasx.cpp |
#include "amici/symbolic_functions.h"
#include "amici/defines.h" //realtype definition
typedef amici::realtype realtype;
#include <cmath>
using namespace amici;
namespace amici {
namespace model_model_dirac{
void deltasx_model_dirac(double *deltasx, const realtype t, const realtype *x, const realtype *p, const re... | ALGO | 0.968773 | 5.991543 |
44019de7-e731-4dab-af60-a05ca6b803e2 | dkonomis/Leetcode2025 | problems/0276-paint-fence/solution.cpp | class Solution {
public:
int numWays(int n, int k) {
/**
* Problem: 0276 - Paint Fence
*
* Paint n posts with k colors such that no more than two adjacent
* posts have the same color. Use dynamic programming tracking total
* ways to paint i posts, using the recu... | ALGO | 0.999732 | 7.10673 |
f55d2d67-291a-4d1d-bb87-e63a63a4eb84 | jindalshivam09/cppcodes | wituaMath2.cpp | #include<iostream>
#include<cmath>
#include<cstdlib>
#include<cstdio>
int arr[2000];
using namespace std;
#define ull unsigned long long
void prime()
{
int test , i, k, j, flag;
arr[0] = 2;
k = 1;
for(i = 3; i<10000; i = i+2)
{
flag = 0;
for(j=0; j<k; j++)
{
if(i%arr[j]==0)
{
flag++;
break;
}
}
if(flag==0)
{
arr[k] = i... | ALGO | 0.999932 | 3.549793 |
e155018c-f41a-4c13-9b69-efde3c207778 | ahmadsoliman/ACM | CodeBlocks/ACM/DP/MTREE.cpp | #include <stdio.h>
#include <string.h>
#include <vector>
#include <utility>
#define MOD 1000000007
using namespace std;
typedef struct{
int n,w;
}mypair;
vector<mypair> tree[100005], tree2[100005];
int n, weights[100005];
void dfs(int node, int w){
weights[node] = w;
int i;
for(i=0; i<tree[node].siz... | ALGO | 0.999986 | 3.855885 |
a5a03bbe-63a7-41b1-b8f1-3a7c3631987f | Jackarain/avhttp | boost/libs/random/test/histogram.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <boost/random.hpp>
void plot_histogram(const std::vector<int>& slots, int samples,
double from, double to)
{
int m = *std::max_element(slots.begin(), slots.end());
const int... | ALGO | 0.890207 | 5.646496 |
d3f1ec02-0f92-462b-b6aa-ce434d2271da | fry404006308/fry_course_materials | 201008之前/算法与数据结构(C++实现)/2、枚举/4、最大子段和/8、动态规划.cpp |
/*
动态规划解法
这道题目,也可以用动态规划来做
以第i个数结尾的最大连续子序列的和,只存在两种选择:
情形1:只包含a[i]
情形2:包含a[i]和以a[i-1]结尾的最大连续和序列
所以f[i]表示以第i个元素结尾的子序列的最大值
f[i]=max(f[i-1]+a[i],a[i]) (2<=i<=n)
所以要求所有序列的最大值,就是
Answer=max{f[i]|1<=i<=n}
初始状态:f[1]=a[1]
算法步骤:
1、确定动态规划初始条件:f[1]=a[1]
2、动态规划操作:f[i]=max(f[i-1]+a[i],a[i]) (2<=i<=n)
3、求ans:Answer=max{f[i]|1... | ALGO | 0.999953 | 4.278343 |
06e9a8cb-32b5-4bfe-87bb-ec3d7d0995ac | ankur-kayal/Contests | codeforces/1437/C.cpp | #include <bits/stdc++.h>
using namespace std;
//----------------------------------- DEBUG -----------------------------------
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > ... | ALGO | 0.99986 | 4.379167 |
508f13ae-d288-429f-afbe-624d3cd7a235 | Pryside/USBCPDto60V | Projects/NUCLEO-G474RE/Applications/USB_PD/DRP1M1_DRP/Drivers/CMSIS/NN/Examples/IAR/iar_nn_examples/NN-example-cifar10/arm_nnexamples_cifar10.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup CNNExample Convolutional Neural Network Example
*
* \par Description:
* \par
* Demonstrates a convolutional neural network (CNN) example with the use of convolution,
* ReLU activation, pooling and fully-connected functions.
*
* \par Model definition:
* \par
*... | DATA | 0.864139 | 5.572511 |
19bcd6bb-e782-4c4b-b7d8-3a3379af38f6 | Anmolsh-hh/DAA-main | week2/22.cpp | // Given an array of nonnegative integers, design an algorithm and a
// program to count the number of pairs of integers such that their
// difference is equal to a given key, K.
//method 1 sorting array using sorting like merge sort O(nlogn) & then doing
//binary search O(logn) for arr[i] + k.
#include<bits/stdc++.h... | ALGO | 0.999862 | 5.298052 |
43e8fc83-4fb3-4cf6-9630-45597963ea59 | codulluiandrei/pbinfo | pbinfo-2572/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, v[1000];
cin >> n;
for (int i = 0; i < n; i++) cin >> v[i];
for (int i = 0; i < n; i++) {
if (sqrt(v[i]) == int(sqrt(v[i]))) cout << "DA" << endl;
else cout << "NU" << endl;
}
return 0;
} | ALGO | 0.999622 | 4.20598 |
c9f21b88-164a-44c8-afc9-1ad96ae29f5d | AdarshGaur/Competitive-Programming | LeetCode/2482. Difference Between Ones and Zeros in Row and Column.cpp | // Author: @AdarshGaur
class Solution {
public:
vector<vector<int>> onesMinusZeros(vector<vector<int>>& grid) {
int n = grid.size(), m = grid[0].size();
vector<int> onesRow(n, 0), onesCol(m, 0), zerosRow(n, 0), zerosCol(m, 0);
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
... | ALGO | 0.999979 | 6.069169 |
1bd92c38-bb2c-4df6-97d5-d78c5adbdc35 | Sabyasachi048/LightOJ_solutions | 1410.cpp | #include <bits/stdc++.h>
#define prt_cs printf("Case %d: ",cs)
#define sqr(x) (x)*(x)
#define ms(a,b) memset(a, b, sizeof(a))
#define db double
#define ll long long int
#define MOD 100000007
#define PI ... | ALGO | 0.999232 | 3.706505 |
5d706922-32ad-42ec-90c7-60bc59e96706 | chakitg/cp_solutions | leetcode-potd/992. Subarrays with K Different Integers.cpp | Given an integer array nums and an integer k, return the number of good subarrays of nums.
A good array is an array where the number of different integers in that array is exactly k.
For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3.
A subarray is a contiguous part of an array.
Example 1:
Input: nums =... | ALGO | 0.99999 | 7.085736 |
29c2a69a-ee56-4fb8-b75a-ff9ea05f6e91 | mariospapa90/UE4-HW-4.18 | Engine/Source/ThirdParty/ICU/icu4c-53_1/source/i18n/search.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION
#include "unicode/brkiter.h"
#include "unicode/schriter.h"
#include "unicode/search.h"
#include "usrchimp.h"
#include "cmemory.h"
// public constructors and destructors -----------------------------------
U_NAMESPACE_BEGIN
SearchIt... | TOOL | 0.886725 | 4.234629 |
7858ed57-b42a-4b86-9da1-27e229812e7f | ahmedgamal23/slash-task | 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.998784 | 6.761023 |
7b81bffb-3999-4eb2-8993-1c0833e642ab | umaidansari12/CP | previous_codes/sum_of_gcd.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int gcd(int a, int b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
int SumOfGCD(int n) {
int sum = 0;
for (int i = 1; i <= n; i++) {
sum += (i * gcd(i, n));
}
return sum;
}
int main()
{
ios_base :: sync_with_stdio(false);
cin.tie(NUL... | ALGO | 0.999877 | 5.8257 |
8a98685c-1012-44f2-b710-2dc532d9a2cf | xueqing/CodeForces | A-level/A119-EpicGame.cpp | #include <stdio.h>
#include <string.h>
using namespace std;
int gcd(int a, int b) {
return (b == 0 ? a : gcd(b, a%b));
}
int main() {
int left, remove, turn = 0, number[5] = {0};
scanf("%d%d%d", &number[0], &number[1], &left);
while(true) {
remove = (left > number[turn] ? gcd(left, number[turn]) : gcd... | ALGO | 0.999976 | 3.006426 |
afc0827a-f45f-4441-9b76-c42dfc83c288 | anantdeepsingh/Leetcode | 3808-longest-palindrome-after-substring-concatenation-ii/longest-palindrome-after-substring-concatenation-ii.cpp | int dp[2002][2002], dp2[2001][2002];
class Solution {
public:
int longestPalindrome(string s, string t) {
int splitPt = s.size();
s += t;
int n = s.size();
int ans = 0;
memset(dp, 0, sizeof(dp));
memset(dp2, 0, sizeof(dp2));
for (int i = 0; i < n; i++) {
... | ALGO | 0.999919 | 5.482612 |
514cc640-af9f-4fe6-a19a-a69ce5a32c34 | UddinZia/My-Data-Structures-and-Algorithms | Binary Heap - Priority Queue/priority_queue_compile_test.cpp | #include <iostream>
#include <deque>
#include "priority_queue.h"
template <class T>
class MyContainer {
std::vector<T> array;
public:
using value_type = T;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = size_t;
using iterator = typename std::ve... | TOOL | 0.95601 | 5.019318 |
e1e7873b-d296-411e-90bf-2cd38e3cc89e | ishandutta2007/codeforces | kevin114514/normal/1510/D.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ALL(x) ((x).begin(),(x).end)
#define rALL(x) ((x).rbegin(),(x).rend)
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
void die(string S){puts(S.c_str());exit(0);}
d... | ALGO | 0.999979 | 3.101015 |
5cc37497-6b18-47d8-bf45-8d68d39838dc | juanitopereza/Diff_EQ_solvers | Pendulum1.cpp | #include <fstream>
#include <iostream>
#include <cmath>
using namespace std;
const double wO=1., gama=0.2;
const double h=0.1, delta=1.0;
const double F=1.4, w=0.2;
const int N=1000;
double g(double thetaO, double omegaO, double t);
double f(double thetaO, double omegaO, double t,double force);
int main(void){
ofst... | ALGO | 0.999497 | 3.603476 |
fe3b7ade-3a44-4889-ba04-81aa8ee65293 | WEGFan/Algorithm-Contest-Code | contests/2018-CCPC-Hunan-Provincial/C.cpp | #include <iostream>
using namespace std;
int main()
{
long long h, c;
while (~scanf("%lld %lld", &h, &c))
{
printf("%lld\n", max(h, c + 1));
}
return 0;
} | ALGO | 0.998415 | 3.364913 |
60e79a5c-38de-467c-b394-d6f4496494cc | sach4008/Practice_cpp_dsa_cp | LeetCode/450. Delete Node in a BST.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999999 | 6.491545 |
b93d1ddb-4f94-404c-9e89-ece4031458a2 | Credit-Smartchain/Credit-Classic-Core | src/libff/libff/algebra/curves/bn128/bn128_pairing.cpp | /** @file
********************************************************************************
Implements functions for computing Ate pairings over the bn128 curves, split into a
offline and online stages.
********************************************************************************
* @author This file is part ... | TOOL | 0.875034 | 7.486516 |
79680035-0e04-419b-95a7-a4f53918eb0a | ishandutta2007/codeforces | rajat1603/normal/603/C.cpp | #include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 5;
int n , k;
int arr[N];
int res;
int solve(int val){
if(val <= 3){
return val & 1;
}
if(val & 1){
return 0;
}
int v1 = solve(val - 1);
int v2 = solve(val >> 1);
if(0 == v1 || 0 == v2){
if(1 == v1 || 1... | ALGO | 0.999991 | 4.341928 |
6ac930b3-78ef-415f-a9f1-8981d4c43160 | Md-Kais/coding_problem | 30/B.cpp | ///----> bismillahir rahmanir rahim <---- -- { ^ _ ^ }
/// { ^_^ } { ^ _ ^ }
#include<bits/stdc++.h>
#include<bits/stdc++.h>
using namespace std;
//<--------------------------------------------typo section--------------------------------------------->
typedef long long ll;
typedef vector<int> vi;
typedef ... | ALGO | 0.99994 | 3.21531 |
bc032765-2a3c-45b6-82ea-83bcb6e092e9 | johan1103/baekjoonCoding | 백준문제풀이 연습/11656.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<deque>
using namespace std;
/*
ƽŰ ڵ : 32 a: 97 A: 65 0: 48
*/
int main() {
vector<string> sen;
string temp;
cin >> temp;
int length = temp.length();
for (int i = 0; i < temp.size(); i++) {
sen.push_back(temp... | ALGO | 0.998655 | 3.668946 |
88fc5d53-db2e-4400-8fd7-c0f05b7d59c9 | Bharat0709/Leetsync | 206-reverse-linked-list/reverse-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseList... | ALGO | 0.999526 | 5.608461 |
2807f100-8269-4511-8a2a-a496903f9d7e | Fluttery-Dev/CP | CF/B_GCD_Problem.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
const int MOD = 1e9 + 7;
const int INF = LLONG_MAX >> 1;
void solve()
{
int n;
cin >> n;
if (n & 1)
{
n /= 2;
if (n & 1)
cout << n - 2 << " " << n + 2 << " " << 1;
else
... | ALGO | 0.999886 | 4.526361 |
d2b7e83c-81ce-4392-a55b-80264929b507 | barnwal-anand/Interview_Preparation | Tree Problems/Maximum sum of Non-adjacent nodes.cpp | /*
Given a binary tree with a value associated with each node,
we need to choose a subset of these nodes such that sum of chosen nodes is maximum under a constraint
that no two chosen node in subset should be directly connected that is,
if we have taken a node in our sum then we can’t take its any children in considera... | ALGO | 0.999935 | 6.299133 |
b6836ec4-77a5-4032-a9b1-15cefdf4a032 | ptargino/uvaOnlineJudge | C++/Volume I/p116.cpp | #include <stdio.h>
long path[10][100];
inline int min(int a, int b){
return a < b ? a : b;
}
int minIndex(int i, int j, int k) {
return (path[i][k] == path[j][k] ? min(i, j) : (path[i][k] < path[j][k]) ? i : j);
}
int main() {
int m, n, i, j, k;
long minPath;
while (scanf("%ld%ld", &m, &n) == 2) {
for (i = 0... | ALGO | 0.99999 | 3.264007 |
900846e6-f7e7-4b69-80bb-5fe66cf616a0 | Naveen1422github/StiverDp | dp/4. dp_on_strings/l25-longestCommonSubsequence/memoSequence.cpp | #include<bits/stdc++.h>
//https://www.codingninjas.com/codestudio/problems/longest-common-subsequence_624879?source=youtube&campaign=striver_dp_videos&utm_source=youtube&utm_medium=affiliate&utm_campaign=striver_dp_videos
//tc =
int f(string &s, string &t, int n, int m, vector<vector<int>> &dp) {
if(n<0 || m<0)... | ALGO | 0.999979 | 5.898533 |
9697dfa2-a162-473d-a531-d7ca8ac99870 | vfolunin/archives-solutions | EOlymp/7809.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
map<int, int> count;
for (int value; cin >> value; )
count[value]++;
int res =... | ALGO | 0.997904 | 4.031807 |
1b0d772c-1d3b-4d93-9042-4924148108ef | Dongubak/ktcc-- | JBB/c16/c16_4.cpp | #include <iostream>
#include <string>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
int reduce(long ar[], int n){
sort(ar,ar+n); long * end = unique(ar,ar+n);
return end - ar;
}
int main(){
const int SIZE = 7;
long arr[SIZE] = {99,15,7,1,15,1,15};
cout << "Original array... | ALGO | 0.999057 | 4.799612 |
a5c78824-446d-48bb-860b-561d37367f9f | Abdev1205/parallel-programming | Lab/Lab-3.cpp | #include <iostream>
#include <omp.h>
using namespace std;
int main() {
int n = 1000;
int sum = 0;
// Combined parallel loop reduction
#pragma omp parallel for reduction(+ : sum)
for (int i = 0; i < n; ++i) {
sum += i;
}
cout << "Combined parallel loop reduction result: " << sum << endl;
// Orphaned... | ALGO | 0.998682 | 5.969687 |
a98aa8b6-33f6-42a5-99d6-20914f81b22d | Qrune/ACM-Practice | solution_1474.cpp | #include<iostream>
using namespace std;
int main()
{
char a[16] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
int m,n;
cin>>m>>n;
int count = 0;
int b[100];
while(m>=n)
{
count++;
b[count] = m%n;
m = m/n;
}
b[++count] = m;
for (int i=count; i>0; i--)
{
cout<<a[b[i]];
}
}
| ALGO | 0.99991 | 3.780781 |
e92b2dc4-e028-421d-8e2d-3fde2f6a64e7 | ARTCOIN1/ARTCOIN1 | src/wallet/crypter.cpp | #include <wallet/crypter.h>
#include <crypto/aes.h>
#include <crypto/sha512.h>
#include <script/script.h>
#include <script/standard.h>
#include <util/system.h>
#include <string>
#include <vector>
int CCrypter::BytesToKeySHA512AES(const std::vector<unsigned char>& chSalt, const SecureString& strKeyData, int count, un... | TOOL | 0.940061 | 7.290362 |
9bafaaa5-0fa2-4e3a-bf33-b972e9a57231 | suba1210/IPMP | 5_Linked_list/12_sort_ll_of_0s_1s_2s.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void displayLL(Node* head){
Node* temp = head;
cout<<"Linked List : ";
while(temp!=NULL){
cout<<temp->data<<" ";
temp = temp->next;
}... | ALGO | 0.999984 | 4.638201 |
58e874ff-770c-495e-a9e2-027b2546b4e5 | meldose/openCV | modules/dnn/src/ocl4dnn/src/ocl4dnn_inner_product.cpp | #include "../../precomp.hpp"
#include "../include/common.hpp"
#include "../include/ocl4dnn.hpp"
#include "../include/math_functions.hpp"
namespace cv { namespace dnn { namespace ocl4dnn {
template<typename Dtype>
OCL4DNNInnerProduct<Dtype>::OCL4DNNInnerProduct(OCL4DNNInnerProductConfig config)
{
bias_term_ = conf... | ALGO | 0.972178 | 6.682823 |
1504aa8f-8717-4618-8d15-e21e06cb61e7 | DunderGG/Vehicle-State-Estimator | eigen/bench/benchmarkX.cpp | // g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef MATTYPE
#define MATTYPE MatrixXLd
#endif
#ifndef MATSIZE
#define MATSIZE 400
#endif
#ifndef REPEAT
#define REPEAT 100
#endif
int mai... | ALGO | 0.932722 | 3.376298 |
58362215-8a86-4f18-ba21-8108ebbb265a | Mark-tz/kUn | plugins/Decision/PointCalculation/KickOffDefPosV2.cpp | #include "KickOffDefPosV2.h"
#include <GDebugEngine.h>
#include <vector>
namespace
{
const double DefDist = - Param::Vehicle::V2::PLAYER_SIZE;
CGeoLine def_line;
double DefY[3];
}
CKickOffDefPosV2::CKickOffDefPosV2()
{
VERBOSE_MODE = false;
def_line = CGeoLine(CGeoPoint(DefDist, -Param::Field::PITCH_WIDTH / 2)
... | ALGO | 0.983877 | 5.205544 |
daf4f771-8b78-444e-b8be-1cab7dae7313 | kei-academic/algo-method | 論理的思考力を鍛える!文章題(beta)/分配算1(プログラミング)/3.cpp | #include <bits/stdc++.h>
using namespace std;
/* accelration */
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
struct Fast {Fast() {std::cin.tie(0); ios::sync_with_stdio(false);}} fast;
/* alias */... | ALGO | 0.999593 | 3.810439 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.