uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4e148622-f426-4053-a0c4-2386549a7feb | WalterDeng/MS-Analysis | Data preprocessing/Matlab version/codegen/lib/data_baseline/data_baseline.cpp | // Include files
#include "data_baseline.h"
#include "minOrMax.h"
#include "rt_nonfinite.h"
#include "std.h"
#include "coder_array.h"
#include <cmath>
// Function Declarations
static double Baseline(coder::array<double, 2U> &x_baselined, double start,
double stop, const coder::array<double, 1U> ... | ALGO | 0.994358 | 4.235743 |
6a3a9531-74d6-46ff-8955-e212304048e2 | NMPRcuncha1/cpp | before 20thapril2023/10thapril.cpp | #include <bits/stdc++.h>
using namespace std;
const int N=0;
#define INF 1e9+7
int main(){
int n=0;
cin>>n;
while(n){
int k=0,temp=0,r=0,add=0;
cin>>k;
temp=k;
vector<int> v;
while(temp){
r=k%10;
if(r!=0){
add++;
}
d=k/10;
}
}
return 0;
} | ALGO | 0.999287 | 3.533082 |
45bd7e8c-4000-4437-9778-1163f0873e6e | LuisCastilloCh/Lab1 | P13.cpp | #include <iostream>
using namespace std;
int main(){
cout<<"numero impar: ";
int numero,contador1=0;
cin>>numero;
int suma_principal=0;
for(int i=3;i<=numero;i+=2){
contador1+=1;
suma_principal+=i*i;
}
int suma_pares=0;
for(int i=2;i<=contador1*2;i+=2){
suma... | ALGO | 0.999774 | 3.970294 |
f71aa694-88e5-4ecc-90ab-59664858d235 | ApolloMonasa/DS | Algorithm_AND_DataStructure/C3_Tree/12.LC102-DFS.cpp | /*************************************************************************
> File Name: 12.LC102-DFS.cpp
> Author:
> Mail:
> Created Time: Fri 14 Feb 2025 04:58:32 PM CST
************************************************************************/
/**
* Definition for a binary tree node.
* struct TreeNode {
* ... | ALGO | 0.999973 | 6.08167 |
777505c4-abf8-4954-ba5d-eac597eec7ad | DawiX123PL/PLCStarter | boost_1_79_0/libs/geometry/doc/src/examples/algorithms/touches_one_geometry.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[touches_one_geometry
//` Checks if a geometry has at least one touching point (self-tangency)
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.h... | TOOL | 0.936498 | 7.122601 |
30118fe2-af17-4fe5-a1f3-f5352bef0b4a | watermelonCrane/PS-Practice | code-up/1046.cpp | #include <iostream>
#include <iomanip>
int main() {
int a, b, c;
long long sum;
double average;
std::cin >> a >> b >> c;
sum = a + b + c;
average = static_cast<double>(sum) / 3.0f;
std::cout << sum << std::endl << std::fixed << std::setprecision(1) << average;
return 0;
} | ALGO | 0.933018 | 3.89943 |
da28aa94-71dc-4a30-82d5-9607f111fc1a | Archangel983/cf-practice | 133A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
for (int i = 0; i < s.size(); i++)
{
if (s[i] == 'H' || s[i] == 'Q' || s[i] == '9')
{
cout << "YES" << endl;
return 0;
}
}
cout << "NO" << endl;
return 0;
} | ALGO | 0.999417 | 3.734308 |
1c669228-221a-443e-8b75-d37de955b49f | standbyme227/cs_bootcamp-6-181107 | call_by_value.cpp | #include <iostream>
using namespace std;
void change_value(int x, int value)
{
x = value;
cout << "x : " << x << " in change_value" << endl;
}
int main(void)
{
int x = 10;
change_value(x, 20);
cout << "x: " << x << " in main" << endl;
return 0;
} | TOOL | 0.980837 | 4.859397 |
642e3082-d976-407a-815c-b339c15a2741 | huseyin-yildiz/GTU-Homeworks | CSE 312 OS/Hw2 (Virtual Memory and Page Reaplacement Algorithms)/src/sort.cpp |
// function to swap elements
void swap(int *a, int *b) {
int t = *a;
*a = *b;
*b = t;
}
// function to find the partition position
int partition(int array[], int low, int high) {
// select the rightmost element as pivot
int pivot = array[high];
// pointer for greater element
int i = (low - 1);
... | ALGO | 0.999991 | 5.066784 |
ed8850cb-f417-4dfc-95ec-0a8c12d36a58 | sy117/SPOJ-Solutions | BGIRL.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<bool> vec(N, true);
int id[N];
int size[N];
void sieve()
{
vec[0]=vec[1]=false;
for(int i=2;i*i<N;i++)
{
for(int j=i*i;j<N;j+=i)
{
vec[j]=false;
}
}
}
void fill()
{
for(int i=0;i<N;i++)
{
id[i]=i;
size[i]=1;
}
}
int root... | ALGO | 0.99976 | 4.915726 |
dc89fc6e-34b5-4c78-bef6-936bf91f5cf7 | hallyx/LEO-Satellite | lib/eigen-3.4.0/unsupported/test/BVH.cpp | #include "main.h"
#include <Eigen/StdVector>
#include <Eigen/Geometry>
#include <unsupported/Eigen/BVH>
namespace Eigen {
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
}
template<int Dim>
struct Ball
{
EIGEN_MAKE_ALIGN... | TEST | 0.984797 | 6.629425 |
27ef201b-5ae7-4fd3-8442-9ca82474d18f | brobat6/competitive | Lazy/nilesh.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
// int solution(string &s) {
// int n = s.length();
// set <char> t;
// int ans = 1;
// for(int i = 0; i < n; i++) {
// if(t.find(s[i]) == t.end()) {
// t.insert(s[i]);
// } else {
// t.clear();
... | ALGO | 0.999988 | 5.172882 |
0a19cd05-4f65-46cf-b715-78100eedd3e9 | shwang53/Data-Structue | lab_avl/avltree.cpp | /**
* @file avltree.cpp
* Definitions of the binary tree functions you'll be writing for this lab.
* You'll need to modify this file.
*/
template <class K, class V>
V AVLTree<K, V>::find(const K& key) const
{
return find(root, key);
}
template <class K, class V>
V AVLTree<K, V>::find(Node* subtree, const K& k... | ALGO | 0.999455 | 6.350823 |
adb06cee-aa9a-4eb3-b73c-35c17c288349 | Tejas-Santosh-Nalawade/GFG-SUBMISSIONS | Difficulty: Easy/Longest substring with distinct characters/longest-substring-with-distinct-characters.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int longestUniqueSubstr(string &S) {
unordered_map<char,int>a;
int n=S.length();
int j=0,i=0,m=0;
for(int i=0;i<n;i++)
{
a[S[i]]++;
... | ALGO | 0.99948 | 6.471636 |
943cf8a7-40e6-4b5c-86e0-0ebe3d5e4c37 | mansigarg-nith/DSA | Patterns/pattern9.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cout<<"Enter the number: ";
cin>>n;
for(int i=1; i<=n; i++){
for(int j=1; j<=n-i; j++){
cout<<" ";
}
if(i==1 || i==n){
for(int k=1; k<=n; k++){
cout<<"*";
}
}
... | ALGO | 0.999936 | 3.88482 |
0be5e3de-035a-44e4-87f8-991bbb243721 | azzmosphere/rr_neruel | src/main/rr-agent/rr_nn.cpp | #include "rr_nn.hpp"
float _sigmoid(float x)
{
return 1.0f / (1 + exp(-x));
}
// computes the delta rule.
float _d_sigmoid(float x)
{
return (x * (1 - x));
}
/***********************************************************
* Create network based on the topology given.
*
* weights : weight to connecting node... | ALGO | 0.999713 | 3.613164 |
a6bd6844-f7ac-4286-aba9-14fbe2fe7cd5 | liuydd/programming-fundamentals | programming fundamentals/hw7/7-2/7-2.cpp | #include<iostream>
using namespace std;
const int p=100000;
int a[p]={},b[p]={};
void quick_sort(int l,int r){
int i=l;
int j=r;
int mid=a[(l+r)/2];
do{
while(a[i]<mid)
i++;
while(a[j]>mid)
j--;
if(i<=j){
swap(a[i],a[j]);
i++;
j--;
}
}while(i<=... | ALGO | 0.999997 | 3.338919 |
5e0d01ca-ac8d-4e79-a9bb-1275694156ab | dhruv2x/striver-dsa-sheet | Arrays-I/max_subarray.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums)
{
//Appoch 1
//TC : O(n*n) TLE 203/210
//using Brut Force Approch
/*
int cur_sum=0,maxsum=INT_MIN,n=nums.size();
for(int i=0;i<n;i++)
{
int cur_sum=0;
for(int j=i;j<n;j+... | ALGO | 0.999902 | 5.915564 |
aee7828f-077c-4f7c-8f26-513d8b0e021a | Ahmhxn/Data-Structure-Implementation-Using-C- | queue in array.cpp | #include<iostream>
using namespace std;
class queue{
int max,*que, *front,*rear,*temp;
public:
queue(){
max=6;
que=new int[max];
front=rear=temp=NULL;
}
void enqueue(){
if(rear==NULL){
rear=que;
cin>>*rear;
front=rear;
return;
}
if(((rear+1)==front)||(front==que && rear==que+max-1)){
... | ALGO | 0.998867 | 3.541463 |
7388b516-c8ef-4d84-8511-5a2f5ce4fda9 | xuxinyang/daneijl | L12/demo07.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 25;
int n, m, sx, sy, ex, ey, ans;
char a[maxn][maxn];
bool vis[maxn][maxn], flag;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
void dfs(int x, int y)
{
if (x == ex && y == ey)
{
flag = 1;
return;
}
for (... | ALGO | 0.999967 | 4.284196 |
637dc1d6-397a-449c-ab06-8f4eec64c36d | nighostchris/GirvanNewman | Source Code/main.cpp | #include <iostream>
#include <fstream>
#include "graph.h"
using namespace std;
int main(){
int cluster = 1; // record no. of clusters
int firstcreate = 0; // record the no. of decomposition
ifstream ifs("input.txt");
int graphsize = 0;
ifs >> graphsize;
Graph GN(graphsize);
for (int i = 0; i < graphsize; i++) ... | ALGO | 0.999859 | 3.703199 |
86b1438b-57fa-44e7-9e34-369da72dfffd | zoolootech/CUGL-Oct1992 | VOL_300/352_01/STRPPFNS.CPP | // STRPPFNS.CPP - contains String::findstr()
// this module searches one char string for another contained within
// similar to strstr() but obeys String::caseSens
// and returns offset rather than ptr.
//
// NOTE: routine declared static in class {}. No 'this' ptr.
//
#include <stdlib.h>
#include <string.h>
#incl... | TOOL | 0.967891 | 5.25223 |
81077b81-3412-4bfa-9e02-d1b669602702 | hucancode/cp | leetcode/problems/lowest_common_ancestor_of_a_binary_tree/solution.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:
TreeNode* dfs(TreeNode* root, TreeNode* p, TreeNode* q) {
// if found p or q in both le... | ALGO | 0.999969 | 6.230461 |
e1d336cb-7fad-4d57-9fac-ac9e82369395 | umersagheer/0075_CSA3_MAD_semester-work | 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 |
60bad6b8-fa46-47f9-860f-0c7aee8aa3ee | whquddn55/Algorithm_BojSolves | 14000/14954.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename a, typename b>
ostream& operator<<(ostream& os, const pair<a, b>& pai) {
os << pai.first << ' ' << pai.second;
return os;
}
template<typename a, typename b>
istream& operator>>... | ALGO | 0.999801 | 4.617031 |
e1ae6264-7f34-4c30-a155-cbb16b3619a4 | bruno-avr/competitive-programming | cf/round942/a.cpp | #include "bits/stdc++.h"
using namespace std;
#define optimize ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define ll long long
#define ld long double
#define pii pair<ll,ll>
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(),x.end()
#define INF ... | ALGO | 0.999981 | 4.929965 |
7ed405db-11f1-4b7f-bd4e-6b70f4627221 | doxncwfn/coding-stuff | Data Structure & Algorithms/.leetcode/2570.merge-two-2-d-arrays-by-summing-values.cpp | /*
* @lc app=leetcode id=2570 lang=cpp
*
* [2570] Merge Two 2D Arrays by Summing Values
*/
// @lc code=start
class Solution
{
public:
vector<vector<int>> mergeArrays(vector<vector<int>>& nums1, vector<vector<int>>& nums2)
{
int n = nums1.size(), m = nums2.size();
vector<vector<int>> result;... | ALGO | 0.999937 | 7.217473 |
021ebbef-adc4-4db9-822a-3579253ffef2 | ishandutta2007/codeforces | brovko/normal/1004/D.cpp | #include <bits/stdc++.h>
#define int long long
#define ld long double
#define x first
#define y second
#define pb push_back
using namespace std;
int n, A[1000005], k[1000005];
int f(int x)
{
if(x == 0)
return 1;
return 4 * x;
}
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
... | ALGO | 0.999979 | 3.946627 |
cc84f074-d1ae-4c24-a148-80835c87ddc5 | vibhash-singh/online-judges | codechef/muloflargenums.cpp | #include <iostream>
int main () {
long long int n1;
long long int n2;
int arr[100];
std::cin >> n1 >> n2;
int index = 0;
int digit = 0;
while (n1 != 0) {
digit = n1 % 10;
arr[index++] = digit;
n1 = n1 / 10;
}
int temp = 0;
long long int x;
for (int i = 0 ; i < index; i++) {
x = arr[i] * n2 + t... | ALGO | 0.999954 | 3.862908 |
03289ef2-a045-4f08-8572-446a70b89fc0 | ILCOINDevelopmentTeam/ilcoin-master | src/hash.cpp | #include "hash.h"
#include "crypto/common.h"
#include "crypto/hmac_sha512.h"
#include "pubkey.h"
inline uint32_t ROTL32(uint32_t x, int8_t r)
{
return (x << r) | (x >> (32 - r));
}
unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char>& vDataToHash)
{
// The following is MurmurHash3... | ALGO | 0.999438 | 7.161173 |
acaf48dc-0b3a-4ed8-b4c4-1637a35bae93 | PriyanshuYadav001/LeetCode | 2410.maximum-matching-of-players-with-trainers.cpp | /*
* @lc app=leetcode id=2410 lang=cpp
*
* [2410] Maximum Matching of Players With Trainers
*/
// @lc code=start
class Solution {
public:
int matchPlayersAndTrainers(vector<int>& players, vector<int>& trainers) {
sort(players.begin(),players.end());
sort(trainers.begin(),trainers.end());
... | ALGO | 0.999927 | 6.235889 |
9dcb8960-f121-4a56-bdf9-f1ca464943b2 | yzzupgo/MFTCG | Data/abc131_b/occhan/wa/7682770.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
int main(){
int n,k,c=0;cin>>n>>k;
for(int i=k+1;i<k+n;i++)c+=i;
cout<<c;
}
| ALGO | 0.999793 | 3.142799 |
fd7ddbe8-6c23-43e3-88d3-b51776de2d0d | egorrts/c-_2023_inf | лаба1 c++/commonly_used_element.cpp | #include <iostream>
#include <chrono>
#include <random>
using namespace std;
int mass[1000000] = {};
int count1[1000000] = {};
/*функция заполняет первые size элементов массива значениями от 0 до size-1 в произвольном порядке */
void fill_array(int size){
default_random_engine rng((int)time(0));
uniform_int_... | ALGO | 0.999737 | 4.79882 |
e04a6e7b-e4e0-49d7-9cec-10b5c8aa819c | Angelopgit/Facial-Attendance-System | opencv-4.7.0/3rdparty/carotene/src/add_weighted.cpp | #include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
using namespace internal;
template <typename T> struct TypeTraits;
template <> struct TypeTraits< u8> { typedef u16 wide; typedef u8 unsign; typedef uint8x16_t vec128; };
template <> struc... | TOOL | 0.983731 | 6.660854 |
09d5ecfc-c2d0-4269-8b97-88a1a2844863 | alexandraback/datacollection | solutions_5765824346324992_0/C++/huangqundl/main.cpp | #include <stdio.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;
class Barber {
public:
long long finish;
int id;
};
bool operator< (Barber a, Barber b) {
if( a.finish == b.finish )
... | ALGO | 0.999881 | 3.596603 |
c6b08815-8b62-457b-9859-fe2d242ad102 | moinulshaon/UVa-Problems | vol 104/10462__completed/10462.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <cstring>
using namespace std;
struct lists {
int start;
int end;
int distance;
} a [100000+ 10],save[100000+ 10];
int parent [10000 + 10];
int size[10000+10];
int vertex;
int edges;
bool cmp (lists p,... | ALGO | 0.999879 | 4.056387 |
2ed2b7c5-3ef1-4116-b58e-a3d5d2af7b74 | PedroEduardoGarcia/leetcode | src/0997-Find-the-Town-Judge/find_the_town_judge.cpp | #include <iostream>
#include <vector>
class Solution {
public:
int findJudge(int n, std::vector<std::vector<int>>& trust) {
std::vector<int> in_degree(n, 0);
std::vector<int> out_degree(n, 0);
std::vector<int> ans;
for (auto t : trust) {
out_degree[t[0] - 1] += 1;
... | ALGO | 0.999605 | 5.928158 |
4fca6c54-8c24-4ed8-a1be-fc1574e51722 | Bullet970/Revolver | BinToInt.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{ string binary;
bool valid = true;
cout<<"please enter the 8-bit binary number (only 1 and 0 allowed): ";
cin>>binary;
int k = binary.length();
for(int i=0;i<=(k-1);i++)
{ if(binary[i] != '1' && binary[i]!='0')
{ ... | ALGO | 0.999335 | 4.628752 |
838c8a50-343f-48ee-94ea-83b2c2e4bbf4 | forking-altcoins/C4T | src/bech32.cpp | #include "bech32.h"
namespace
{
typedef std::vector<uint8_t> data;
/** The Bech32 character set for encoding. */
const char* CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
/** The Bech32 character set for decoding. */
const int8_t CHARSET_REV[128] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -... | ALGO | 0.998435 | 7.472923 |
d3e05958-074d-4388-b785-327546a579f2 | whyyouareiwhy/Practice | string_practice/string_1.cpp | // string1.cpp -- Count specific letters in a string
#include <iostream>
int c_in_str(const char * str, char ch);
int main()
{
using namespace std;
char mmm[15] = "minimum";
const char *wail = "ululate"; // wail points to string
int ms = c_in_str(mmm, 'm');
int us = c_in_str(wail, 'u');
... | ALGO | 0.990822 | 6.155951 |
3938558e-6b01-4b2e-ba65-5895c898f55d | CoderRk459/habijabi | Curve_fitting_exponential_y_ab_x.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void calculateSums(vector<double> &x, const vector<double> &y, double &sumX, double &sumX2, double &sumY, double &sumXY)
{
int n = x.size();
for (int i = 0; i < n; i++)
{
double xi = x[i];
double yi = y[i];
... | ALGO | 0.998888 | 4.447707 |
ba4962d8-4864-472a-b012-b23a11ca294f | khadas/android_external_icu | icu4c/source/layoutex/LXUtilities.cpp | #include "layout/LETypes.h"
#include "LXUtilities.h"
U_NAMESPACE_BEGIN
//
// Finds the high bit by binary searching
// through the bits in n.
//
le_int8 LXUtilities::highBit(le_int32 value)
{
if (value <= 0) {
return -32;
}
le_int8 bit = 0;
if (value >= 1 << 16) {
value >>= 16;
... | TOOL | 0.973142 | 5.889595 |
ce3e379b-a95e-4ed3-8134-c2179b03c6b8 | NickGhezzi/GameEngineProject | ICA1/Libraries/Framework/Libraries/Bullet3D/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp | #include "btConvex2dConvex2dAlgorithm.h"
//#include <stdio.h>
#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/Collisio... | ALGO | 0.999451 | 6.671592 |
6bdcd57f-98dc-422f-b14b-571e360da718 | joaopaulocastilho/aBNT-Codes | Codeforces/CF263A-NINJA.cpp | #include <stdio.h>
#include <stdlib.h>
int main(void){
int i, j, ia, ja, num;
for(i = 1; i <= 5; i++)
for(j = 1; j <= 5; j++){
scanf("%d", &num);
if(num) { ia = i; ja = j; }
}
printf("%d\n", abs(3 - ia) + abs(3 - ja));
return 0;
}
| ALGO | 0.999423 | 3.022493 |
a7e08ad0-832b-400e-a8c3-8708612d1251 | peer-open-source/xara | SRC/analysis/integrator/Dynamic/HHTExplicit.cpp | // $Revision$
// $Date$
// $URL$
// Written: Andreas Schellenberg (<EMAIL>)
// Created: 10/05
// Revision: A
//
// Description: This file contains the implementation of the HHTExplicit class.
#include <HHTExplicit.h>
#include <FE_Element.h>
#include <FE_EleIter.h>
#include <LinearSOE.h>
#include <AnalysisModel.h>
#in... | ALGO | 0.994388 | 5.834685 |
5ba4a0b6-2744-4e36-9d03-b43544bcb5fc | salils562/Cpp-programs | Data structures/patterns/final_pattern.cpp | #include<iostream>
using namespace std;
int main(){
int i=1;
while(i<=4){
int j=1;
while(j<=(4-i)){
cout<<" ";
j++;
}
int z=1;
while(z<=i){
cout<<z;
z++;
}
int s=1;
int d=(i-1);
while(s<=i){
if(d==0)
{
cout<<"";
s++;}
... | ALGO | 0.9997 | 3.125247 |
653d962b-47ce-406a-aab5-8a95ca470131 | PabloMessina/Competitive-Programming-Material | Solved problems/Codejam/2022/round2/SavingTheJelly.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
// defines
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define invrep(i,b,a) for(int i = b; i >= a; --i)
#define umap unordered_map
#define uset unordered_set
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
// ... | ALGO | 0.999801 | 3.913347 |
fb669c3e-af62-4421-bf1e-d1779c58b687 | ThomasParistech/sudoku | src/fisherman.cpp | /*********************************************************************************************************************
* File : fisherman.cpp *
* ... | ALGO | 0.995346 | 3.987087 |
deb156f4-fc74-4f8c-9e28-c357f6d73c34 | AmiraMohamd95/Compiler | compiler/phase1-phase2/src/Automata_maker.cpp | #include "Automata_maker.h"
#include "node.h"
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
Automata_maker::Automata_maker()
{
id_counter = 0;
}
void Automata_maker ::set_input (set <string> s){
this ->input = s;
}
set <string> Automata_maker ::get_input (){
return this-> input ;
... | ALGO | 0.99599 | 3.351169 |
7f4648f0-4590-4189-a314-c669d10ad017 | hgparkk/Algorithm-2023 | 알고리즘_2장/EuclidProject/euclid.cpp |
/*
파일 이름: euclid.cpp
설명 : 재귀함수를 사용한 유클리드 알고리즘과 반복문을 사용한 유클리드 알고리즘의 결과와 실행시간 비교 프로그램
작성자 : 박현규
*/
#include <stdio.h>
//1. 재귀함수와 반복문을 이용한 유클리드 알고리즘을 각각 구현한다.
// 재귀함수를 이용한 유클리드 알고리즘
long long euclidRecursive(long long a, long long b)
{
if (b == 0)
return a;
else
return euclidRecursive(b, a % b);
}
// 반복문을 이용한 유... | ALGO | 0.999892 | 4.500393 |
5f9a0664-bfd6-42a1-876f-019afd29a6bd | aditi-govindu/LeetCode-DSA | LeetCode75/Level2/OddEvenLinkedList.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) {}
* };
*/
/*
Q328. Description: Given the head of a singly ... | ALGO | 0.999908 | 5.743189 |
d6b06378-e7ff-4e38-a994-444a9788950f | Melisa-os/C- | vjezbanka/6. Napisati program u koji ucitava 10 brojeva, pa u jedan red ispisuje prane, a u drugi neparne/main.cpp | /******************************************************************************
6. Napisati program u koji ucitava 10 brojeva, pa u jedan red ispisuje prane,
a u drugi neparne.
*******************************************************************************/
#include <iostream>
using namespace std;
int main()
{
... | ALGO | 0.98127 | 3.565334 |
79b76007-8d79-43e4-a507-30a46b5f0e09 | lge88/OpenSees | SRC/reliability/domain/distributions/Type3SmallestValueRV.cpp | // $Revision: 1.7 $
// $Date: 2007-02-17 21:27:23 $
// $Source: /usr/local/cvs/OpenSees/SRC/reliability/domain/distributions/Type3SmallestValueRV.cpp,v $
//
// Written by Terje Haukaas (<EMAIL>)
//
#include <Type3SmallestValueRV.h>
#include <Vector.h>
#include <cmath>
Type3SmallestValueRV::Type3SmallestValueRV(int p... | ALGO | 0.999344 | 4.845647 |
6ba263c8-e6a7-4d5e-9129-c2778e65817e | aaryan182/dsa-prac | S-6LinkedList/L-1-1DLL/2_insertAtendLL.cpp | // https://www.geeksforgeeks.org/problems/linked-list-insertion-1587115620/0
class Solution {
public:
Node *insertAtEnd(Node *head, int x) {
// Code here
Node* newNode = new Node(x);
if(!head) return newNode;
Node* current = head;
while(current->next != ... | ALGO | 0.998035 | 5.629713 |
6e225d88-a4cc-475b-93ad-3e5ea5134cf1 | CaptainHarryChen/OIerCode | CQBZOJ/1701贪吃的九头龙.cpp | #include<cstdio>
#include<cstring>
#include<vector>
using namespace std;
const int MAXN=305;
int N,M,K;
struct Edge
{
int v,w;
Edge(int _v,int _w){v=_v;w=_w;}
};
vector<Edge> adj[MAXN];
int dp[MAXN][MAXN][2];
int siz[MAXN];
void DP(int u,int fa=0)
{
static int temp[MAXN][2];
dp[u][0][0]=dp[u][1][1]=0;
siz[u]=1... | ALGO | 0.999942 | 3.832185 |
dfdfeda1-dbb9-43e6-911b-c4ec1208cc63 | vanessadcamara/tutoria-obi-2020 | Neps Academy/Frete da Família Silva.cpp | #include <bits/stdc++.h>
using namespace std;
# define vt vector
typedef long long ll;typedef long double lld;typedef string str;typedef pair<double, double> dd;
typedef vt<int> vi;typedef vt<vt<int>> vvi;typedef vt<double> vd;typedef vt<ll> vll;
typedef vt<lld> vld;typedef vt<char> vc;typedef vt<str> vs;typedef pair<... | ALGO | 0.999962 | 4.437829 |
f263cede-5925-4e70-aa43-fe0dea3b2519 | wsn1226/FEM-Newton-Backtracking | extern/libigl/tutorial/715_MeshImplicitFunction/main.cpp | #include <igl/copyleft/marching_cubes.h>
#include <igl/sparse_voxel_grid.h>
#include <igl/opengl/glfw/Viewer.h>
#include <Eigen/Core>
#include <iostream>
#include "tutorial_shared_path.h"
int main(int argc, char * argv[])
{
// An implicit function which is zero on the surface of a sphere centered at the origin wit... | ALGO | 0.949156 | 7.383038 |
58e11147-0915-4de7-8e01-dc549c477037 | KykeonDrinkers/E_Olymp | Week 7/901.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string s;
cin>>s;
int say=0;
for(int i=1;i<s.length();i++)
{
if(s[i]=='+' || s[i]=='-' || s[i]=='*')
{
say++;
}
}
cout<<say;
}
| ALGO | 0.999824 | 3.526474 |
5c947ece-905b-4ed8-be61-cd880e2bb593 | kksingh069/CodeX | Program to Check String is Containing Only Digits.cpp | #include <iostream>
using namespace std;
void is_digits(string& str)
{
for (char ch : str) {
int v = ch; // ASCII Val converted
if (!(ch >= 48 && ch <= 57)) {
cout << "False" << endl;
return;
}
}
cout << "True" << endl;
}
// Driver Code
int main()
{
... | ALGO | 0.99202 | 5.006125 |
148628ec-5144-4463-9716-522aa78279b9 | apostud/AA | SparseTable.cpp | #include <bits/stdc++.h>
using namespace std;
void Compute(int N, vector<int> v, vector<vector<int>> &SparseTable) {
int j = 1;
while((1 << j) <= N){
int i = 0;
int aux;
while(i + (1 << j) - 1 < N) {
if (v[SparseTable[i][j - 1]] > v[SparseTable[i + (1 << (j - 1))][j - 1]]) ... | ALGO | 0.999997 | 4.415535 |
8e32439c-beeb-4eff-a8cb-72420220bbaf | ishandutta2007/codeforces | chemthan/normal/377/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
... | ALGO | 0.999964 | 3.448396 |
3a2d42ae-07f9-4c4d-9bc0-18c1d4ca5a84 | JiteshGupta17/LeetCode-Solutions | Easy/14. Longest Common Prefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
if(!strs.size()) return "";
if(strs.size()==1) return strs[0];
int ShortestStringIdx = 0;
int len = strs[0].length();
// Find the shortest length string
for(int i = 0;i<strs.size();i+... | ALGO | 0.999856 | 5.763682 |
42f75c50-4715-4ecd-9a02-9d3b619e05e3 | Starry0/ACM | ecjtu/summer training #1/c.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
typedef pair<int,int> P;
map<int,int> xx,yy;
map<P,int> s;
map<int,int>::iterator it1;
map<P,int>::iterator it2;
int main(){
int n;
scanf("%d",&n);
for(int i = 1; i <= n; i ++){
int a,b;
scanf("%d%d",&a,&b);
xx[a]++;y... | ALGO | 0.999665 | 3.754104 |
072b5e3e-9012-43ee-9cc8-e8ff439ced5d | ishandutta2007/codeforces | andr0901/normal/1355/F.cpp | /*973496160
973701120
973728000
973733888
973838250
973944000
973969920
974053080
974131200
974177280
974219400
974245440
974371860
974413440
974445360
974561280
974584098
974592000
974635200
974668800
974856960
974868480
974877120
974942526
974994720
975051000
975127440
975134160
975151872
975175680
975233280
97524000... | ALGO | 0.999697 | 3.816627 |
822c0745-9cf1-48c1-8922-b1206fe8770b | J-B-Mugundh/LeetCode-Solutions | 0396-rotate-function/0396-rotate-function.cpp | class Solution {
public:
// int maxRotateFunction(vector<int>& nums) {
// int n = nums.size();
// int maxVal = INT_MIN;
// for(int i = 0; i < n; i++){
// int prod = 0;
// for(int j = 0; j < n; j++){
// prod += j * nums[(i + j) % n];
// }
... | ALGO | 0.999981 | 5.809916 |
9e979308-80dd-4d94-9af1-4c5401ec95ac | sayantika01/Design-and-Analysis-of-Algorithm | knapsack.cpp | #include<bits/stdc++.h>
using namespace std;
struct Item{
int value;
int weight;
};
int partition(Item items[],int left,int right){
double pivot=double(items[right].value/items[right].weight);
int i=left-1;
for(int j=left;j< right-2;j++){
double pi=double(items[j].value/items[j].weight);
... | ALGO | 0.999966 | 4.910844 |
f0e2c35a-04a3-4640-8d95-a1da2aedc0f2 | Katsute/Baruch-CIS-4100 | assignments/assignment4/array.cpp | #include <iostream>
using namespace std;
bool contains(int[], int, int);
int main() {
cout << "Enter array LEN:" << endl;
int LEN;
cin >> LEN;
int arr[LEN];
for(int i = 0; i < LEN; i++) {
cout << "Enter element " << i + 1 << ":" << endl;
cin >> arr[i];
}
int value;
c... | ALGO | 0.998274 | 4.620866 |
9cb12b51-bd0f-4af2-a0e9-d1e59fd690a3 | nakatamaho/mplapack | mplapack/reference/Rsyevd_2stage.cpp | #include <mpblas.h>
#include <mplapack.h>
void Rsyevd_2stage(const char *jobz, const char *uplo, INTEGER const n, REAL *a, INTEGER const lda, REAL *w, REAL *work, INTEGER const lwork, INTEGER *iwork, INTEGER const liwork, INTEGER &info) {
//
// -- LAPACK driver routine --
// -- LAPACK is a software packa... | ALGO | 0.999731 | 4.006191 |
8b58168f-7f4e-441e-9e09-90a3c1224e4a | ParianshMahajan/CodeForces | CP-31 TLE/1200/7PlayingCasino.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll t;
cin >> t;
while (t--) {
ll n,m;
cin >> n>>m;
vector<vector<int>>arr(m,vector<int>(n));
for (int i=0; i<n; i++){
for(int j=0;j<m;j++){
cin>>arr[j][i];
... | ALGO | 0.999969 | 3.49312 |
dc1984ba-b157-4ef2-a941-ba29c4d422f7 | adityanjr/code-DS-ALGO | CodeForces/Complete/1100-1199/1157D-NProblemsDuringKDays.cpp | #include <cstdio>
#include <vector>
typedef long long ll;
int main(){
ll n, d; scanf("%lld %lld", &n, &d);
if(n < d * (d + 1) / 2){puts("NO"); return 0;}
std::vector<ll> a(d);
const ll base = d * (d + 1) / 2;
ll x = (n - base) / d;
n -= base + x * d;
for(ll p = 0; p < d; p++){a[p] = x + ... | ALGO | 0.999956 | 3.784957 |
62c1d587-94d4-44ac-acf0-79b189a6c301 | geyan3566/mfem_dgd | miniapps/toys/automata.cpp | #include "mfem.hpp"
#include <algorithm>
#include <fstream>
#include <iostream>
#include <bitset>
#include <vector>
using namespace std;
using namespace mfem;
void PrintRule(bitset<8> & r);
void ApplyRule(vector<bool> * b[], bitset<8> & r, int ns, int s);
void ProjectStep(const vector<bool> & b, GridFunction & x, int... | ALGO | 0.999846 | 5.20819 |
b72977c1-a42e-4d8d-bc56-50ea7ccf4c9c | baloniq89/AGH-PO1 | Lab09/Table.cpp | #include "Table.h"
bool cmp(const Data &data1, const Data &data2, int c){
return data1[c] < data2[c];
}
void Table::operator+=(const Data &new_data){
_day.push_back(new_data);
}
void Table::print()const {
for(auto &x : _day)
{
x.print();
}
std::cout<<std::endl;
}
Table& Table::sort(int column) {... | TOOL | 0.871049 | 4.566756 |
d109948d-9a08-4d70-b4b5-3d1a03401d6a | Roman-n/Xray-CoC_Demosfen | src/xrCDB/xr_area_query.cpp | #include "stdafx.h"
#include "xr_area.h"
#include "frustum.h"
#include "../xrCore/_vector3d_ext.h"
using namespace collide;
bool CObjectSpace::BoxQuery (Fvector const & box_center,
Fvector const & box_z_axis,
Fvector const & box_y_axis,
Fvector const & box_sizes,
xr_vector<F... | ALGO | 0.916098 | 5.885709 |
150c47dd-12d5-42e3-8748-631a640f04ba | clarashepherd/20-07_GABE_clara | g2main.cpp | /****************************
LatticeSolve Main File
****************************/
/*********************
GABE Header
*********************/
//contains all the parameters, changable and unchangeable
#include "g2header.h" //contains declerations for program functions and parameters file
long double t=starttime;//... | ALGO | 0.99939 | 3.03487 |
30f06a32-8d85-4efc-a8a3-1b19b8615d4f | lokeshs333/BINARY-TREES | 180.cpp | // diameter is using recursion..
#include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
node *left;
node *right;
};
node *createnode(int data)
{
node *n = new node;
n->data = data;
n->right = NULL;
n->left = NULL;
return n;
}
int height(node *root, int &dia)
{
if (root... | ALGO | 0.999889 | 5.549139 |
79931f91-026c-423f-89f0-8c6209f91b67 | ttamx/Competitive-Programming | codeforces/2004E.cpp | #include<bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;
using db = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<db>;
using pii = pair<int,int>;
using pll = pair<ll,ll>... | ALGO | 0.999984 | 4.611028 |
ff25c638-92c0-4b98-b9b9-a2aa0809c131 | Andresknaz/recipe_book | 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.998799 | 6.776823 |
e3eef090-75dd-4b2c-9827-e055935a8b4d | AkshatAggarwal14/Competitive-Programming | AtCoder/ABC315/C.cpp | #include "bits/stdc++.h"
using namespace std;
#ifdef LOCAL
#include "debug.hpp"
#else
#define dbg(...)
#endif
using ll = long long;
const ll INF = 1e18;
const ll N = 1e5 + 5;
const ll MOD = 1e9 + 7; // 998244353;
void test() {
ll n;
cin >> n;
vector<pair<ll, ll>> a(n);
map<ll, vector<ll>> mp;
for... | ALGO | 0.999966 | 5.072752 |
2e0feccc-f217-4014-bdad-52d9cd4a343d | etf-tk-sdn/QKDFPGA | sw/boost_1_81_0/libs/phoenix/example/function.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/function.hpp>
using boost::phoenix::function;
struct is_odd_
{
typedef bool result_type;
template <typename Arg>
bool operator()(Arg arg1) const
{
return arg1 % 2 == 1;
... | ALGO | 0.984543 | 5.843373 |
7e7590cf-a162-4d90-aa47-95f737505f9c | amanjaingc/PLACEMENT | array_sum.cpp | #include<iostream>
#include<string>
using namespace std;
main()
{
long long int n,m,q,a1,a2,ans,count;
cin>>n>>m;
while(m--)
{
cin>>q;
count=0;
if(q<=(n+1))
ans = 0;
else
{
for(long long int i=1;i<=n;i++)
{
if((... | ALGO | 0.99989 | 3.299401 |
ee63eb0c-ce20-4e53-a3ff-9eee68ec5741 | usks213/ECSEngine | ECSEngine/ECSEngine/lib/bullet3/include/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp | #include "BulletCollision/CollisionShapes/btConvexShape.h"
#include "btGjkEpaPenetrationDepthSolver.h"
#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
bool btGjkEpaPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& simplexSolver,
const btConvexShape* pConvexA, const btConvexShape... | ALGO | 0.999897 | 6.407888 |
9c796190-0350-4ba1-b300-1777822e4fea | Sinfolke/ispa-parser | src/corelib.cpp | module;
module corelib;
import logging;
import cpuf.printf;
import std;
namespace corelib::file {
// Function to read the content of a file into a string
std::string readFile(const std::filesystem::path filePath) {
std::ifstream file(filePath, std::ios::in | std::ios::binary);
if (!file) {
... | TOOL | 0.940761 | 7.106638 |
86bddb18-81b7-46b6-8f3c-e5c5331e6740 | HEltim7/cpcode | Archive/AcWing/contests/week35/C.cpp | #include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
#define endl '\n'
const int N=3e3+10,INF=0x3f3f3f3f;
typedef pair<int,int> PII;
int n,ans=INF;
int s[N],c[N];
int dp[N][N];//i位置,s大于等于j的c最小值
int main() {
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
memset(d... | ALGO | 0.999964 | 3.471248 |
eb55b9a0-519e-4674-83c9-8a6755f3b322 | remcous/Athabasca-COMP206 | Unit 8/ConstPointers.cpp | //C08: ConstPointers.cpp
// Pointer to a Const
const int* u;
int const* v;
// Const Pointer
int d = 1;
int* const w = &d;
// Const Pointer to a Const
const int* const x = &d;
int const* const x2 = &d;
int main(){} | TOOL | 0.953198 | 3.212022 |
3d8da9c9-a69b-498c-b4e0-d6e7b1c873db | atulchaudh15/My-codes-vs-code | binTodeci.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(){
int n;
cin >> n;
int ans=0;
int i=0;
while (n!=0)
{
int digit = n % 10;;
n =n/10;
i++;
if (digit ==1)
{
ans = ans + pow(2,i);
}
... | ALGO | 0.999912 | 3.980566 |
3eaaf99f-2a06-4500-952f-70c479b466f5 | tasnim-zeba/Problem-Solving | Codeforces/1731C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main()
{
///fio
ll t,n,i,j,ans,k;
cin>>t;
while(t--)
{
cin>>n;
ll a[n+1];
for(i=0; i<n; i++)
{
cin>>a[i];
... | ALGO | 0.999879 | 3.986841 |
40b40819-aa53-4597-be73-d21c61870b7b | murugiclin/LAJ | src/bls/bls_worker.cpp | #include <bls/bls_worker.h>
#include <hash.h>
#include <serialize.h>
#include <util/ranges.h>
#include <util/system.h>
#include <memory>
#include <utility>
template <typename T>
bool VerifyVectorHelper(Span<T> vec)
{
std::set<uint256> set;
for (auto item : vec) {
if (!item.IsValid())
retu... | TOOL | 0.971374 | 5.650269 |
2a0b695f-36a7-4636-a1f4-77a554ae6b9a | aoaforever/C_trian | Labuladong_app/3.无重复字符的最长子串.cpp | /*
* @lc app=leetcode.cn id=3 lang=cpp
*
* [3] 无重复字符的最长子串
*
* https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/description/
*
* algorithms
* Medium (38.68%)
* Likes: 7420
* Dislikes: 0
* Total Accepted: 1.7M
* Total Submissions: 4.3M
* Testcase Example: '"abcabcbb"'
*... | ALGO | 0.999707 | 5.939615 |
431f05dd-61a2-4347-9c74-3c9a3a36bca1 | backengineering/llvm-msvc | libc/src/math/generic/remainderl.cpp | #include "src/math/remainderl.h"
#include "src/__support/FPUtil/DivisionAndRemainderOperations.h"
#include "src/__support/common.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(long double, remainderl, (long double x, long double y)) {
int quotient;
return fputil::remquo(x, y, quotient);
}
} // namespace LIBC_N... | TOOL | 0.963537 | 5.765735 |
42dde833-76b2-46b0-a59e-1fc7a68568d0 | Sebastian25L/P1Tarea1LancheSebastian | P1Tarea1LancheSebastian (Java y C)/P1Tarea1LancheSebastian/main.cpp | #include <iostream>
#include <fstream>
#include <locale.h>
using namespace std;
// Declaracin de variables
float Lanche_nota1, Lanche_nota2, Lanche_nota3;
void Lanche_guardarNotas() {
float Lanche_promedio = (Lanche_nota1 + Lanche_nota2 + Lanche_nota3) / 3;
// Se guardan las notas en el archivo
ofstream... | TOOL | 0.853412 | 5.114041 |
8e554718-e98b-4885-b40d-b75dabbd2dd7 | kartikx/DSA | LinkedLists/Singly/partition.cpp | // Write the Partition Function for Quick Sort on a Singly Linked List.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Node {
public:
Node(int val) {
this->val = val;
}
int val;
Node* next;
};
Node* makeList(vector<int>& values) {
Node* head ... | ALGO | 0.999984 | 5.691116 |
95285529-fc47-47fb-8943-926f2d9a8926 | mementum/codeeval | 03-hard/0234-code-like-huffman/0234-code-like-huffman.cpp | // Headers for test case input/output
#include <fstream>
#include <iostream>
// Headers for the implementation
#include <algorithm>
#include <array>
#include <iterator>
#include <tuple>
#include <vector>
template <typename T>
struct istream_iterator_until {
std::istream_iterator<T> iter;
std::istream_iterator... | ALGO | 0.982661 | 6.028782 |
d76ed309-6a45-4cd1-b34c-c468fd348d90 | sarvex/leetcode-perl | solution/1700-1799/1790.Check if One String Swap Can Make Strings Equal/Solution.cpp | class Solution {
public:
bool areAlmostEqual(string s1, string s2) {
int cnt = 0;
char c1 = 0, c2 = 0;
for (int i = 0; i < s1.size(); ++i) {
char a = s1[i], b = s2[i];
if (a != b) {
if (++cnt > 2 || (cnt == 2 && (a != c2 || b != c1))) {
... | ALGO | 0.999982 | 6.216237 |
b8ca62d9-0e16-4bd6-ac5e-979db1be17cd | NataschaPalhares/Beecrowd-Solutions-cpp | Beginner/2061.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
char acao[8];
for (int i=0; i<m; i++) {
cin >> acao;
if (strcmp(acao,"fechou")==0)
++n;
if (strcmp(acao,"clicou")==0)
--n;
}
cout << n << endl;
return 0;
} | ALGO | 0.999715 | 3.685221 |
cd3cb0ca-cb42-45b9-ba7e-7d4dfe8516be | NandanHemanth/growpal-flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.99887 | 6.783439 |
b9a49a36-fb68-4148-b105-2f575f662421 | thuylinhptit/CTDL_GT | contest1_part2/bai23_SoBuocItNhat.cpp | #include<bits/stdc++.h>
#define ll long long
#define For(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
void Res(){
int n;
cin>>n;
int a[n+5];
For(i,1,n) cin>>a[i];
int ans=1,f[n+5];
f[1]=1;
for(int i=2;i<=n;i++){
f[i]=1;
for(int j=1;j<i;j++){
if(a[j]<=a[i])... | ALGO | 0.99963 | 4.416465 |
edf5405a-a007-4a56-868b-2aace4403c9d | MitchanUndergr/tareaestructura | tiempo_ejecucion.cpp | #include <iostream>
#include "ListArr.h"
int main() {
srand(time(NULL));
int num=1+rand()%(101-1);
int v[4]={4,100,350,500};
for(int i=0;i<4;i++){
ListArr list(v[i]);
cout<<"tiempo ejecucion insert_left para un vector de capacidad b= "<<v[i]<<endl;
auto start1=chrono::system_clock::now();
for(... | TEST | 0.956727 | 3.826647 |
53da18ac-07aa-41da-a219-6576d6618bf8 | lizhuomao/Llxy_AlgorithmDesign_programming_test | YangZeBin/1018.cpp | #include <stdio.h>
int main(){
int number1,i;
int jiawincount = 0, yiwincount = 0, balance = 0;
int jiachar[3] = {0}, yichar[3] = {0};
scanf("%d",&number1);
char number[number1][2];
for(i = 0; i < number1; i++){
scanf("%s",&number[i][0]);
scanf("%s",&number[i][1]);
}
for(i = 0; i < number1; i++){
i... | ALGO | 0.999921 | 3.133121 |
677291f8-838f-444f-8522-5af89a067d5d | Sabiqun-16/Algorithm-Design-and-Analysis-Sessional-CSE2202 | Recursive Programme/Fibonacci_Recursive.cpp | #include<bits/stdc++.h>
using namespace std;
int FiboRecursive(int n){
if(n<=1) return n;
return FiboRecursive(n-1)+FiboRecursive(n-2);
}
int main(){
int n=7;
int result=FiboRecursive(n);
cout<<"nth Fibonacci : "<<result<<endl;
return 0;
}
| ALGO | 0.999787 | 4.802989 |
259073f7-da68-44db-a833-dc5fa0bfe90e | mayankkaushik187/AlgoViser | BST/printPairSuminBST.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
class BinaryTreeNode
{
public:
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data)
{
this->data = data;
left = NULL;
right = NULL;
}
};
void printHelp(vector<int> &arr, int... | ALGO | 0.999929 | 4.582656 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.