uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6e2e741b-8dd1-435d-84e7-73bc1df82ca6 | touyou/CompetitiveProgramming | gcj/cjj2011/予選/C-p.cpp | #include <cstdio>
// O(n^2)?
int solve(int r, int k, int n, int g[]) {
int res = 0, npos = 0;
for (int i=0; i<r; i++) {
int cnt = 0;
for (int i=0; i<n; i++,npos++) {
if (npos == n) npos = 0;
if (k-cnt<g[npos]) break;
cnt += g[npos];
}
res += cnt;
}
return res;
}
int main() {
int t, r, k, n;
sca... | ALGO | 0.999669 | 3.471664 |
023bd185-471c-449a-8437-8d30a214456b | mariessalogan/CS-162 | fantasy/f2/gamePlay.cpp | //****************************************************************************i
//Name: Mariessa Logan
//Date: 2/13/2018
//Description: This will call the character functions and make them fight!
//the vampire!
//**********************************... | TOOL | 0.868661 | 3.573963 |
a23bacdc-048d-47ce-9e29-4b2bef45f5b7 | sarahcrowle/crystalspace | libs/csutil/radixsort.cpp | #include "cssysdef.h"
#include "csutil/radixsort.h"
csRadixSorter::csRadixSorter ()
: currentSize(0), ranks1(0), ranks2(0), ranksValid(false)
{
}
csRadixSorter::~csRadixSorter ()
{
delete[] ranks1;
delete[] ranks2;
}
void csRadixSorter::Resize (size_t size)
{
size_t allocatedSize = (currentSize+31)&~31;
if(s... | ALGO | 0.999344 | 5.367368 |
3469f47b-6d82-432d-a445-0970010aa1fd | PranjalAgni/210DaysLeetCode | day-58.cpp | /*
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.
Example 1:
Input: 2
Output: [0,1,1]
Example 2:
Input: 5
Output: [0,1,1,2,1,2]
Follow up:
*/
// Idea is for a number N, operation: {N & (N-1... | ALGO | 0.999992 | 6.592699 |
d3f630ba-85cb-408a-8bde-2830b0507dfa | ishandutta2007/codeforces | hank55663/normal/1437/F.cpp | #include<bits/stdc++.h>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define mp make_pair
#define pb push_back
#define pll pair<LL,LL>
#define pii pair<int,int>
#define y second
#define x first
#define LL long lon... | ALGO | 0.999981 | 3.992426 |
fc56b96b-6bb5-4795-b96f-a8d6387c84d9 | theme222/LearningC | Ovenbreak/B09.cpp | #include <iostream>
int main()
{
int speed, height, weight;
std::cin >> speed >> height >> weight;
if (height < 100 || weight > 200)
{
puts("It too weak.");
return 0;
}
if (speed >= 100)
{
puts("It can jump over.");
return 0;
}
puts("It can't jump ... | ALGO | 0.994749 | 3.897556 |
6ddb1790-6dd2-4ef4-81bb-496eae3678bd | honeyvikash/Leetcode_Solved_Problems | 3042-count-prefix-and-suffix-pairs-i/3042-count-prefix-and-suffix-pairs-i.cpp | class Solution {
public:
int f(string a, string b)
{
if(a.size()>b.size()) return 0;
string pb=b.substr(0,(int)a.size());
string sb=b.substr(int(b.size())-int(a.size()));
// cout<<a<<" "<<pb<<" "<<sb<<endl;
if(a==pb && a==sb) return 1;
return 0;
}
int coun... | ALGO | 0.999742 | 5.513351 |
f7bdb852-00df-4b4e-9188-d0d47f4eb615 | poonam-2105/cpp-assigment | Inheritance_Polymorphism/13.cpp | /*Write a program to find the max number from given two numbers
using friend function*/
#include <iostream>
using namespace std;
class MaxNum;
int findMax(const MaxNum &obj);
class MaxNum {
private:
int num1, num2;
public:
MaxNum(int n1, int n2) : num1(n1), num2(n2) {}
friend int findMax(const MaxNum... | ALGO | 0.999828 | 5.69745 |
41ed35fd-6a2f-404e-af75-4e9c648a5fb1 | Jonsen-Brad/wincode | 蓝桥杯题目/校内模拟题/4_18_8.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int m,n;
cin >> m >> n;
int a = m/2+1;
long int ans = 0;
for(int i = 1;i<n;i++){
long temp = pow(n-i,a);
ans += (temp%10000);
ans%=10000;
}
cout<<ans;
return 0;
}
| ALGO | 0.999947 | 3.535811 |
0faf3d07-d661-41de-9962-8564bf547d53 | nafi103/Solved-Problems | CP31/C_Tree_Pruning.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/****************************************************************/
#define int long long
#define pi acos(-1.0)
const int mod = 998244353;
#defin... | ALGO | 0.999473 | 5.484964 |
f8cfa555-a12d-4c96-8c55-bda2843343d0 | umair-666/DSA-everyday | DSA questions/POTD/Leetcode/19th_Jan - Minimum Falling Path Sum.cpp | //931. Minimum Falling Path Sum
//https://leetcode.com/problems/minimum-falling-path-sum/description/?envType=daily-question&envId=2024-01-19
class Solution {
public:
int minFallingPathSum(vector<vector<int>>& matrix) {
int n = matrix.size();
for(int i=1; i<n; i++) {
for(int j=0; j<n; j++) {
... | ALGO | 0.999995 | 6.547257 |
afc086d3-ddbd-44f6-a31a-1656951689e1 | Joseph516/learning_notes | c&c++/tutorials/oop/design/matrix/anticlock_matrix.cpp | #include "anticlock_matrix.h"
AnticlockMatrix::AnticlockMatrix(int size)
: Matrix(size), dir_('D'), row_(-1), col_(0) {}
AnticlockMatrix::~AnticlockMatrix() {}
int AnticlockMatrix::getPosition() {
switch (dir_) {
case 'D':
if (row_ < size_ - 1 && *(data_ + col_ + (row_ + 1) * size_) == 0) {
++... | ALGO | 0.998079 | 4.487993 |
64512ed8-0780-4f4d-8be7-3ce3f4b6dbaf | ishandutta2007/codeforces | aryanc403/normal/1430/A.cpp | /* in the name of Anton */
/*
Compete against Yourself.
Author - Aryan Choudhary (@aryanc403)
*/
#ifdef ARYANC403
#include "/home/aryan/codes/PastCodes/template/header.h"
#else
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize ("... | ALGO | 0.999645 | 3.759381 |
e2e086ad-c806-43d5-8b3b-45a8465a1f4d | vmhl87/oly | contests/atcoder-oct26-24/a.cpp | #include <iostream>
int main(){
int count[26] = {};
for(int i=0; i<3; ++i){
char c; std::cin >> c;
count[c-'A']++;
}
std::cout << (count[0] == 1 && count[1] == 1 && count[2] == 1 ? "Yes" : "No") << '\n';
}
| ALGO | 0.999987 | 3.999759 |
d112728e-5f0f-4165-919c-cf514022ce99 | ucsb-cs16-m19/code-from-class | 08-08/printArrayRecursively.cpp | #include <iostream>
using namespace std;
// this function is recursive because it calls itself
void printArrayRecursively(int *arr, int size) {
// we're gonna break down the array into:
// (1) the first element
// (2) the smaller array
if (size == 0) {
// print nothing, because the array is em... | ALGO | 0.999271 | 5.17448 |
ef7a6525-ff35-4e00-bf95-f5218eddd5ab | hisyatokaku/Competition | ABC/144/A.cpp | #include "bits/stdc++.h"
#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int... | ALGO | 0.999737 | 3.827476 |
ed070213-d247-4f31-bc75-23ba5299e9cc | shelltdf/osgall | prebuild/boost_1_71_0/libs/graph/example/edge-function.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.941753 | 5.366436 |
49d85443-38f6-4fb6-94da-138794e344d8 | tiangexiang/OccFusion | submodules/diff-gaussian-rasterization/third_party/glm/test/gtx/gtx_pca.cpp | #define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp>
#include <glm/gtx/pca.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/gtx/string_cast.hpp>
#include <cstdio>
#include <vector>
#if GLM_HAS_CXX11_STL == 1
#include <random>
#endif
template<typename T>
T myEpsilon();
template<>
GLM_INLINE GLM_CONSTEXPR float myEp... | TEST | 0.969057 | 6.786098 |
f3f9d572-7b50-4b9f-92a4-355780700f4d | codeSpicer/LeetCode-solutions | 215-kth-largest-element-in-an-array/215-kth-largest-element-in-an-array.cpp | class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
priority_queue<int> pq;
for( int i : nums){
pq.push( i);
}
for( int i = 0 ; i < k-1 ; i++){
pq.pop();
}
return pq... | ALGO | 0.999918 | 5.087466 |
0e79fe5f-a4ad-440b-9fb9-701b8359edef | gaiwantong/botan | src/lib/block/threefish_avx2/threefish_avx2.cpp | #include <botan/threefish.h>
#include <immintrin.h>
namespace Botan {
namespace {
inline void interleave_epi64(__m256i& X0, __m256i& X1)
{
// interleave X0 and X1 qwords
// (X0,X1,X2,X3),(X4,X5,X6,X7) -> (X0,X2,X4,X6),(X1,X3,X5,X7)
const __m256i T0 = _mm256_unpacklo_epi64(X0, X1);
const __m256i T1 = ... | ALGO | 0.998914 | 3.686005 |
c9d4691f-97a8-40d9-9d14-24f58ee8b52f | ajhao/week-8---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 |
e70b9319-c793-4af9-9685-f316df5c1536 | Muses-lbz/Daily-Practice | 2021_10/2021_10_22.cpp | //#include <stdio.h>
//#include <stdlib.h>
////一个简易的菜单程序
//char get_choice(void);
//char get_first(void);
//int get_int(void);
//void count(void);
//
//int main()
//{
// int choice;
// void count(void);
// while ((choice = get_choice()) != 'q')
// {
// switch (choice)
// {
// case 'a': printf("Buy low, sell ... | ALGO | 0.994136 | 3.112742 |
9ef5d341-d3db-4734-9dab-f01ad3c21cb3 | ishandutta2007/codeforces | tfg/normal/1043/B.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <limits>
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
int main() {
std::ios_base::sync_with_stdio(false); std::cin.tie(NULL);
int n;
std::cin >> n;
std::vector<int> a(n + 1, 0);
for(int i = ... | ALGO | 0.999947 | 3.45225 |
e6ca0d41-0b18-47d4-a33d-0da983d15d1a | sasikiranE/Leetcode-studyplan | Algorithm/maxAreaOfIsland.cpp | /*
You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.
The area of an island is the number of cells with a value 1 in the island.
Return the maximum area of an ... | ALGO | 0.999927 | 6.951338 |
6524a854-d450-4c63-b695-ab19f55857b3 | Jhon-Siza/jhonjairosiza_1946 | arrays/ordenamiento/seleccion.cpp | #include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
void llenarVector(int v[], int n){
srand(time(NULL));
for(int i=0; i<n; i++){
//v[i]=rand()%20+1;
cin>>v[i];
}
}
void verVector(int v[], int n){
for(int i=0;i<n;i++){
cout<<v[i]<<"\t";
}
}
int orde... | ALGO | 0.99882 | 3.831181 |
e3b1b67b-1889-4635-b484-ce6b675a8e83 | PedroFerreira5/Aeds-Pratica | altura.cpp | #include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char** argv) {
const int TAM = 5;
// Declarar o vetor
float alturas[TAM], media, soma, maior, pedido,r;
// Variavel de auxiliar
int i;
// Leitura do vetor
i = 0;
media=0, soma=0, maior=0, pedido=0, r... | TOOL | 0.979424 | 3.506449 |
14e96309-b828-4b16-8fb7-f591172f625d | son-47/INT-2210-22 | Tuan10/LCS_problem.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string x, y;
cin >> x >> y;
int n =x.size(), m = y.size();
int F[n+1][m+1];
for(int i =0 ;i <= n ;i++) {
for(int j =0 ; j <=m ; j++) {
if( i == 0 || j ==0){F[i][j] = 0;}
else {
if(x[i-1] = y[j-1]){
... | ALGO | 0.999989 | 4.318211 |
ca7809ed-1be5-4632-8580-59f18e809c0e | Piyushagrawal1/75_Days_Of_DSA | Leetcode/String/GroupAnagrams.cpp | class Solution
{
public:
vector<vector<string>> groupAnagrams(vector<string> &strs)
{
unordered_map<string, vector<string>> mp;
vector<vector<string>> ans;
for (auto str : strs)
{
string s = str;
sort(s.begin(), s.end());
mp[s].push_back(str)... | ALGO | 0.999988 | 6.431451 |
45b1487f-bad3-4fff-bb30-174f22b3a5d6 | xaone/coding-ninjas | Lecture4-Pattern 1/squrePattern.cpp | // Code : Square Pattern
// Send Feedback
// Print the following pattern for the given N number of rows.
// Pattern for N = 4
// 4444
// 4444
// 4444
// 4444
// Input format :
// Integer N (Total no. of rows)
// Output format :
// Pattern in N lines
// Constraints
// 0 <= N <= 50
// Sample Input 1:
// 7
// Sample Outpu... | ALGO | 0.999884 | 4.059772 |
8f36212c-e9b0-4dfd-9bf6-d4d48659bfba | ticod/c_basic_study | baekjoon/step9/1011/1011.cpp | #include <iostream>
using namespace std;
long long int get_step(long long int d)
{
long long int i = 1;
for (; i * (i + 1) < d; i++)
;
return i;
}
long long int get_times(long long int d)
{
long long int s = get_step(d);
if (d <= s * s)
return 2 * s - 1;
else
return 2 *... | ALGO | 0.999956 | 3.942812 |
48462104-cbd2-449f-b319-1433773b632d | dandolya/segment_tree | C.cpp | #include <iostream>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <cmath>
#include<string.h>
#include <string>
using namespace std;
void build(vector <long long> &arr, vector <long long> &tree, int v, int vl, int vr)
{
if (vl + 1 == vr) {
tree[v] = arr[vl];
return;
}
int vm = vl + (vr - vl)... | ALGO | 0.999553 | 4.199872 |
2bf766cc-f555-4f58-affa-17e807c32de1 | virtualsecureplatform/llvm-rv16k | libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/eval_param.pass.cpp | // <random>
// class bernoulli_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <numeric>
#include <vector>
#include <cassert>
#include <cstddef>
template <class T>
inline
T
sqr(T x)
{
return x * x;
}
int main()
{
{
typedef s... | TEST | 0.977506 | 5.817864 |
1c055e52-fdec-4bec-b5ac-21bad9c0a5c3 | SprueKit/TexGraph | Source/SprueEngine/Libs/igl/per_vertex_attribute_smoothing.cpp | template <typename DerivedV, typename DerivedF>
IGL_INLINE void igl::per_vertex_attribute_smoothing(
const Eigen::PlainObjectBase<DerivedV>& Ain,
const Eigen::PlainObjectBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedV> & Aout)
{
std::vector<double> denominator(Ain.rows(), 0);
Aout = DerivedV::Zer... | ALGO | 0.993202 | 4.717633 |
68942c87-40bd-4cd0-9657-9887e8110142 | extrastufff054/NFSU | Cryptography/DES Algorithm/decryptCipher_text.cpp | // Including dependancies
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
// Array to hold 16 keys
string round_keys[16];
// String to hold the plain text
string pt;
// Function to convert a number in decimal to binary
string convertDecimalToBinary(int decimal)
{
string binary;
while(de... | ALGO | 0.999977 | 3.64291 |
73414a50-a4bd-4cec-b20c-83fd3e23b1be | Valentina0630/TALLERES_EDISON-2711993 | TALLERES EDISON.0/Ejercicios t1 hasta t11/Ejercicio3t3.cpp | #include<stdio.h>
#include<iostream>
int main()
{
int NI, NF;
printf("Ingrese numero inicial:\n");
scanf("%d", &NI);
printf("Ingrese numero final:\n");
scanf("%d", &NF);
while (NI < NF)
{
if (NI % 2 != 0)
{
printf("Los numeros impares son: %d\n", NI);
}
... | ALGO | 0.988707 | 3.403692 |
1d041900-05c4-4430-8b55-0d8b2097c42c | parthsarthiprasad/Competitive_Programming | codeforces/676div2/manacher.cpp | #include <bits/stdc++.h>
using namespace std;
template <int delta> struct ManacherBase{
private:
static const int maxn=1e5+1;
int r[maxn];
char s[maxn];
int mid,n,i;
public:
ManacherBase():mid(0),i(0),n(1)
{
memset(r,-1,sizeof(int)*maxn);
s[0]='$';
... | ALGO | 0.998992 | 4.498389 |
87e5d426-ea07-4a66-b004-2174fa709fad | piyush24kothekar/ai_lab | tictactoeNonai.cpp | #include <iostream>
#define COMPUTER 1
#define HUMAN 2
#define SIDE 3
using namespace std;
int board[9] = {2, 2, 2, 2, 2, 2, 2, 2, 2};
int win[8][3] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {0, 3, 6}, {1, 4, 7}, {2, 5, 8}, {2, 4, 6}, {0, 4, 8}};
int turn = 0;
void initialise() {
for (int i = 0; i < 9; i++) {
... | ALGO | 0.994674 | 5.105434 |
56004d0b-7d82-4655-8430-e7d380f324cb | eklektos-en-christo/learncpp.com-Notes | Chapter.25/25.5_early.binding.and.late.binding/25.5_early.binding.and.late.binding/main.cpp | //
// main.cpp
// 25.5_early.binding.and.late.binding
//
// Created by Εκλεκτός εν Χριστώ on 11/3/23.
//
/*
When a C++ program is executed: it executes sequentially, from the top of main, when a function call is
encountered, the point of execution jumps to the beginning of the function being called.
When a pro... | TOOL | 0.989516 | 7.18807 |
f6bbe12a-05ec-4270-89bd-a21b118da577 | SamIam9640/codetree-TILs | 240310/특정 문자의 유무/specific-character-presence.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin>>str;
if(str.find("ee") != string::npos)
cout<<"Yes ";
else
cout<<"No ";
if(str.find("ab")!=string::npos)
cout<<"Yes";
else
cout<<"No";
return 0;
} | ALGO | 0.999854 | 3.210768 |
f696b6dc-05fe-4d8f-bd92-706ad17da170 | yukeyi/LeetCode | 61 Rotate List/Rotate List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* rotateRight(ListNode* head, int k) {
if(head == NULL)
return head;
int i = 1;
... | ALGO | 0.999995 | 5.617363 |
edbfd844-128f-49c9-87e9-fae63a00d14f | Ripunjay42/leetcode_practice | 2_medium/string/longestSubstrContainVowel.cpp | class Solution {
public:
int findTheLongestSubstring(string s) {
//the problem is hard one
// so lets start
//we will require a mask to implement this(thought process- we cannot apply sliding window because removing current even vowel can destroy our maximum length of even vowel substring in future p.s(i tried ... | ALGO | 0.999377 | 5.441902 |
c8eec9f0-7283-4641-b412-566f6bcb9bc2 | wisamreid/NodUrIK | eigen/demos/mandelbrot/mandelbrot.cpp | #include "mandelbrot.h"
#include <iostream>
#include<QtGui/QPainter>
#include<QtGui/QImage>
#include<QtGui/QMouseEvent>
#include<QtCore/QTime>
void MandelbrotWidget::resizeEvent(QResizeEvent *)
{
if(size < width() * height())
{
std::cout << "reallocate buffer" << std::endl;
size = width() * height();
i... | ALGO | 0.872261 | 5.79494 |
4658f240-18e7-4c11-b789-bd9a5ac296ad | IshwariK117/C_plusplus_Basics | ps_9.cpp | /*
input:
r-no.of rats
unit-amount of food rat consume
arr[n]-amount of food present in each house
output:
4
logic:
-iterate each loop
-add and after each addition compare add> required food item;
*/
#include<iostream>
using namespace std;
void checkfood(int r,int unit,int arr[],int n){s
int sum=0;
int req=... | ALGO | 0.999623 | 4.190496 |
74c49e58-1922-47e7-a9fa-fc7653165aac | gomind-ritesh/labsheets | labsheets_y1/lab4/ques1.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
float x,y,numadults,numchildren,charge;
int menstatus;
cout<<"Please enter x: "<< endl;
cin>>x;
cout<<"Please enter y: "<< endl;
cin>>y;
cout<<"Please enter number of adults: "<< endl;
cin>>numadults;
cout<<"Please enter number of children: "<< ... | ALGO | 0.909121 | 3.564165 |
e5e56e79-dfe8-478b-8ff7-7303d241ccf9 | luqmanarifin/cp | 0-unclassified/race.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = -600000;
int dp[2][310][310];
int asal[310][310];
int i,j,k,n;
void update(int k, int i, int j) {
int a = max(dp[!(k%2)][i][j-1], dp[!(k%2)][i][j]);
int b = max(dp[!(k%2)][i-1][j], dp[!(k%2)][i-1][j-1]);
dp[k%2][i][j] = max(a,b);
}
int main()
{
for(i ... | ALGO | 0.999928 | 3.393033 |
2deb3de4-4e7b-457b-a449-bf87d363c2a1 | ashpreetkaur25/Data-Structures-Algorithms | Recursion1/Power.cpp | Write a program to find x to the power n (i.e. x^n). Take x and n from the user. You need to return the answer.
Do this recursively.
Input format :
Two integers x and n (separated by space)
Output Format :
x^n (i.e. x raise to the power n)
Constraints :
1 <= x <= 30
0 <= n <= 30
Sample Input 1 :
3 4
Sample Output 1 :
... | ALGO | 0.999783 | 5.636264 |
5a275c37-9c78-43a5-b1bc-6773f5a398c5 | UnconfirmedTransactions/BlockSci-modified | src/heuristics/taint.cpp | //
// taint.cpp
// blocksci
//
// Created by Harry Kalodner on 3/20/18.
//
#include <blocksci/heuristics/taint.hpp>
#include <blocksci/address/address.hpp>
#include <blocksci/chain/algorithms.hpp>
#include <blocksci/chain/block.hpp>
#include <blocksci/chain/block_range.hpp>
#include <internal/data_access.hpp>
#inc... | TOOL | 0.939648 | 7.816438 |
67e52c43-a36c-4888-af55-49d5be289f75 | aish272/CPPLearning | SortingTechniques/BinarySearch.cpp | #include <iostream>
using namespace std;
int binarysearch(int*arr,int left,int right,int val)
{
int mid;
if(left<=right)
{
mid = (left+right)/2;
if(arr[mid]==val)
return mid+1;
else if(arr[mid]>val)
binarysearch(arr,left,mid-1,val);
else
b... | ALGO | 0.999864 | 4.727275 |
4d917db4-835c-43e2-a6af-3596929c9cc3 | 1kalyan/lab_4 | GaussJordan.cpp | #include <iostream>
#define N 10
using namespace std;
int main() {
double a[N][N], b[N], constant, term;
int i, j, k, n;
cout << "Enter number of unknowns: ";
cin >> n;
cout << "Enter the augmented matrix:" << endl;
for (i = 1; i <= n; i++) {
for (j = 1; j <= n + 1; j++) {
... | ALGO | 0.99968 | 4.062852 |
8cef229d-b091-4e59-bf21-45ae76fdaa44 | Heisenberg71/Competitive-Programming | Online Judge Submissions/Leetcode/Parallel Courses.cpp | /*
Problem Link: https://leetcode.com/problems/parallel-courses/
Time Complexity: O(M*log(N) + N)
Space Complexity: O(N + M)
Here,
M = amount of courseRelations
N = distinct courses
*/
class Solution {
const static int VISITED = 1;
const static int FINISHED = 2;
private:
map<int, vector<int>... | ALGO | 0.999964 | 5.961831 |
a7855dd9-10af-4721-a215-e1777813423e | minislively/Practice | ConsoleApplication9/ConsoleApplication9.cpp | #include <iostream>
using namespace std;
int main()
{
int a, n;
double sum = 0;;
cin >> a;
for (int i = 0; i < a; i++)
{
cin >> n;
sum += n;
}
cout << fixed;
cout.precision(2);
cout << sum/a;
} | ALGO | 0.990198 | 3.742534 |
27a8f66a-5d4f-40f2-b01b-941bf8751365 | avinash-kothapalli-dreamer/100daysdailydsapractice | 2287-rearrange-characters-to-make-target-string/2287-rearrange-characters-to-make-target-string.cpp | class Solution {
public:
int rearrangeCharacters(string s, string target) {
unordered_map<char,int>mpp,mpp1;
for(auto it:s){
mpp[it]++;
}
int ans = 1e9;
for(auto it:target){
mpp1[it]++;
}
for(auto it:target){
... | ALGO | 0.999975 | 6.016188 |
0093bf31-ec51-43d8-80c9-da1fd0c47235 | Pranshh19/DSA | Assignment_3/01.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& a) {
int n=a.size();
sort(a.begin(),a.end());
vector<vector<int>>ans;
if(n<3)return ans;
for(int i=0;i<n-2;i++){
if(i==0 || (i>0 && a[i]!=a[i-1])){
int lo=i+1, hi=n-1,s... | ALGO | 0.99966 | 5.486094 |
2f4f9cbf-2096-42eb-89de-bce7dd697321 | amnaahmad20/flutter-practice | 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.9988 | 6.76073 |
9d372486-9d26-461d-95c4-3b380cb80851 | yerkeboolan/PL_2016 | Yerkebulan's projects/arithgeo.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main () {
double a,b;
cin >>a>>b;
double A = (a+b)/2;
double G = sqrt(a*b);
cout <<"The arithmetic mean is"<<" "<<A<<endl;
cout <<"The geometric mean is"<<" "<<G<<endl;
return 0;
} | ALGO | 0.998147 | 3.981721 |
1ff733f3-a67d-4488-bba7-4ea20033db1f | ampl/coin | Couenne/Ipopt/src/contrib/CGPenalty/IpPiecewisePenalty.cpp | #include "IpPiecewisePenalty.hpp"
#include "IpJournalist.hpp"
#include "IpRestoPhase.hpp"
#include "IpAlgTypes.hpp"
namespace Ipopt
{
#if COIN_IPOPT_VERBOSITY > 0
static const Index dbg_verbosity = 0;
#endif
PiecewisePenalty::PiecewisePenalty(Index dim)
:
dim_(dim),
min_piece_penalty_(0), // m... | ALGO | 0.992353 | 6.356086 |
335319cf-f3ed-49b6-be7f-c69b61f0af3a | Ahmed-Zaher/CompetitiveProgramming | CodeForces/CF469-D2-D.cpp | /*
* We can reduce this to a 2-SAT problem, consider the variables
* x_1, x_2, .., x_n, where x_i is 0 if p_i is in A, 1 if it's in B
* Consider x_i, x_j, x_j where p_j = a - p_i, p_k = b - p_i
* We want x_i = x_j = x_j, because otherwise one of the tree numbers
* will be in a set the number that it needs is in th... | ALGO | 0.99968 | 3.691796 |
9f845672-8b2d-480e-ac58-c7f17c82ca51 | onasheep/c_algorithm | BaekJoon/단계별로 풀어보기/약수배수소수2/1929_소수구하기.cpp | #include <iostream>
#include <cmath>
using namespace std;
bool CheckPrime(int m)
{
if (m == 1)
{
return false;
}
for (int i = 2; i < sqrt(m) + 1; i++)
{
if (m == 2)
{
return true;
}
else if (m % i == 0)
{
return false;
}
}
return true;
}
int main() {
ios::sync_with_stdio(false);
cin.t... | ALGO | 0.999943 | 3.91675 |
7ded3b83-0dae-4697-9a69-31c5b3efd1e6 | ishandutta2007/codeforces | zlobober/normal/750/C.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int N = 200500;
const int inf = 200 * 1000 * 1000;
int main() {
int n;
scanf("%d", &n);
int l = -inf, r = inf;
int sd = 0;
for (int i = 0; i < n; i++) {
int d, t;
scanf("%d %d", &d, &t);
if (t == 1) {
... | ALGO | 0.999782 | 3.481429 |
cea1a927-267e-4246-88ea-ba97b9b3dbd4 | biidulgi99/test | opencv-4.5.2/samples/cpp/tutorial_code/ImgProc/periodic_noise_removing_filter/periodic_noise_removing_filter.cpp | /**
* @brief You will learn how to remove periodic noise in the Fourier domain
* @author Karpushin Vladislav, <EMAIL>, https://github.com/VladKarpushin
*/
#include <iostream>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
using namespace cv;
using namespace std;
void fftshift(const Mat& inputImg, Mat... | ALGO | 0.995278 | 4.560166 |
3f4bb944-5a18-4377-8dd5-3682d39e2076 | JJHu1993/industrial_core | industrial_robot_client/src/utils.cpp | #include "ros/console.h"
#include "industrial_utils/utils.h"
#include "industrial_robot_client/utils.h"
#include <cmath>
#include <iostream>
namespace industrial_robot_client
{
namespace utils
{
bool isWithinRange(const std::vector<double> & lhs, const std::vector<double> & rhs, double full_range)
{
bool rtn = fa... | TOOL | 0.940694 | 6.812152 |
f989bc95-93fb-4abb-9cea-4eb6742d837d | stevenbai0724/DMOJ-Solutions | DMOPC/dmopc14c6p2.cpp | //https://dmoj.ca/problem/dmopc14c5p2
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
int n; cin>>n;
int ans = 0;
for(int i = 0 ;i<n; i++){
int x, y;
cin>>x>>y;
ans = max(ans, y-x);
}
cout<<ans;
return 0;
} | ALGO | 0.999871 | 4.286491 |
fccc8b5a-6251-4cfd-975b-fae8708664ba | ishandutta2007/codeforces | jakube/normal/246/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.precision(10);
cout << fixed;
int N;
cin >> N;
vector<int> v(N);
for (int idx = 0; idx < N; idx++)
cin >> v[idx];
int sum = accumulate(v.begin(), v.end(), 0);
... | ALGO | 0.999068 | 3.630331 |
573767a7-ba99-4f51-a803-786eb8a9ef14 | aanu2021/Leetcode-Solutions | 2272-substring-with-largest-variance/2272-substring-with-largest-variance.cpp | class Solution {
public:
int findVariance(string &s,int n,char ch1,char ch2){
int maxSum = 0;
int currSum = 0;
int cnt = 0;
for(int i=0;i<n;i++){
if(s[i]==ch1){
currSum++;
}
if(s[i]==ch2){
cnt++;
... | ALGO | 0.999962 | 5.629199 |
dddd0c3a-0540-4e61-97a2-67e1e96da54f | D1-Atharva-83811/Cpp_Assignments | Optional1/optional1_q1.cpp | // Q1. Write a Matrix class. Allocate memory dynamically in parameterized constructor. Also write
// parameter-less constructor. Write accept() and print() functions.
// Also provide add(), subtract(), multiply() and transpose() function.
#include <iostream>
using namespace std;
class Matrix
{
private:
int** arr;... | TOOL | 0.924468 | 3.828168 |
0e2829d8-64dc-416f-91bf-b13f1f982af7 | Priyanshu-Ganatra/Leetcode-Codestudio-And-DSA-problems | LC_78_ReverseLL_InKgroups.cpp | #include <bits/stdc++.h>
using namespace std;
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) {}
};
void insertAtHead(ListNode *&head, ListNode *&tail, int data)
{
/... | ALGO | 0.999995 | 5.617345 |
e4611361-535d-4a9d-b738-fa797d8a26db | Sudheer0581/LeetCode | 1585-the-kth-factor-of-n/the-kth-factor-of-n.cpp | class Solution {
public:
int kthFactor(int n, int k) {
vector<int>v;
for(int i=1;i<=n;i++)
{
if(n%i==0){
v.push_back(i);
}
}
if(v.size()<k)return -1;
return v[k-1];
}
}; | ALGO | 0.999966 | 5.885553 |
915b64d2-facf-4782-bb51-871de1d1f5ba | Saif-Smran/DSA-Series-by-Shradha-Ma-am | Lecture 42 - Recursion (Part 2)/code.cpp | #include <iostream>
#include <vector>
using namespace std;
// Fibonachi series using recursion
// https://www.leetcode.com/problems/fibonacci-number/
int fib(int n)
{
if (n == 0 || n == 1)
{
return n;
}
return fib(n - 1) + fib(n - 2);
}
// Check if a array is sorted or not using recursion
bo... | ALGO | 0.999588 | 5.492785 |
f62c0431-d57a-4c19-96c8-92020361864a | nn-firc/srcsdk | utils/common/cmdlib.cpp | #if defined( MPI )
#include "vmpi.h"
#include "vmpi_tools_shared.h"
#endif
#if defined( _WIN32 ) || defined( WIN32 )
#include <direct.h>
#endif
#if defined( _X360 )
#include "xbox/xbox_win32stubs.h"
#endif
#include "tier0/memdbgon.h"
// set these before calling CheckParm
int myargc;
char **myargv;
char com_to... | TOOL | 0.851993 | 4.597552 |
2428852f-7671-43bd-986c-d2b8dd364c9a | Burhanuddin1999/Autoremesher | thirdparty/eigen/doc/examples/Tutorial_ArrayClass_interop.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = (m.array() + 4).matrix() * m;
cout << "-- Combination 1: --" << endl << result << endl << e... | ALGO | 0.999737 | 4.531452 |
d7133314-70e6-415a-99eb-046610979e94 | prathmesh-pol/SPPU-COMP-SEM3 | FDS_assign/assignment10.cpp | #include <iostream>
using namespace std;
// Node structure to store binary digits
struct Node
{
int data;
Node *next;
Node *prev;
};
// DoublyLinkedList class for managing binary numbers
class DoublyLinkedList
{
public:
Node *head;
public:
// Constructor
DoublyLinkedList() : head(nullptr) {}
... | ALGO | 0.999979 | 6.707119 |
60192c1e-5200-47a2-b158-1abab8d3f9c4 | luerer/ccOOder | leetcode_238.cpp | /************
Product of Array Except Self
大意:
返回这个一个数组res,其中res[i]为原数组中除了nums[i]的其他所有数的乘积。
思路:
题目要求不能用除法,且O(N),最好O(1)空间。
开始想到两个数组分别存当前数字左边部分和右边部分的乘积,为了O(1)空间,可以优化。
res中直接存左边的乘积,右边的乘积用变量。
************/
class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
vector<int> res(nums.size(),1... | ALGO | 0.999989 | 5.35611 |
1083fee3-41d9-4935-8cc7-ed3f64ef65c8 | adityabandal/Leetcode_Solutions | number-of-wonderful-substrings/number-of-wonderful-substrings.cpp | #define ll long long
class Solution {
public:
int
long long wonderfulSubstrings(string s) {
ll ans = 0;
int M = 1e9+7;
unordered_map<int, ll> m;
int mask = 0;
m[0] = 1;
for(int i=0;i<s.size();i++){
mask ^= 1<<(s[i]-'a');
ans=(ans+... | ALGO | 0.999994 | 5.737204 |
bdec2c27-7bc8-40a5-88a8-8e57a481b2fd | Anubhav12345678/competitive-programming | SUMOFLEFTLEAVESIMPLEETCODE.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool isleaf(TreeNode *root)
{
if(root==NULL)
return false;
if(r... | ALGO | 0.999809 | 6.141885 |
35d4733e-e6ef-4b25-b0bf-0086073af8d6 | YALOKGARua/leetcode | 1561_max_coins.cpp | #include <vector>
#include <algorithm>
using std::vector;
class Solution {
public:
int maxCoins(vector<int>& piles) {
std::sort(piles.begin(), piles.end());
int n = (int)piles.size();
int i = 0, j = n - 1;
long long ans = 0;
while (i < j) {
--j;
ans += piles[j];
--j;
++i;
}
return (int)ans;... | ALGO | 0.999923 | 5.115938 |
25821595-9f47-49d2-923d-85fdcbd1a1d7 | alexandraback/datacollection | solutions_5670465267826688_1/C++/Empty007/Dijskstra.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999839 | 3.818733 |
e7cc0179-99c0-4fe9-b95c-652724891ff8 | JairMedina97/Electronics---microcontrollers | C++ exercises/vectorbyscalar.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void MultiplyVectorByScalar(vector<float> &v, float k){
for(int i=0;i<v.size();++i)
v[i] = v[i] * k;
}
void printVector(vector<float> v){
for(int i=0;i<v.size();++i)
cout<<v[i]<<' ';
cout<<endl<<endl;
}
int main() {
vector<float> v... | ALGO | 0.990205 | 3.685824 |
ba530a5a-c5b9-4e5c-b9af-2f9c5340e48c | NandiSoham/DSA-Striver | 03_binarySearch/03_upperBound.cpp | #include <iostream>
#include <vector>
using namespace std;
//-------------------------BRUT FORCE (Linear Search) ---------------------------------------
int upperBoundBrute(vector<int> &arr, int n, int target)
{
for (int i = 0; i < n; i++)
{
if (arr[i] > target)
return i;
}
return n;
}
//-------------------... | ALGO | 0.999918 | 6.32374 |
56a46e5c-7749-4e91-8415-2381caf4296f | tasumath/For-AtCoder-Beginner | L -1.11.for文・break・continue/B-Palindromic-Numbers.cpp | #include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main(){
int a; cin>>a;
int b; cin>>b;
int cnt=0;
for(int i=a;i<=b;i++){
int k1 = i / 10000;
int k2 = (i - k1*10000)/1000;
//cout<<k2<<endl;
int k3 = (i - k1*10000 - k2*1000)/100;
... | ALGO | 0.998469 | 3.6219 |
500133dc-27ff-4c6a-beb7-dda47c8e9027 | WLFJ/PAT-Code-Bin | L2-005.cpp | #include<iostream>
#include<set>
#include<vector>
#include<cstdio>
using namespace std;
int main(void){
//我们要动态计算两个集合的交集个并集
//事实上只需要计算并集就全知道了
int N;
scanf("%d", &N);
vector<set<int> > arr(N + 1);
for(int i = 1; i <= N; i ++){
int L;
scanf("%d", &L);
while(L --){
... | ALGO | 0.998349 | 3.605112 |
241de906-448e-4283-8437-78c90530ae87 | llvm-pic/llvm-pic | libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp | // <algorithm>
// template<InputIterator InIter, class OutIter,
// Callable<auto, const InIter::value_type&> Op>
// requires OutputIterator<OutIter, Op::result_type> && CopyConstructible<Op>
// constexpr OutIter // constexpr after C++17
// transform(InIter first, InIter last, OutIter result, Op op);
... | TEST | 0.934411 | 7.274429 |
00f44751-fe2a-4a18-b4a9-d1f175f33711 | 4l0n3r/data-structures | CPP/balanced_stack.cpp | // paranthesis balanced expression using stack
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <string>
using namespace std;
bool Balanced(char *C,int n){
stack<char> S;
for (int i = 0; i < n; ++i)
{
char t = C[i];
if (t == '(' or t == '[' or t=='{'){
S.push(t);
}
el... | ALGO | 0.998691 | 5.214673 |
2b3d1b79-cd23-4e86-9ae5-38da1c088a2b | DariaMartinovskaya/High_Performance_Computing | aula4/heat_equation_diffusion.cpp | #include <iostream>
void heat_diffusion(){
const int N = 10000; // mm
double *T_n = new double[ N ];
double *T_n1 = new double[ N ];
double alpha_gold = 127; // mm2/s; coeficiente de defusao termica
double t_f = 10.0; // final time in seconds
double t = 0.0; // time in seconds
// initial temperatures
for... | ALGO | 0.999582 | 3.548852 |
57adb0c9-d30f-42c1-bc7a-c60d87654ad3 | said9246/Fellwo_Ship-DSA | 169-majority-element/majority-element.cpp | class Solution {
public:
int majorityElement(vector<int>& nums) {
unordered_map<int,int>mp;
for(auto v:nums){
mp[v]++;
}
for(auto x : mp){
if(x.second > nums.size() / 2)
return x.first;
}
return -1;
}
}; | ALGO | 0.99994 | 5.411381 |
ba7bd40f-3745-4f7e-bf9c-4b20d9716243 | suryabhanmjh/Cpp-practice- | Loop/table_doWhile.cpp | //table print by user with the help of do while
#include<iostream>
using namespace std;
int main(){
int table,i;
cout<<"Enter the table:";
cin>>table;
do{
cout<<table*i<<endl;
i++;
}
while(i<=10);
}
done | TOOL | 0.976393 | 3.005997 |
98f930ac-ca74-4409-98ec-43332849c4ee | AkshayRamchandraDhole/Python | Python Code/Daily_Flash_Code_0/Week11/4Apr/65-DailyFlash_Solutions/04_April_Solution_Two/CPP/program3.cpp |
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
int main () {
int n;
std::cout << ("Enter Length Of Array : ");
std::cin >> n;
int *arr1 = new int[n];
int *arr2 = new int[n];
std::cout << "Enter array : \n";
for(int i = 0 ; i < n ; i++ ){
std::cin >> arr1[i];
}
std::cout << "Enter array : \n... | ALGO | 0.999852 | 3.318826 |
dae68ddf-e542-4b36-abb1-ef5ade0012b3 | qmaruf/Topcoder | FauxPalindromes.cpp | #include <bits/stdc++.h>
using namespace std;
struct FauxPalindromes{
bool ispal(string s)
{
int a = 0;
int b = s.length() - 1;
while(a < b)
{
if(s[a] != s[b])
return false;
a++;
b--;
}
return true;
}
string makefaux(string s)
{
string ret = "";
char prev = '+';
for(int i = 0; i < s.length(); i++... | ALGO | 0.995996 | 3.508671 |
8fe3a304-a1f5-4dfe-be91-b8a95d99e5ef | dwip-nandi/CodeForces | C_Hexadecimal_s_Numbers.cpp | /*#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ll n;
cin>>n;
string s=to_string(n);
ll l=s.size();
int c=0;
for(int i=1;i<=n;i++){
string s=to_string(i);
ll l=s.size();
bool isTrue=true;
for(char c:s){
if(c!='1' && c!='... | ALGO | 0.999963 | 4.773804 |
0abb0ccc-b572-4cb5-9e1a-1a937eaa2f1d | jeromy-lin/DataStructure | Ch3_Linked List/Ch3_ex15_Delete_DoubleLinkedList.cpp | /*
Ƶcd
ĤT : Circular Linked List
d 15: إ쵲CçRw`I
*/
#include <stdio.h>
#include <stdlib.h>
// wqV쵲C`Ic
typedef struct node {
int data;
struct node* next;
struct node* prev;
} Node;
// sW`I쵲C
Node* appendNode(Node* head, int newData) {
Node* newNode = (Node*)malloc(sizeof(Node));
if (!newNo... | ALGO | 0.999973 | 4.658206 |
7d4fd6bd-67fa-4e4c-aff3-0a39f65071b7 | rajarshighoshal/algorithmic-toolbox | week1_programming_challenges/1_sum_of_two_digits/APlusB.cpp | #include <iostream>
int sum_of_two_digits(int first_digit, int second_digit) {
return first_digit + second_digit;
}
int main() {
int a = 0;
int b = 0;
std::cin >> a;
std::cin >> b;
std::cout << sum_of_two_digits(a, b);
return 0;
} | ALGO | 0.996337 | 5.244339 |
f5864186-4284-4763-af13-f890004b0a22 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/ChefAndAnts_20210112171250.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999873 | 3.644832 |
e236afbe-3877-4c0a-a3ab-4897a07297e3 | cran/BLPestimatoR | src/cppFunctions.cpp | #include <RcppArmadillo.h>
// Includes/namespaces
#include <iostream>
#include <string>
using namespace Rcpp;
using namespace std;
// [[Rcpp::export]]
NumericMatrix getSij(const NumericMatrix &expmu,
const NumericVector &expdelta,
const IntegerVector &cdindex){
int nmkt... | ALGO | 0.99981 | 6.096551 |
16e1869a-327c-4226-8822-cd0ae0165dbd | eJosR-Coding/ProyectoJueguito | ProyectoJueguito.cpp | #include "pch.h"
#include "iostream"
using namespace System;
using namespace std;
void mostrarDados(int num) {
switch (num) {
case 1:
cout << endl << " +--------------+ ";
cout << endl << " / /|";
cout << endl << " +---------------+ |";
cout << endl << " | ... | TOOL | 0.853919 | 3.111295 |
30dfd6b9-b1ac-4452-9d8a-a16ae853da0d | harshkathrotiya/cp | A_Die_Roll.cpp | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define pb push_... | ALGO | 0.99943 | 4.879192 |
9b882069-ede5-4350-94ab-bf290ed7adbe | harsh12panghal/100DaysOfCode | Day23.cpp | /*
2373. Largest Local Values in a Matrix
You are given an n x n integer matrix grid.
Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that:
maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + 1.
In other words, we want to find the large... | ALGO | 0.99996 | 6.327391 |
3288dbca-e60b-41c9-bdd8-af41613e8810 | aryansinghh1/C-in-class | stl/vector2_insertion.cpp | #include<iostream>
#include<vector>
using namespace std;
void display(vector<int> &v)
{
for ( int i = 0 ; i < v.size(); i++)
{
cout<<v[i]<< " ";
}
cout<<endl;
}
int main ()
{
vector<int> vec1;
int element, size;
cout<<"Enter the size of vector"<<endl;
cin>>size;
for ... | ALGO | 0.995562 | 3.326432 |
4f6dfbbf-8153-4055-8b9c-68524224fccb | jigsid/test2 | venv/Lib/site-packages/sklearn/utils/src/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.9982 | 7.198757 |
69f10eb6-0b42-4abf-9789-b20e65719e9c | TroyJockDeng/CudaStudy | 03STL/09Adapters.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
class Print: public binary_function<int, int, void> {
public:
void operator()(int v, int val) const{
cout << v << ", " << val << " ";
cout << v + val<< endl;
}
};
void test01(){
vector<int... | TOOL | 0.985267 | 5.023165 |
9fa9dd8b-40f4-489e-8e2d-fc19ab0db135 | oVeron0615/baekjoon | boj_old/baekjoon_1520.cpp | #include <iostream>
#include <cstring>
using namespace std;
int map[500][500], dp[500][500];
int M, N;
int f(int, int);
int main()
{
cin >> M >> N;
for (int i{ 0 }; i < M; i++)
{
for (int j{ 0 }; j < N; j++)
{
cin >> map[i][j];
}
}
memset(dp, -1, sizeof(dp));
int x{ 0 }, y{ 0 };
cout << f(x, y);
}... | ALGO | 0.999982 | 3.794338 |
4ad8bd95-a42c-48a2-81a0-ef95a87f7ccf | ivabby/Competitive-Programming | CodeChef Contest/Lost in Code/Ish and String Game.cpp | #include<bits/stdc++.h>
#include<set>
#include<iterator>
#include<algorithm>
using namespace std;
#define forr(i,a,n) for (int i = (a); i < (n); ++i)
#define fore(i,a,n) for (int i = (a); i <= (n); ++i)
#define ford(i,a,b) for (int i = (a); i >= (b); --i)
#define MAX 1000000007LL
#define mod 998244353
#define forn(n,a)... | ALGO | 0.999985 | 5.57982 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.