uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
86d44bcd-a9c2-479e-9960-7da2846f160a | goldi1027/GT-EHL | boost_1_64_0/libs/graph/example/last-mod-time.cpp | using namespace boost;
template < typename Graph, typename VertexNamePropertyMap > void
read_graph_file(std::istream & graph_in, std::istream & name_in,
Graph & g, VertexNamePropertyMap name_map)
{
typedef typename graph_traits < Graph >::vertices_size_type size_type;
size_type n_vertices;
typena... | ALGO | 0.934518 | 5.494237 |
13a35cb6-7534-4a90-8ba1-02241a441f7e | aryasoni98/HacktoberfestPR2020 | scripts/C++/NPrimes.cpp | #include <bits/stdc++.h>
using namespace std;
// function check whether a number
// is prime or not
bool isPrime(int n)
{
// Corner case
if (n <= 1)
return false;
// Check from 2 to n-1
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return... | ALGO | 0.999128 | 5.338014 |
fe2b4512-6709-4326-96a0-cb0e2a91935d | PELUMIAJAYI0/C-plus-plus-Class | Pratice input and output od strings in arrays.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int numbers[10], i, average, total=0, max, min;
cout<<"Input the numbers"<<endl;
for(i=0; i<10; ++i)
{
cin>>numbers[i];
}
for(i=0; i<10; ++i)
{
cout<<"numbers["<<i<<"]="<<numbers[i]<<endl;
total= total+numbers[i];
cout<<""<<endl... | ALGO | 0.945729 | 3.052534 |
5ba74d2e-77ed-4e03-b359-2fda3064f9bf | subhamsahoo/interviewbit-DataStructure-and-Algorithms- | Subset.cpp |
void sets(vector<int> &nums,int begin,vector<int> &temp,vector<vector<int> > &result)
{
result.push_back(temp);
for(int i=begin;i<nums.size();i++)
{
temp.push_back(nums[i]);
sets(nums,i+1,temp,result);
temp.pop_back();
}
}
vector<vector<int> > Solution::subsets(vector<int> &A) ... | ALGO | 0.99996 | 5.330411 |
23141701-e2b7-47c3-b430-1bd0c0ce2416 | godot-extended-libraries/godot-fire | thirdparty/embree-aarch64/kernels/common/rtcore_builder.cpp | #define RTC_EXPORT_API
#include "default.h"
#include "device.h"
#include "scene.h"
#include "context.h"
#include "alloc.h"
#include "../builders/bvh_builder_sah.h"
#include "../builders/bvh_builder_morton.h"
namespace embree
{
namespace isa // FIXME: support more ISAs for builders
{
struct BVH : public RefC... | ALGO | 0.97822 | 5.476417 |
77418d9a-8b41-46de-a8ec-f4fcd4fdd18b | Alaxe/noi2-ranking | 2020/solutions/C/NCC-Sofia-smg/NCC/range.cpp | #include <iostream>
using namespace std;
#define MAX_N 100002
int a[MAX_N];
int main()
{
int n;
cin >>n;
int p;
for(int i=0; i<n; i++)
{
cin >> p;
a[p]++;
}
for(int i=1; i<MAX_N; i++)
{
a[i]=a[i-1]+a[i];
}
int m;
cin >> m;
int x, y;
int ans[m]... | ALGO | 0.999942 | 3.973454 |
2c910385-dd23-42ee-aa1d-3260b891880b | xarenwo/andst | IterativeMergeSort.cpp | #include <iostream>
using namespace std;
void Merge(int A[], int low, int mid, int high) {
int i,j,k;
k=low;
i=low;
j=mid+1;
int B[100];
while(i<=mid && j<=high)
{
if(A[i]<A[j]) {
B[k] = A[i++];
k++;
}
else {
B[k] = A[j++];
... | ALGO | 0.999937 | 4.350014 |
20bdc237-fbe8-4d10-8ef4-59326aa34f65 | abhishekmittal15/Competitive-Programming- | leetcode/0300LongestIncreasingSubsequence/time_optimised.cpp | #include<iostream>
#include<vector>
using namespace std;
int solve(const vector<int>& a){
int n = a.size();
vector<int> temp;
for(int i=0;i<n;i++){
int cur = a[i];
// we are binary searching over the temp array
int start = 0;
int end = temp.size()-1;
int index = -1;
while(start <= end){
int mid = (... | ALGO | 0.99995 | 4.4493 |
b1af8578-15cb-412a-b54b-bb050b231aae | nicolas-tdc/standard-vector-neural-network | NeuralNetwork.cpp | #include "NeuralNetwork.h"
#include <stdlib.h>
NeuralNetwork::NeuralNetwork(
int inputs_count,
int layers_count,
int neurons_per_layer,
int outputs_count
)
{
this->inputs_count = inputs_count;
this->outputs_count = outputs_count;
// Add input layer.
add_layer(inputs_count, neurons_per_... | ALGO | 0.863106 | 6.019611 |
a0caa972-247a-40d1-93ae-dec84af32721 | TanRai/Online_Judge_Solves | Leetcode/215. Kth Largest Element in an Array.cpp | //Explanation
//Keep inserting in the min heap. If heap size > k then pop from heap the top value as it can't be kth largest value, if there is a value less than it and all the k value in the heap is less than it.
class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
priority_queue<int,vec... | ALGO | 0.999979 | 5.204456 |
da4662a9-d9a3-4c5f-b617-49ae8399d9e0 | Leefir/MyCodes | Codeforces/CF382D.cpp | #include <ctime>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef pair<int,int>pii;
typedef vector<int> vi;
typedef vector... | ALGO | 0.999911 | 3.682747 |
d1792d79-ff30-43b1-a3eb-c18dd51dd253 | morrazzzz/Rengen-Luch-Source | xray-svn-trunk/nvtt/src/nvimage/BlockDXT.cpp | #include <nvcore/Stream.h>
#include "ColorBlock.h"
#include "BlockDXT.h"
using namespace nv;
/*----------------------------------------------------------------------------
BlockDXT1
----------------------------------------------------------------------------*/
uint BlockDXT1::evaluatePalette(Color32 color_array[4]... | TOOL | 0.873913 | 4.321459 |
694f629a-b518-4ef3-8762-0f472efa7ba9 | ruby-kim/Algorithm | Baekjoon(BOJ)/2000~2999/2446.cpp | #include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int N;
cin>>N;
for(int i=0; i<N; i++){
for(int j=0; j<i; j++)
cout<<" ";
for(int j=0; j<2*(N-i)-1; j++)
cout<<"*";
cout<<endl;
... | ALGO | 0.999838 | 3.641327 |
69e3478c-ca71-4723-93f8-7c1baa9fc195 | wschreyer/PENTrack | src/analyticFields.cpp | /**
* \file
* Static, analytical B fields
*
*/
#include "analyticFields.h"
using namespace std;
//TExponentialBFieldX constructor
TExponentialFieldX::TExponentialFieldX(const double _a1, const double _a2, const double _a3, const double _c1, const double _c2){
a1 = _a1; a2 = _a2; a3 = _a3;
c1 = _c1; c2 = _c2;
}... | ALGO | 0.945936 | 5.140172 |
a70e6f5f-3e7a-4475-9355-c5484ca8fdee | Larry-Kuo/Leetcode | P15_3Sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
set<vector<int>> s;
sort(nums.begin(), nums.end());
for(int i = 0; i < nums.size(); ++i){
int target = 0 - nums[i];
if(i > 0 && nums[i] == nums[i - 1]) continue;
//two sum problem
... | ALGO | 0.999916 | 5.738793 |
a7c587e9-3f90-46f3-902a-f2153e03878d | MuteMeteor/LintCode | C++/Sort/049 Sort Letters by Case.cpp | /*
Given a string which contains only letters. Sort it by lower case first and upper case second.
Example
For "abAcD", a reasonable answer is "acbAD"
*/
class Solution {
public:
/**
* @param chars: The letters array you should sort.
*/
void sortLetters(string &letters) {
// write your co... | ALGO | 0.999823 | 6.071675 |
d9312c25-f35a-47a2-b824-03887b3b0d2b | Haipm26/learningC | code c/sang nt/Untitled1.cpp | #include <stdio.h>
#include <math.h>
int n = 10000;
int prime[10000000];
void sang(){
for (int i = 0; i <= n; i++){
prime[i] = 1;
}
prime [0] = prime [1] = 0;
for (int i = 2; i <= sqrt(n); i++){
if (prime[i] == 1){
for (int j = i * i; j <= n; j += i){
prime[j] = 0;
}
}
}
}
int main(){
int n;
sa... | ALGO | 0.99974 | 3.795957 |
e84a0f2f-5947-426c-805b-c8a2a76e4515 | louhmmsb/IME | 3sem/desafios/aula13/b.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
int main(){
deque<int> q;
int n, s = 0, d = 0;
bool eas = true;
cin>>n;
for(int i=0; i<n; i++){
int aux;
cin>>aux;
q.push_back(aux);
}
while(!q.em... | ALGO | 0.999983 | 3.740426 |
d272499f-2e9c-41eb-93ea-d07afde44974 | mariaei3/appFlutter | flutter_application_1/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.99776 | 6.76775 |
8947b367-8c8e-46f3-a4a4-d7d9ed434cbf | vbonnici/grafe-sim | analysis/data/p01314/s503083182.cpp | #include <iostream>
using namespace std;
int main(){
int n;
while((cin>>n)&&(n!=0)){
int count=0;
int c=1;
while(c!=n/2+1){
int sum=0;
for(int i=c;i<=n;i++){
sum += i;
if(sum==n) count++;
}
c++;
}
cout << count << endl;
}
return 0;
} | ALGO | 0.999763 | 4.042828 |
7784c26b-3a68-4023-b4e8-9cbc44d531c6 | hecker1002/Placements | Arrays/Flood_Fill.cpp |
#include <bits/stdc++.h>
using namespace std ;
/*
Given n non-negative integers representing an elevation map where the width of each bar is 1,
compute how much water it can trap after raining.
*/
int trap(vector<int>& height) {
// Logic - Since smaller height decides water level ,
// Use sma... | ALGO | 0.999588 | 6.292735 |
74d5c5f4-d321-425b-a347-6d31b9b13436 | MarcosViniciusG/Competitive-Programming | Problems/CF/971C/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll solve(ll x, ll y, ll k) {
ll xm = ceil(1.0* x / k);
ll ym = ceil(1.0*y / k);
ll diff = ym-xm;
if(diff < 0)
xm--;
return xm + ym + abs(diff);
}
int main() {
ll t, x, y, k;
cin >> t;
while (t--)
{
... | ALGO | 0.999843 | 4.409877 |
af927fdc-b1ea-422e-b5d5-f752e2dbdd5c | abcivashritt/codechef | Admins and Shopping.cpp | #include <iostream>
using namespace std;
int main() {
int T;
cin>>T;
while(T--) {
int n, x, ai, largest = 0;
cin>>n>>x;
for(int i=0;i<n;i++) {
cin>>ai;
if ((x + ai - 1) / ai > largest)
largest = (x + ai - 1) / ai;
}
cout<<max(n, largest)<<"\n";
}
return 0;
}
| ALGO | 0.999527 | 3.763767 |
14e5aed9-264a-4423-a0f8-c92cf1a56e2b | boshishuoshuo/cppprimer | ch11/e11-23.cpp | #include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <algorithm>
#include <utility>
using namespace std;
void addChild(multimap<string, string> & families, const string &family, const string & child)
{
families.insert({family,child});
}
int main(int argc, char const *argv[])
{
mu... | TOOL | 0.958102 | 4.374894 |
27bf9b87-bd4a-43d3-8f58-8e881123fb34 | burlen/SciberQuestToolKit | eigen-3.0.3/eigen-eigen-3.0.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,2);
m << 1, 2,
3, 4;
//get location of maximum
MatrixXf::Index maxRow, maxCol;
float max = m.maxCoeff(&maxRow, &maxCol);
//get location of minimum
MatrixXf::Index minRow, m... | ALGO | 0.999309 | 4.010038 |
58f8f67a-95e5-415b-b950-c573e9200ea8 | salllman84/AllCodes | C++/DSA Data Structure and Algurithems/Array/SubArrTwoLoops.cpp | #include<iostream>
using namespace std;
// by chatgpt not optimal way || missing numberrs
void PrintSubArrays(int arr[], int size) {
// Outer loop to pick the starting point of the subarray
for (int start = 0; start < size; start++) {
// Inner loop to extend the subarray to different end poin... | ALGO | 0.988191 | 4.681995 |
fdd1414a-e161-4468-b553-e5dfcac6b7ff | 200221192/DAA_ASSIGNMENT | week1question3.cpp | // question 3 week1
#include<iostream>
#include<math.h>
using namespace std ;
int jump_search(int arr[] , int n , int key ){
int i ,j ,k ;
int no_comparison = 0 ;
i = 0 ;
j = sqrt(n);
while(arr[j]<key && j<n){
i = j ;
j+=sqrt(n);
no_comparison++ ;
if(i>=n){
... | ALGO | 0.999817 | 3.681846 |
de5b7076-9397-43ce-9011-f0e6e79c565c | sinic46/base-app | base_app/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.998318 | 6.785645 |
bc9db9f0-2906-407b-9ef0-922ec4c35337 | guihunkun/LeetCode | 762.cpp | class Solution
{
public:
unordered_set<int> primes = {2, 3, 5, 7, 11, 13, 17, 19};
int bitsCount(int n)
{
int res = 0;
while(n > 0)
{
n = n & (n - 1);
++res;
}
return res;
}
int countPrimeSetBits(int L, int R)
{
int res =... | ALGO | 0.999799 | 5.40128 |
1b9a0574-c9d6-4754-b872-3e59c199ff72 | ABHI-GUPTA26/leetcode-problem | linkedlist/20-valid-parentheses/valid-parentheses.cpp | class Solution {
public:
bool isValid(string x) {
stack<char> st;
int n = x.size();
for(int i = 0; i < n; i++) {
if(x[i] == '(' || x[i] == '{' || x[i] == '[') {
st.push(x[i]);
} else {
// If the stack is empty or the top of the... | ALGO | 0.998589 | 6.787011 |
288aeb19-0794-41e9-acd3-6a88e19dd9ff | GabrielScalici/uva-solutions | ex01-08.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <stack>
#include <queue>
#define MAX 100
using namespace std;
int main(int argc, char const *argv[]){
int i = 0, n = 0, m = 0, x = 0, y = 0, numero = 0, aux = 0;
//estruturas usadas
vec... | ALGO | 0.999929 | 3.938352 |
15f9e5ba-e2c5-49e6-9936-b4ca3daea891 | caoshen/codehdu | 1299.cpp | /**
1299
**/
#include <iostream>
using namespace std;
const int M = 35000;
int prime[M + 5];
void pi() {
for (int i = 2; i * i <= M; ++i) {
if (prime[i] == 0) {
for (int j = i * i; j <= M; j += i) {
prime[j] = 1;
}
}
}
}
int main() {
pi();
int t, d = 1;;
cin >> t;
while (t--) {
int n, sum = 1... | ALGO | 0.999952 | 4.565844 |
91c80ba7-0752-458a-b3e7-d45943064105 | gunjan1909/ai_lab_6th_sem | ucs.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> graph;
map<pair<int, int>, int> cost;
// returns the minimum cost in a vector( if there are multiple goal states)
vector<int> uniform_cost_search(vector<int> goal, int start)
{ // minimum cost upto goal state from starting state
vector<int> answer;
... | ALGO | 0.999968 | 5.082797 |
fdfcb109-5b7f-43ad-b272-f84aab34a052 | Sudo42b/Problem_Solving-Algorithm- | Algorithm_Study/1463.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int dp[1000001];
int func(int n)
{
if (n < 0)
return 0;
if (n == 1)
return 1;
if (dp[n] == -1)
dp[n] = 9876543210;
else return dp[n];
if (n % 3 == 0)
{
if (n % 2 == 0)
{
return dp[n] = min(min(func(n / 3), func(n/2)), f... | ALGO | 0.999987 | 4.24374 |
eee742c6-3081-4bb6-aa8d-d606fa353264 | mutanteelmo/flutter | curso_flutter/expenses/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.998177 | 6.763549 |
29cc3203-d10e-4773-881b-89440ac7f1f3 | dinhtuyen3011/cpp | Basic C++ Training/Sources/Mod04 - Decision Making/Exercises/Practice20.cpp | /*Write a program in C++ to display Pascal's triangle like pyramid.
Sample Output:
Input number of rows: 5
1
1 1
1 2 1 ... | ALGO | 0.999572 | 5.606874 |
e65164f9-f177-4f5a-9b83-85d25a54b1a6 | pk-021/CodeForces-Challenge | B_pspspsps.cpp | #include <iostream>
using namespace std;
int main()
{
int nTests;
int nVals;
char ch;
bool sFound;
bool pFound;
bool isValid;
string inputStr;
cin >> nTests;
while (nTests--)
{
sFound = false;
pFound = false;
isValid = true;
cin >> nVals;
... | ALGO | 0.99805 | 4.098928 |
06d11ac0-ce5f-47d0-816b-0a9cd7215963 | osvchnk/Parallel-programming | OpenMP/task14.cpp | /* Написать параллельную программу возведения числа 210 в квадрат без операции умножения.
* Пояснение: Квадрат натурального числа N равен сумме первых N нечетных чисел. Например, 32 = 9
* это 1+3+5=9; 52 = 25 это 1+3+5+7+9=25
*/
#include <stdio.h>
#include <omp.h>
#include <iostream>
#include <stdlib.h>
int main()
{
... | ALGO | 0.999415 | 3.503698 |
37ca4e5b-6b2d-46f2-a05f-42a9ec482180 | Jedsek/luogu-practice | P1305.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
string a;
int n;
cin>>n;
cin>>a;
n--;
while(n--){
string s;
cin>>s;
int x = a.find(s[0]);
a.erase(x,1);
a.insert(x,s);
}
for(int i = 0;i<a.size();i++){
if(a[i]=='*')cont... | ALGO | 0.999906 | 3.22535 |
c1862c26-64fb-4c48-92d8-64e1ba8fd753 | apple1003232/Leetcode | Power of Two.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
while((n%2 == 0) && n>1)
n=n/2;
if(n==1)
return true;
else return false;
}
}; | ALGO | 0.999369 | 5.992303 |
1b6df28d-feeb-401a-9d17-bf7c6d55a0a6 | wanl1n/parallel-universe | rtiow/opencv/sources/3rdparty/openexr/IlmImf/ImfFastHuf.cpp | #include "ImfFastHuf.h"
#include <Iex.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <vector>
OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
//
// Adapted from hufUnpackEncTable -
// We don't need to reconstruct the code book, just the encoded
// lengths for each symbol. From the lengths, we can... | ALGO | 0.978272 | 5.705404 |
6bb50154-70f5-4b25-ad4d-99b1d6e78fd0 | Bob8percent/Programming-Abstractions-in-C- | 18/Ex13/main.cpp | #include <iostream>
#include <cctype>
#include <sstream>
#include <fstream>
#include <string>
#include "graphpriv.h"
#include "Library/vector.h"
int main() {
std::ifstream ifs;
ifs.open("CableGraph.txt");
if (ifs.fail()) {
std::cerr << "ERROR : ファイルを開けません" << std::endl;
std::exit(EXIT_FAILURE);
}
Graph<City... | ALGO | 0.973443 | 3.408571 |
14a451f7-bb31-43da-8a88-3339166c4483 | itspixxel/GEC_Sem1 | Prog17_localVariablesAndCopies/Prog17_localVariablesAndCopies.cpp | #include <iostream>
using namespace std;
void addTwo(int num);
int main()
{
int myNum = 6;
cout << "Main: [before]: myNum = " << myNum << endl;
addTwo(myNum);
}
void addTwo(int num)
{
num += 2;
cout << "Function: num = " << num << endl;
} | TOOL | 0.961596 | 5.337189 |
d3ca83a6-fe46-4c60-bc96-7b25630c7d2f | Mayaraassis/Desafios_logica | 2108 - Contando Caracters.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
string maior;
string encontreMaior(string a, string b) {
return (a.size() > b.size()) ? a : b;
}
int main() {
string linha;
getline(cin, linha);
while (linha != "0") {
vector<string> palavras;
... | ALGO | 0.999483 | 4.737924 |
38487c6b-bb39-4b49-bdd1-935b4c33e932 | JohnstonLiu/cp12 | cses/1070.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
if(n==1) {
cout << 1;
return 0;
}
if(n<=3) {
cout << "NO SOLUTION";
return 0;
}
if(n%2==0) {
for(int i=2; i<=n; i+=2)
cout << i << " ";
for(int i=1; i<n; i+=2... | ALGO | 0.999933 | 4.040651 |
84389b4c-7061-4e7e-ae27-acd77e90a64c | ishandutta2007/codeforces | craborac/normal/448/D.cpp | #include<cstdio>
#include<algorithm>
#include<cmath>
#include<iostream>
using namespace std;
long long mas[(int)1e5 + 10];
int main()
{
long long n, m, k;
cin >> n >> m >> k;
if(k == n * m)
{
cout << n * m;
return 0;
}
if(k == 1)
{
cout << "1";
return 0;
... | ALGO | 0.999978 | 3.61134 |
cf44cbd6-23f2-4d88-bf20-930d27b5c322 | nn-fiha/Competitive-Programming- | UVA/uva694.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long int a,l,count=0,n=0,t=0;
while(cin>>a>>l)
{t++;
if(a<0&& l<0)break;
count=1;
n=a;
while(n>1)
{
if(n%2==0)
{
n=n/2;
if(n>=l)break;
... | ALGO | 0.999697 | 3.902382 |
85a0c690-7c22-42a7-aa6d-660a3a2d35f3 | VishnuNadella/CommUnity-Auth | 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.998859 | 6.785645 |
6c9ad4c4-0c57-4338-83e6-c14cf5e15116 | KiSSel3/Kiselev_Andrey_153504 | lab8/task1/task1.cpp | // 8, 1. : . 153504
/*. , ,
, , , , , .
, (
).
*/
#include <iostream>
#include <string>
struct book {
int number;
std::string author;
std::string name;
int year;
std::string publisher;
long long int pages;
};
void ShellSort(book* lib, int size) {
int i, j, step;
int tmp;
book buff;
... | ALGO | 0.995178 | 3.804614 |
4c500c17-f0c4-4046-84f3-ee2ebcf7bddb | sumayan7477/C.Tutorial- | learncpp.com#1.0#1/operators/arithmetic_operators/source3.cpp | bool IsEven(int x)
{
// if x % 2 == 0, 2 divides evenly into our number
// which means it must be an even number
return (x % 2) == 0;
} | ALGO | 0.983456 | 5.436031 |
619ea357-12d3-4a91-a896-000f5fcc353e | LemoNade2000/ProblemSolving | BOJ/15XXX/15576/src/BigIntegerMul.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef complex<double> cpx;
#define MOD 1000000007
#define PI acos(-1)
string aStr, bStr;
vector<int> aVec, bVec;
vector<ll> ret;
void fft(vector<cpx> &a, bool inv = false){
int n = a.size();
vector<cpx> rou(n >... | ALGO | 0.999989 | 4.920712 |
efdec9c8-d0ed-4c1a-88a9-6504ad0e1ed5 | kamilszymczak1/my_solutions | cf/contests/1717/d.cpp | #include <cstdio>
using namespace std;
const long long mod = 1'000'000'007;
const long long mod_pow(long long x, long long exp) {
if(exp == 0)
return 1;
long long result = mod_pow(x, exp / 2);
result = (result * result) % mod;
if(exp % 2 == 1)
result = (result * x) % mod;
return r... | ALGO | 0.999984 | 4.418619 |
8fb23e1f-627a-4ca4-8267-003dc48b50db | Rishabhkumar1714/DSA | Cpp-DSA-/13.Graphs/6.cycUn(DFS).cpp | #include <iostream>
#include <vector>
using namespace std;
const int N = 1e5;
vector<int> adj[N];
vector<bool> vis(N, false);
bool isCycle(int node, int parent)
{
vis[node] = true;
for (auto i : adj[node])
{
if (!vis[i])
{
if (isCycle(i, node))
{
re... | ALGO | 0.99993 | 5.293613 |
65506b58-e9d7-495c-9282-1ea83eca44fe | DGtal-team/DGtal | examples/geometry/meshes/curvature-comparator-ii-cnc-3d.cpp | /**
* @file geometry/meshes/curvature-comparator-ii-cnc-3d.cpp
* @ingroup Examples
* @author Jacques-Olivier Lachaud (\c <EMAIL> )
* Laboratory of Mathematics (CNRS, UMR 5127), University of Savoie, France
*
* @date 2022/02/27
*
* An example file named curvature-comparator-ii-cnc-3d.
*
* This file is part of ... | ALGO | 0.877279 | 7.557978 |
52faa088-9ff9-48c8-81da-472e0a1a4dd5 | 0Neokun0/c_plus_plus_2023_7_03 | c++入門/conditional operator/conditional_operator_2.cpp | /*
*/
#include <iostream>
using namespace std;
int main()
{
int num1{}, num2{};
cout << "Enter two integers separated by a space : ";
cin >> num1 >> num2;
if (num1 != num2)
{
cout << "Largest: " << ((num1 > num2) ? num1 : num2) << "\n";
cout << "Smallest: " << ((num1 < num2) ? n... | ALGO | 0.999658 | 3.673709 |
37190961-e425-4542-ae7a-addafbb4b36d | htzs2050/ojplus-frontend | hello-algo/codes/cpp/chapter_array_and_linkedlist/array.cpp | /**
* File: array.cpp
* Created Time: 2022-11-25
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 随机访问元素 */
int randomAccess(int *nums, int size) {
// 在区间 [0, size) 中随机抽取一个数字
int randomIndex = rand() % size;
// 获取并返回随机元素
int randomNum = nums[randomIndex];
return randomNum;
}
/... | ALGO | 0.932754 | 4.848577 |
7a5211d3-40c2-4423-82eb-9018873fb4ed | m-laxman/cp | practice/Div4/A_YES_or_YES.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template <typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::... | ALGO | 0.999841 | 5.198882 |
86b9e7d3-91be-482f-851e-63d877ee0ef7 | ScienceLi1125/CQU-Study | 大二上/程序设计实践/STL容器/7.统计英文单词个数(map键值对).cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
int main(){
int T,n;
cin>>T;
for(int i=0;i<T;i++){
cin>>n;
map<string,int> m;
for(int j=0;j<n;j++){
string s;
cin>>s;
m[s]+=1; //ĬֵΪ0
}
... | ALGO | 0.999391 | 3.546411 |
842469d7-0415-48e7-8e12-d84f1af4059b | tonimctoni/textmaker | test03.cpp | // #include <iostream>
#include "matrix.hpp"
#include <array>
#include <random>
template<unsigned long input_size, unsigned long mem_cell_size, unsigned long output_size>
struct LstmParam
{
static constexpr unsigned long concat_size=input_size+mem_cell_size;
//LSTM weights
Matrix<input_size, mem_cell_size>... | ALGO | 0.99815 | 6.801303 |
202f31e6-028f-4c70-84a2-88f37e2ec1bf | Priyamesh/Leetcode_solutions | 187-repeated-dna-sequences/187-repeated-dna-sequences.cpp | class Solution {
public:
vector<string> findRepeatedDnaSequences(string s) {
unordered_map<string,int>memo;
string window="";
int left=0;
while(left<s.size())
{
window=s.substr(left,10);
memo[window]++;
left++;
}
... | ALGO | 0.999234 | 4.987228 |
77b880a5-e0bb-4de2-a331-d2859d0cd324 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt35/Codenet/p00486/705098854/response_4.cpp | #include <cstdio>
int main() {
long long osum = 0LL;
long long f1, f2, f3, w, h, L, HL, temp, oxy[2][2], *LXY[2], ox, oy, max = 0,
dx, dy;
long long XY[2][100000];
scanf("%lld %lld", &w, &h);
scanf("%lld", &L);
for (f1 = 0; f1 < 2; f1++... | ALGO | 0.999963 | 3.602191 |
0f5719d7-3932-4873-8187-1bb66c3d43d1 | ShaziaSulemane/vine-gap-cnn | opencv_build/opencv/samples/cpp/tutorial_code/video/optical_flow/optical_flow.cpp | #include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/video.hpp>
using namespace cv;
using namespace std;
int main(int argc, char **argv)
{
const string about =
"This sample demonstrates Lucas-Kanade O... | ALGO | 0.9838 | 6.242239 |
187f3dbe-2b68-4f95-aaab-70c43b732111 | OsamaElHattab/Algorithms-Course | Lab Exam/TreasuresCollection.cpp | #include <iostream>
#include <stdio.h>
#include <sstream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <vector>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream... | ALGO | 0.999956 | 3.838707 |
8ee40529-ef9c-478c-803d-a69a05d60258 | nomaannm/DS-ALGO-Sheets | Stoney Codes/Q1382.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.999992 | 6.681543 |
75a2a04a-3cba-48e4-b248-4ca3e5f0bead | abdal-hussein/Programming-at-SeattleU | CPSC 3500 Computing Systems/HW2 - Scheduling Algorithms/mas.cpp | /* Justin Thoreson
* CPSC 2500 Computing Systems
* HW2: mas.cpp
* 20 April 2021
*
* SUMMARY:
* This program is meant to simulate the Multiqueue Adaptive Scheduling (MAS)
* algorithm, which utilizes three separate queues to schedule the processes
* that arrive in the system. When a process's remaining burs... | ALGO | 0.985579 | 5.181737 |
27ca3550-b747-4cfb-8adb-d4d2eda833e0 | PaulStoffregen/RadioHead | RHCRC.cpp | // Port to Energia / MPS430 by Yannick DEVOS XV4Y - (c) 2013
// http://xv4y.radioclub.asia/
//
// Adapted to RadioHead use by Mike McCauley 2014
// This is to prevent name collisions with other similar library functions
// and to provide a consistent API amonng all processors
//
/* $Id: RHCRC.cpp,v 1.1 2014/06/24 02... | TOOL | 0.902837 | 4.346773 |
fd61f84a-5875-415c-b037-f91494b96e5a | fmorenovr/ComputerScience_UCSP | MCC203-Computacion_Grafica/Trabajo_2_Fast-Winding-Numbers/fast-winding-number-soups/libigl/include/igl/all.cpp | template <typename AType, typename DerivedB>
IGL_INLINE void igl::all(
const Eigen::SparseMatrix<AType> & A,
const int dim,
Eigen::PlainObjectBase<DerivedB>& B)
{
typedef typename DerivedB::Scalar Scalar;
igl::redux(A,dim,[](Scalar a, Scalar b){ return a && b!=0;},B);
}
#ifdef IGL_STATIC_LIBRARY
// Explicit... | TOOL | 0.853667 | 3.619842 |
3e96fa5c-e57b-4f48-b051-3cb6738de7ba | iznilul/leetcode- | editor/cn/[剑指 Offer 38]字符串的排列.cpp | //输入一个字符串,打印出该字符串中字符的所有排列。
//
//
//
// 你可以以任意顺序返回这个字符串数组,但里面不能有重复元素。
//
//
//
// 示例:
//
// 输入:s = "abc"
//输出:["abc","acb","bac","bca","cab","cba"]
//
//
//
//
// 限制:
//
// 1 <= s 的长度 <= 8
// Related Topics 回溯算法
// 👍 185 👎 0
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {... | ALGO | 0.999691 | 5.959569 |
5f0d8ece-6379-4576-ac29-ef42c3a802b6 | 2sang/algorithms | week5/week5-2.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#include <ctime>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;
int arr0[51], arr1[501], arr2[5001], arr3[10001];
void load_50(){
freopen("input/input50.txt", "r", stdin);
for(int i = 0; i < 50; i++){
scanf("%d", &arr... | ALGO | 0.999732 | 4.338349 |
98238e9d-18b8-45a8-abc3-70df3e5e479f | Lotuses-robot/Codes | Codeforces/Contest/1675/A/A.cpp | #include <cstdio>
#define max(x, y) ((x) > (y) ? (x) : (y))
int main() {
int T;
scanf("%d", &T);
while (T--) {
int a, b, c, x, y;
scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);
x -= a;
y -= b;
x = max(0, x);
y = max(0, y);
if (x + y <= c) {
... | ALGO | 0.997419 | 3.259535 |
d70f702a-4caf-4df1-9fa7-906578e97277 | Hitansh1G/Code_forces | Perfect_Permutation.cpp | #include<iostream>
using namespace std;
int main (){
int n;
cin >> n;
if ( n % 2 == 1){
cout << "-1" << endl;
}
else {
cout <<"2 1";
for( int i = 3 ; i < n ; i+=2 ){
cout << " "<< i + 1 << " "<< i ;
}
cout << endl;
}
return 0 ;
} | ALGO | 0.99955 | 3.605488 |
d1ae77cb-a5c7-4cf4-bebb-b58521a80bfb | dingchen-github/PathPlanning | src/Eigen-3.3/doc/examples/TutorialLinAlgRankRevealing.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 5,
2, 1, 4,
3, 0, 3;
cout << "Here is the matrix A:\n" << A << endl;
FullPivLU<Matrix3f> lu_decomp(A);
cout << "The rank of A is " << lu_decomp.rank() << endl;
c... | ALGO | 0.999665 | 3.720849 |
c50c4687-69df-4f7a-9325-8166ddd75ff3 | NlNJ4/CEDT-Comprog | 06/Uniqecount.cpp | #include "bits/stdc++.h"
using namespace std;
int main(){
string line ;
getline(cin,line);
string word;
vector<int> unique,unique2;
word = "";
for(int i = 0 ; i < line.size();i++){
if(line[i]!=' '){
word+=line[i];
}
else{
if(word=="") continue;
... | ALGO | 0.999959 | 3.760774 |
2da3ee2b-8e56-453b-b045-13baaab5bceb | alphaRaWaY/2025ACM | oldlist/Segment tree/0x14/0x14(v2).cpp | //查询不保证左端点小于右端点!!!!!
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define inc(i,a,b) for(int i(a);i<=b;i++)
#define dec(i,a,b) for(int i(a);i>=b;i--)
int ls(int a){return a<<1;}
int rs(int a){return (a<<1)|1;}
int n,m;
const int MAXN(1e5+5);
int nums[MAXN];
struct node
{
int l,r,tag,val;
... | ALGO | 0.999952 | 4.420071 |
399af53e-0bd9-4d36-9ad6-73a6944dc33f | Rajnikant3862/codingblocks | 28_Binary Search Tree/Challenges Trees/24BuildBST.cpp | //Build BST
#include<iostream>
using namespace std;
class node {
public:
int data;
node *left;
node *right;
node(int d) {
data = d;
left = NULL;
right = NULL;
}
};
node *buildTree(int *arr, int s, int e) {
if(s>e) {
return NULL;
}
int mid = (s+e)/2;
... | ALGO | 0.99994 | 5.9919 |
92c13ee9-17b6-4452-95a0-8c44f1145621 | martijnmartijnmartijnmartijn/Quantum-advantage-k-SAT-with-structure | solvers/CaDiCaL/test/api/traverse.cpp | #include "../../src/cadical.hpp"
#ifdef NDEBUG
#undef NDEBUG
#endif
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
using namespace CaDiCaL;
static string path (const char *suffix) {
const char *prefix = getenv ("CADICALBUILD");
string res = prefix ? prefix : "."... | TEST | 0.906036 | 7.039228 |
b236339e-0c93-43c0-8d0c-00dbf7ed3558 | herrkrabbe/RegressionCompulsory | Libraries/eigen-3.4.0/bench/spmv.cpp |
//g++-4.4 -DNOMTL -Wl,-rpath /usr/local/lib/oski -L /usr/local/lib/oski/ -l oski -l oski_util -l oski_util_Tid -DOSKI -I ~/Coding/LinearAlgebra/mtl4/ spmv.cpp -I .. -O2 -DNDEBUG -lrt -lm -l oski_mat_CSC_Tid -loskilt && ./a.out r200000 c200000 n100 t1 p1
#define SCALAR double
#include <iostream>
#include <algor... | ALGO | 0.97338 | 4.293816 |
c1e6f209-8fc3-4334-ad99-5f110d48ef54 | SophiaTX/SophiaTX-MainNet | libraries/fc/src/crypto/dh.cpp | #include <fc/crypto/dh.hpp>
#include <openssl/dh.h>
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
#endif
namespace fc {
SSL_TYPE(ssl_dh, DH, DH_free)
static bool validate( const ssl_dh& dh, bool& valid ) {
int check;
DH_check(dh,&check);
return valid = !(check /*& DH_CHECK_P_NOT_SAFE_PRIME*/);
}
bool diffie_he... | TOOL | 0.986193 | 6.389132 |
10566a00-0c8a-4be4-b90b-02d39c5c2fb1 | nirbar/boost | libs/bimap/example/mi_to_b_path/bidirectional_map.cpp | // Boost.Bimap Example
//-----------------------------------------------------------------------------
// This example shows how to construct a bidirectional map with
// multi_index_container.
// By a bidirectional map we mean a container of elements of
// std::pair<const FromType,const ToType> such that no two element... | ALGO | 0.970683 | 6.412298 |
08338cbd-245d-4087-a543-c21214be65ba | Smirn0v-da/2sem_labs | week3/Ex7.cpp | #include <iostream>
using std::cin;
using std::cout;
using std::endl;
struct Cat {
char name[20];
unsigned int id;
double weight, length;
unsigned int mice_caught;
};
unsigned int count_total_mice_amount(Cat* cats, unsigned int n);
int main() {
unsigned int n;
cin >> n;
Cat *a = new Cat[n... | ALGO | 0.96638 | 3.859671 |
2b71bd6b-574c-45c9-a53d-c4d173ffcd6c | khushhallchandra/algoPractice | hackerrank/algo/greedy/grid.cpp | // https://www.hackerrank.com/challenges/grid-challenge
#include<bits/stdc++.h>
using namespace std;
int main(){
int T, N, check;
string temp;
cin>>T;
while(T--){
check=1;
vector<string> vec;
cin>>N;
vector<char> vec1(N);
for(int i=0;i<N;i++){
cin>>temp;
vec.push_back(temp);
}
for(int i=0;i<... | ALGO | 0.999918 | 4.614287 |
806532e6-8ef7-4631-bcbb-6cc417ae64d7 | mt-shihab26/courses | 06_phase1_youknowwho-academy/class-04-Saviors/contest-01-Saviors/F_-_FIGUREFUL.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, a, b;
cin >> n;
string c;
map<pair<int, int>, string> mp;
for (int i = 0; i < n; i++)
{
cin >> a >> b >> c;
mp[{a, b}] = c;
}
int q;
cin >> q;
while (q--)
{
cin >> a >> b;
cout ... | ALGO | 0.999817 | 4.42201 |
afb7984b-858f-49db-83f8-8a1eefb335a9 | whynesspower/leetcode | 2244-minimum-rounds-to-complete-all-tasks/2244-minimum-rounds-to-complete-all-tasks.cpp | class Solution {
public:
int minimumRounds(vector<int>& tasks) {
unordered_map<int,int>mp;
for(auto x:tasks){
mp[x]++;
}
int ans=0;
for(auto x:mp){
int b=x.second;
if(b==1) return -1;
if(b%3==0) ans+=b/3;
else if(b%3... | ALGO | 0.999866 | 5.81264 |
c516f413-10ea-49bc-8794-40222cccbc7e | meshubh/MissionRnD-C-LinkedLists-Worksheet | src/removeEveryKthNode.cpp | /*
OVERVIEW: Given a single linked list, remove every Kth node in the linked list.
E.g.: 1->2->3->4->5 and K 2, output is 1->3->5.
INPUTS: A linked list and Value of K.
OUTPUT: Remove every Kth node in the linked list.
ERROR CASES: Return NULL for error cases.
NOTES:
*/
#include <stdio.h>
struct node {
int num;
... | ALGO | 0.994867 | 3.93086 |
bfa78275-22eb-49bd-b8d7-0e9608897bbe | RainPPR/oi-archive | 20220903 字典树/unorderedmap.cpp | #include<iostream>
#include<cstdio>
#include<unordered_map>
using namespace std;
int main()
{
unordered_map<int,int> mp;
mp[1] = 2;
mp[7] = 3;
mp[5] = 7;
auto i = mp.find(5);
cout << i->second << endl;
return 0;
}
| ALGO | 0.999225 | 3.567277 |
e253320d-bc6e-4c85-be76-2d01dc263517 | hasin023/cse_4303_data_structures | cse_4303_theory/assignment/TripletStock.cpp | #include <iostream>
#include <vector>
using namespace std;
// Definition of TradeNode representing a trade in the BST
struct TradeNode
{
string tradeId;
string stockSymbol;
double transactionAmount;
TradeNode *left;
TradeNode *right;
TradeNode(string id, string symbol, double amount)
:... | ALGO | 0.999631 | 6.989954 |
73b425da-3a11-48a9-995e-0b6fddbcf965 | kristofkalocsai/LINPROG | 3/gy2/cpp/rounder.cpp | #include <math.h>
#include <stdio.h>
#include "rounder.h"
int Rounder::Round(double x)
{
double ix;
ix = (int)x;
return ix < x ? ix+1 : ix;
}
| ALGO | 0.996605 | 4.969756 |
add0525a-8b0a-416d-ade5-504848afec01 | HekpoMaH/Olimpiads | grupa C/zms/2005/C3/tourchck.cpp | #include <stdio.h>
#include <stdlib.h>
//#include <value.h>
#define MAXINT 2000000000
void main()
{
FILE *in,*ou;
int s,f,k;
int N,M,X,Y,b,e,mind;
int a[101][101],V[101];
int den[101],tree[101],used[101],i,j,l;
if((ou=fopen("tour.out","r"))== NULL)
{
printf("NO OUTPUT!\n");exit(0);
}
i... | ALGO | 0.999728 | 3.131418 |
bbb29d73-df3d-45ea-b407-7a1fce1fdfc9 | udayjayasanthosh/leetcode | 2691-count-vowel-strings-in-ranges/count-vowel-strings-in-ranges.cpp | class Solution {
public:
vector<int> vowelStrings(vector<string>& words, vector<vector<int>>& queries) {
vector<int>v;
unordered_set<char>s;
s.insert('a');
s.insert('e');
s.insert('i');
s.insert('o');
s.insert('u');
for(auto i:words)
{
... | ALGO | 0.999936 | 6.294313 |
ae3e642c-12f7-47ea-acf2-866b321378ed | nirvik-alpha/GeeksForGeeks-DSA | Missing number - GFG/missing-number.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int missingNumber(int a[], int n);
int main()
{
int t;
cin>>t;
while(t--)
{
int i=0, n;
cin>>n;
int a[n+5];
for(i=0;i<n-1;i++)
cin>>a[i];
cout<<missingNumber(a, n)<<endl;
}
}
// } Driver Code Ends
int missi... | ALGO | 0.999587 | 5.312459 |
4d7eba75-6e8a-4d24-a200-7eac69ad6b44 | zmsunnyday/Cpp-Primer | exc6_54.cpp | #include <vector>
using std::vector;
int func(int, int);
vector<decltype(func) *> a;
| TOOL | 0.929333 | 3.561868 |
d9a64042-d490-42ca-a965-f2898a557711 | SCUTykLin/PracticeAlgorithm | Codeup/A+B.cpp | //
// Created by GreenArrow on 2020/2/8.
//
#include <cstdio>
#include <iostream>
using namespace std;
long long getNumber(string s) {
int sign = 1;
int index = 0;
if (s[0] == '-') {
sign = -1;
index++;
} else {
sign = 1;
}
long long sum = 0;
for (int i = index; i... | ALGO | 0.998906 | 4.014863 |
2b5e1d17-ccd3-482b-9a22-cadcedf302bf | danielsam/cash | 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.h>
#include <string>
#include <vector>
int CCrypter::BytesToKeySHA512AES(const std::vector<unsigned char>& chSalt, const SecureString& strKeyData, int count, unsigned ... | TOOL | 0.91281 | 7.639691 |
ab7443f1-f516-4097-83d4-ca5b381600b1 | nimitz871016/HDU | 1012/1012.cpp | // 1012.cpp : Defines the entry point for the console application.
//
#include <stdio.h>
double jiechen(int n) {
int sum = 1;
if (n == 0)
{
return 1.0;
}
for (int i = 1; i <= n; i++)
{
sum = sum * i;
}
double result = 1.0 / sum;
return result;
}
int main()
{
double a[10];
double sum;
sum = 0;
for (i... | ALGO | 0.999315 | 3.428176 |
b15f149d-54db-4720-a4f4-4940a485eb0a | pacha2880/competitive_programming_codes | C - Many Medians.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define PI acos(-1)
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define sz(a) a.size()
#define srt(a) sort(all(a))
#define mem(a, h) memset(a, (h), sizeof(a))
#defi... | ALGO | 0.999999 | 4.500509 |
bc92c29a-4bd4-4179-a42d-c852b479e620 | YUMNAWARIS/DataStructuresAndAlgorithms | Week-01/Day-2/Pattern/p6.cpp | // Half Pyramid after 180 degree rotation
#include <iostream>
using namespace std;
int main()
{
int number = 1;
for (int i = 0; i < 5; i++)
{
for (int j = 0; j <= i; j++)
{
cout << number << " ";
number++;
}
cout << endl;
}
return 0;
} | ALGO | 0.999564 | 4.024188 |
c9b89e74-20fc-4c0b-babd-42d2fd46a991 | dotinx/oi | codes/practice/code/P4779.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 500010;
int n,m,s;
// int dis[MAXN],h[MAXN],to[MAXN],val[MAXN],nxt[MAXN];
int dis[MAXN];
struct edge{
int v,w;
};
vector<edge> edges[MAXN];
bool vis[MAXN];
void add(int u,int v,int w){
edges[u].push_back((edge){v,w});
}
void Dijkstra(){
memset(d... | ALGO | 0.999964 | 3.634996 |
80d4b846-f2ae-4a4f-9352-8f0a50d266cd | ankit-tiwari-dev/DSA-Problem-Set-II | Rotate_and_Delete.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int rotateDelete(vector<int> &arr) {
int k = 1;
int n = arr.size();
while(n > 1)
{
arr.insert(arr.begin(), arr[n-1]);
arr.pop_back();
... | ALGO | 0.999291 | 5.898011 |
42bc1d45-b6e2-42b7-a588-cfca55ecaff1 | kmsabrin/UVaSolved | UVaSolved/Volume 103/10330.cpp | /**
* //////////////////
* // MAXIMUM FLOW //
* //////////////////
**/
/***************
* Maximum flow * (Ford-Fulkerson on an adjacency matrix)
****************
* Takes a weighted directed graph of edge capacities as an adjacency
* matrix 'cap' and returns the maximum flow from s to t.
*
* PARAMETERS:
* -... | ALGO | 0.999458 | 4.006714 |
e63f6360-fe05-418b-9f5e-0d2eeb10e464 | redmi2/android_frameworks_av | media/libstagefright/codecs/amrnb/common/src/inv_sqrt.cpp | /*
Pathname: ./audio/gsm-amr/c/src/inv_sqrt.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Put file into template.
Description: Synchronized file with UMTS version 3.2.0. Updated coding
template. Removed unnecessary include files.
De... | ALGO | 0.999901 | 5.675018 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.