uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
45f82f6a-e31a-4434-a437-96942b022947 | Invisiable-ID/warehouse | 对象和类practice.cpp | //第一题
#include<iostream>
using namespace std;
class Compare
{
public:
Compare() :i(23), j(2)
{
cout << "waiting" << endl;
};
int zeroSmaller()
{
return i < j ? i : j;
}
private:
int i, j;
};
int main()
{
Compare fir;
cout<<fir.zeroSmaller();
return 0;
}
//第二题
#include <iostream>
using namespace std;
... | ALGO | 0.998296 | 3.387587 |
599b0412-5126-4c27-80b4-9fd001992a1e | thenamerahulkr/LeetCode | 1910-remove-all-occurrences-of-a-substring/1910-remove-all-occurrences-of-a-substring.cpp | class Solution {
public:
string removeOccurrences(string s, string part) {
string resultStack;
int targetLength = part.size();
char targetEndChar = part.back();
for (char currentChar : s) {
resultStack.push_back(currentChar);
if (currentChar == targetEndChar... | ALGO | 0.999369 | 6.746387 |
4748212f-85e5-401c-9117-66ec3c4ccfa0 | azharnian/computer-science-fall-2324 | 10INFORMATIKA/10IPA1/Meet07/swap_vector.cpp | #include <iostream>
#include <vector>
std::vector<int> swap(int a, int b)
{
std::vector<int> result;
// result = {b , a};
result.push_back(b);
result.push_back(a);
return result;
}
int main()
{
int a = 4, b = 5;
std::cout << a << " " << b << std::endl;
std::vector<int> res = swap(a, b)... | ALGO | 0.999187 | 5.115913 |
197d22a3-3bc8-450c-b75e-57be08aeb11e | GunioRobot/scribe-dependencies | boost_1_41_0/libs/graph/example/undirected_dfs.cpp | #include <string>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/undirected_dfs.hpp>
#include <boost/cstdlib.hpp>
#include <iostream>
/*
Example graph from Tarjei Knapstad.
H15
|
H8 C2
\ / \
H9-C0-C1 C3-O7-H14
... | ALGO | 0.999542 | 6.577456 |
ee9c0217-6dec-485d-93df-83abd1970359 | zhangsicong233/cpp_learning | Algorithm_Exercise/NowCoder/2023年USST新生C语言语法训练1/A.cpp | #include <bits/stdc++.h>
#define int long long
using LL = long long;
const int MOD = 1e9 + 7;
int a, b;
void solution() {
std::cin >> a >> b;
std::cout << a % b << "\n";
}
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
solution();
return 0;
} | ALGO | 0.999859 | 4.107305 |
d029e577-82c3-418e-a592-ece12f7e9bc4 | hadleyhzy34/data_structure_and_algorithm | math/src/507-perfect-number.cpp | #include <iostream>
#include <math.h>
bool checkPerfectNumber(int num) {
if (num == 1)
return false;
int i = 2;
int res = 1;
for (i; i * i <= num; i++) {
if (num % i == 0) {
res += i;
res += (num / i);
}
}
return res == num;
}
| ALGO | 0.998387 | 4.416547 |
2bf4e675-ba68-4151-bfd8-e4ae4b704cc3 | zamansabbir/DataStructure | DoublyLinkikedList.cpp | #include<iostream>
struct Node{
int value;
Node *next=NULL, *prev=NULL;
};
Node* createNode(int data){
Node* temp=new Node();
temp->value=data;
return temp;
}
Node* addToList(Node* temp_head, int data){
Node *temp=createNode(data);
if(temp_head==NULL){
temp_head=temp;
}else{
... | ALGO | 0.987373 | 4.73732 |
c56e83db-672a-4f4b-a277-be74294eef6e | zhuanglinsheng/tds | cmp/cmp_avltree.cpp | #include <map>
#include <chrono>
#include <iostream>
#include <tds/avltree.h>
struct avl_pair {
int __key;
int __data;
};
int cmp_pair(const void *pair_1, const void *pair_2)
{
struct avl_pair *p1 = (struct avl_pair *) pair_1;
struct avl_pair *p2 = (struct avl_pair *) pair_2;
if (p1->__key < p2->__key)
retur... | ALGO | 0.972846 | 5.064765 |
e96c3b0f-92a2-4303-a8ce-7c6d2814b1c1 | bfgroup/b2 | src/engine/glob.cpp | /*
* glob.c - match a string against a simple pattern
*
* Understands the following patterns:
*
* * any number of characters
* ? any single character
* [a-z] any single character in the range a-z
* [^a-z] any single character not in the range a-z
* \x match x
*
* External functions:
*
* glob(... | ALGO | 0.966337 | 6.994419 |
6083efdc-bd3e-4770-8e69-8e8b868326a7 | pirroman/brute-force | brute_force/CryptoPP/des.cpp | // des.cpp - modified by Wei Dai from Phil Karn's des.c
// The original code and all modifications are in the public domain.
/*
* This is a major rewrite of my old public domain DES code written
* circa 1987, which in turn borrowed heavily from Jim Gillogly's 1977
* public domain code. I pretty much kept my key sch... | ALGO | 0.999471 | 6.650148 |
9362db87-4dab-476b-a20a-3f0767856065 | ryanzhang15/RJ_HKOI | 05021.cpp | #include <bits/stdc++.h>
#define ef else if
using namespace std;
typedef long double _D;
_D v, a, b, c, t[43];
void notSure();
void onBoard();
void consign();
int main() {
scanf("%Lf%Lf%Lf%Lf", &v, &a, &b, &c);
if(b > c) swap(b, c);
if(a > b) swap(a, b);
if(b > c) swap(b, c);
if(a > 130 || b > 130 || c > 130... | ALGO | 0.997124 | 3.618485 |
09f766c5-fc3c-4944-897d-ae7d67b1c3b9 | Fedi-Hmaidi/Leetcode-solutions | 0938-range-sum-of-bst/0938-range-sum-of-bst.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999997 | 6.612886 |
8c42d5b6-641e-4ec3-96ef-2c3b1a069ce7 | weessantos/IALG | Modularização/Somando com alternancia de sinal e funcao.cpp | #include <iostream>
using namespace std;
int somatorio(int qnt_f, int cont, int soma_f, int sub_f, int aux_f, int total_f, int cont1_f, int cont2_f, int cont3_f) ;
int main() {
int qnt, cont=1, soma, sub, aux=sub, total=0, cont1=0, cont2=0, cont3=0;
cin >> qnt;
while (qnt<=0){
cin >> qnt;
}
total = so... | ALGO | 0.999565 | 3.893682 |
bb95a701-8bd3-40d6-84f1-9a047dbb4315 | azuki-miho/RFCR | KPConv_deform_ScanNet/tf_custom_ops/tf_neighbors/neighbors/neighbors.cpp |
#include "neighbors.h"
void brute_neighbors(vector<PointXYZ>& queries, vector<PointXYZ>& supports, vector<int>& neighbors_indices, float radius, int verbose)
{
// Initiate variables
// ******************
// square radius
float r2 = radius * radius;
// indices
int i0 = 0;
// Counting vector
int max_count =... | ALGO | 0.999329 | 6.370706 |
19520345-70b2-455c-9d44-e05b6bc6f22c | Sfabi28/CPP | module-09/ex01/RPN.cpp | #include "RPN.hpp"
RPN::RPN() : input(""), result(0)
{
//std::cout << "Default constructor called" << std::endl;
}
RPN::RPN(std::string input) : input(input), result(0)
{
//std::cout << "Constructor called" << std::endl;
}
RPN::RPN(const RPN ©)
{
//std::cout << "Copy constructor called" << std::endl;... | ALGO | 0.968837 | 4.301452 |
98742073-4f75-47ba-bd16-197e051f1965 | deserted335/baekjoon_record | 101_IO_practice/9465.cpp | #include <iostream>
#include <memory.h>
using namespace std;
int dp[2][100000] = {0};
int stickers[2][100000] = {0};
int main(){
int T, n, s, tmp;
cin >> T;
while(T--){
cin >> n;
s = 0;
memset(stickers, 0, sizeof(stickers));
memset(dp, 0, sizeof(dp));
for(int i = 0; i < n; i++) cin >> sticker... | ALGO | 0.999972 | 3.56074 |
5f84fab2-8e19-48e9-94ec-1a9c13a96c1b | SnehaKumari3/codeforces_practice_problems | DSA & CP in C++/CodeNCode/String Algos/Rabin_karp.cpp | #include<iostream>
#include<bits/stdc++.h>
#define lli long long int
#define vi vector<int>
#define ii pair<int,int>
#define vii vector<ii>
#define ff first
#define ss second
#define endl '\n'
#define mod (int)1e9+7
using namespace std;
//instead of diving p^L in RHS , we can also multiply it in LHS
//the soln is not... | ALGO | 0.999936 | 4.701949 |
d984c8ea-8d35-40ad-a358-4ef97f421767 | vidit1999/daily_coding_problem | data/dailyCodingProblem788.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Write a program that checks whether an integer is a palindrome.
For example, 121 is a palindrome, as well as 888. 678 is not a
palindrome. Do not convert the integer into a string.
*/
bool checkPalindrome(int number){
number = abs(number);
int divisor = 1;
... | ALGO | 0.999748 | 5.266747 |
c13a0aa6-7b2a-4a3c-8f07-1b0ad87a7410 | rvemuri2/LeetCodeSubmissions | 0058-length-of-last-word/0058-length-of-last-word.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
int siz=s.size(),kount=0,flag=0;
for(int i=siz-1;i>=0;i--){
if(s[i]==' '&&flag)break;
if(s[i]!=' '){
flag=1;
kount++;
}
}
return kount;
}
}; | ALGO | 0.999526 | 5.283336 |
f9eee4ae-2c64-40f1-b9ed-9c7c8cd99aba | vinod-2309/Competitive-Programming | A2OJ Ladder/DIV 2 C/temp.cpp | #include<bits/stdc++.h>
using namespace std ;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<bool>> vvb... | ALGO | 0.999786 | 4.66154 |
3af596ea-42d2-4cdc-afb5-c5983dc3b1c3 | dilipsuthar60/leetcode-solution-2025 | 2564-most-profitable-path-in-a-tree/2564-most-profitable-path-in-a-tree.cpp | class Solution {
public:
int ans=0;
vector<int>dp[200005];
int depth[200005];
int parent[200005];
vector<int>amount;
void find_p(int node,int d=0,int p=-1)
{
parent[node]=p;
for(auto it:dp[node])
{
if(it!=p)
{
find_p(it,d+1,node);
}
... | ALGO | 0.999934 | 4.892246 |
97f97c78-d082-4016-a7af-c977b61430f9 | Srivaths-P/Competitive-Programming | Atcoder/C++ (GCC 9.2.1)/dp_h/20503532.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define INF INT_MAX
#define MOD 1000000007
signed main() {
ios::sync_with_stdio(false); cin.tie(NULL);
int n, m; cin >> n >> m;
char a[n][m];
int dp[n][m];
dp[0][0] = 1;
for (int i = 0; i < n; i++)
... | ALGO | 0.999918 | 4.994036 |
433a4234-e9d7-4c5b-be50-c4590c20835c | Srutarshi-Ghosh/C-and-Cpp-Programs | reverse_no.cpp | #include<iostream>
int rev(int);
int main(){
int no, r;
printf("ENTER A NUMBER ");
scanf("%d", &no);
r=rev(no);
printf("REVERSE OF THE NUMBER IS %d", r);
return 0;
}
int rev(int no){
int r=0;
while(no>10){
r+=no%10;
r=r*10;
no=no/10;
}
r+=no;
return r;
}
| ALGO | 0.999498 | 3.701637 |
4326f25f-e8f6-48ec-b00d-eacb989056fd | MonierAshraf/Data_Structures | Labs/Lab 04 Material/Lab 04/CircularLinkedList.cpp | #include <iostream>
#include <string>
using namespace std;
template <class T>
class Node {
public:
T Data;
Node* next;
Node* prev; // Previous pointer for backward traversal
};
template <class T>
class CircularLinkedList {
public:
Node<T>* head;
CircularLinkedList() {
head = NULL;
}
... | ALGO | 0.999948 | 5.963474 |
0cc1a024-19bc-4a0f-ba51-3c03c4f6d9da | ankitadhikari1/koding | 0230-kth-smallest-element-in-a-bst/0230-kth-smallest-element-in-a-bst.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999988 | 5.30057 |
2fe9d6dc-96f6-42c2-9076-dd684063b40d | zhencang/libigl-Demo-Mac | libigl/include/igl/uniformly_sample_two_manifold.cpp | //////////////////////////////////////////////////////////////////////////////
// Helper functions
//////////////////////////////////////////////////////////////////////////////
IGL_INLINE void igl::uniformly_sample_two_manifold(
const Eigen::MatrixXd & W,
const Eigen::MatrixXi & F,
const int k,
const double p... | ALGO | 0.999556 | 5.74155 |
0fe845b2-72f9-4668-9691-9c9176f4fcd1 | Hiyabye/Baekjoon | 16xxx/16515.cpp | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
long double invFact(int n) {
long double ret = 1.0;
for (int i=1; i<=n; i++) ret /= i;
return ret;
}
void solve(void) {
int n; cin >> n;
long double ans = 0.0;
for (int i=0; i<=n; i++) ans += invFact(i);
cout << fixed << setpr... | ALGO | 0.999737 | 4.078053 |
bd278302-2745-4556-836e-395e61683013 | ovalle98/C | Omega/Gray.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[]) {
uint64_t a,b;
cin>>a;
b = a >> 1;
a= a ^ b;
cout<<a<<endl;
}
| ALGO | 0.999873 | 3.747058 |
ee26db89-6c4a-4289-9b70-700e6418bb65 | einMarius/C----bung | Eigene Wiederholungen/Übung1/PrimeSubtraction.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[]) {
int cases;
cin >> cases;
while(cases--) {
long long x, y;
cin >> x >> y;
if (x-y == 1) {
cout << "NO" << endl;
} else {
cout << "YES" << endl;
}
}
... | ALGO | 0.99988 | 4.943048 |
51a41a05-152e-4667-b433-dbdd99c9e022 | StellaSitinjak/CompetitionCode | Toped/2.cpp | #include <bits/stdc++.h>
using namespace std;
int candles(int a, int b){
int temp = a, stt = a - b;
if(a < b)
return a;
while(stt+1 >= b){
temp++;
stt -= (b-1);
}
return temp+1;
}
int candled(int a, int b){
int temp, cek, stt;
stt = temp = a;
while(stt >= b){
cek = (stt % b);
stt /= b;
temp += ... | ALGO | 0.996995 | 4.276232 |
27242e4a-b675-4e09-ab8a-9432c8596b03 | loppastoffa/c-plus-plus | lab_dict/anagram_dict.cpp | /**
* @file anagram_dict.cpp
* Implementation of the AnagramDict class.
*
* @author Matt Joras
* @date Winter 2013
*/
#include "anagram_dict.h"
#include <algorithm> /* I wonder why this is included... */
#include <fstream>
using std::string;
using std::vector;
using std::ifstream;
/**
* Constructs an Anagra... | TOOL | 0.867039 | 5.983174 |
81e9db20-bab4-4f8d-a1a7-000dd60a475c | remysys/llvm-riscv-backend | llvm-project/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp | // UNSUPPORTED: no-exceptions
// (bug report: https://llvm.org/PR58392)
// Check that vector constructors don't leak memory when an operation inside the constructor throws an exception
#include <type_traits>
#include <vector>
#include "count_new.h"
#include "test_iterators.h"
template <class T>
struct Allocator {
... | TEST | 0.939398 | 6.553296 |
c7709872-0a08-4295-8d02-71421dc66c83 | ljh0608/Algorithm-study | 10819_차이를최대로.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
#define input_max 8 + 1
int a[input_max];
int selected[input_max];
bool visited[input_max];
int result=0;
int n;
int sum;
void calcMax(){
sum=0;
for(int i=0;i<n-1;i++){
sum+= abs(selected[i]-selected[i+1]);
}
res... | ALGO | 0.999585 | 3.905301 |
09a3d68f-f76f-478a-9eb4-195045b09034 | Anik-Modak/CompetitiveProgramming | Codeforces/Dominated Subarray.cf.cpp | //Anik_Modak
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int t;
cin>>t;
while(t--)
{
int n, a;
cin>>n;
map<int, int> mp;
int mx = 1000000;
for(int i=1; i<=n; i++)
{
cin>>a;
if(mp[a])... | ALGO | 0.999429 | 3.864977 |
e330ab7a-e6c6-457a-8acb-76e99ad30d42 | 12srishti12/DSApractice | assignment4/reverse_integer.cpp | class Solution {
public:
int reverse(int x) {
int rn=0;
int max=INT_MAX/10;
int min=INT_MIN/10;
while(abs(x)>0){
if(rn>max || rn<min) return 0;
rn=rn*10+x%10;
x=x/10;
}
return rn;
}
};
| ALGO | 0.999924 | 5.821551 |
a24dddc2-9594-4c52-976f-25b945443006 | s106030605/NERDSS_on_DNA_colloid | Nerdss_initial_configuration/src/boundary_conditions/reflect_traj_complex_rad_rot_nocheck.cpp | #include "boundary_conditions/reflect_functions.hpp"
#include "math/matrix.hpp"
void reflect_traj_complex_rad_rot_nocheck(const Parameters& params, Complex& targCom, std::vector<Molecule>& moleculeList, const Membrane& membraneObject, double RS3Dinput)
{
if (membraneObject.isSphere == true)
reflect_traj_co... | ALGO | 0.990872 | 5.93125 |
1118a8c5-4a71-4022-b840-cad15a506fe5 | Cretus-iosDev/Practice-Question | Practice-Question/sherlockSquares.cpp | #include <bits/stdc++.h>
using namespace std;
int squares(int a, int b) {
int count = 0;
for (int i = sqrt(a); i * i <= b; i++) {
if (i * i >= a && i * i <= b) {
count++;
}
}
return count;
}
int main() {
int t;
cin >> t;
while (t--) {
int a, b;
cin >> a >> b;
cout << squares(a, b) << endl;
}
return 0;
}
| ALGO | 0.999563 | 5.266071 |
8ecb9af8-3bff-4246-adf2-8f6981577155 | liuxueyang/cpp | leetcode/problemset/2787.cpp | // Date: Sun Oct 27 16:03:18 2024
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <array>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include ... | ALGO | 0.999972 | 5.354314 |
042c78f4-36bc-46e5-8c76-7df40b77c0b5 | filipmazev/ReFactor | aqi-estimator.libraries/ImageProcessingPipeline/src/windows/ImageProcessingPipeline/imagepipeline.cpp | // <summary>
// output_folder | The output folder where the processed images will be saved.
// pixel_lower_bound | Pixel lower bound is the minimum pixel value that will be considered in the image processing.
// histogram_size | Histogram size is the number of bins in the histogram.
// histogram_range | Histogram range... | DATA | 0.990161 | 5.603889 |
75fcfba9-ae5a-4002-a07a-600730a74ba3 | lkx100/Data_Structures_Algorithms | Strings/sortingSentence.cpp | #include <bits/stdc++.h>
using namespace std;
string sortSentence (string s){
string temp;
vector<string> ans(10);
int count = 0, index = 0, position;
while ( index < s.size() ){
if ( s[index] == ' ' ){
position = temp[temp.size()-1] - '0'; // to store the last number of that strin... | ALGO | 0.999553 | 5.754461 |
59180155-f027-4c4e-abac-f3fe61de1354 | NeetuBinoriya/C-Practice | Fibonacci.cpp | #include <iostream>
using namespace std;
int main(){
int n1 = 0, n2 = 1, n3, num;
cout<<"Enter a number upto which you want to print series:\n";
cin>>num;
cout<<n1<<" "<<n2;
for (int i = 1; i <= num; i++)
{
n3 = n1 + n2;
n1 = n2;
n2 = n3;
cout<< " "<<... | ALGO | 0.999934 | 3.538081 |
67d26e05-1178-4a64-8e48-9e3ad7439d53 | Manishak798/DSA-Cpp | Matrix_Questions/matrixmultiplication.cpp | /**
* @file matrixmultiplication.cpp
* @author your name (<EMAIL>)
* @brief
* @version 0.1
* @date 2024-03-09
*
* @copyright Copyright (c) 2024
* Write a program in C for the multiplication of two square matrices.
Test Data :
Input the rows and columns of first matrix : 2 2
Input the rows and columns of second... | ALGO | 0.999404 | 4.858775 |
2c854bee-4d0f-4381-b184-ee0d36371496 | bfay1/codeforces | contests/885/vika-and-her-friends.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
signed main()
{
int t;
cin >> t;
auto dist = [] (const int& a, const int& b, const int& c, const int& d) {
return abs(a - c) + abs(b - d);
};
while (t--) {
int n, m, k;
cin >> n >> m >> k;
int x, y;... | ALGO | 0.999883 | 4.187784 |
1afac0e0-7d97-4d8e-8b70-88c9221bb266 | ishandutta2007/codeforces | potassium/normal/1409/B.cpp | #pragma GCC optimize ("O3", "unroll-loops")
//#pragma GCC target ("avx2")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define all(x) (x... | ALGO | 0.999848 | 4.070522 |
bde892b6-775e-464f-a0c4-5d0631618693 | Rajeshnds/Competitive-Programming | codeforces/dragonmas/codeforces(c++)_old/Dasha_and_stairs.cpp | #include<bits/stdc++.h>
using namespace std;
int a,b;
main(){
cin>>a>>b;
cout<<(abs(a-b)>1||a+b==0?"NO":"YES");
}
| ALGO | 0.999827 | 3.336918 |
f075b908-e10d-45db-9a3b-4155c2821142 | rahularya50/ioi_prep | noi_past_papers/2014/ticket_purchase.cpp | #include <bits/stdc++.h>
using namespace std;
struct edge {
int dest;
int len;
};
int main() {
int N, T;
cin >> N >> T;
vector<int> parent(N, -1);
vector<int> parent_lens(N, 0);
vector<int> p(N, -1);
vector<int> q(N, -1);
vector<vector<edge>> children;
for (int i = 1; i != N; ... | ALGO | 0.999805 | 4.049786 |
ae09c45b-4c59-4233-921a-8f9f84c0910e | MuchomorGrabarz/SortsOnCuda | Bitonicsort/bitonic.cpp | #include <stdio.h>
#include <stdlib.h>
#include "bitonic.h"
#include "cuda.h"
#define PROCESSORS 8
#define min(a,b) (a<b?a:b)
using namespace std;
int * bitonic(int * tab, int n) {
//Powiedzmy sobie szczerze - tego do wykrzykników nie ma co ruszać
cuInit(0);
CUdevice cuDevice;
CUresult res = cuDeviceGet(&cu... | ALGO | 0.999955 | 3.783557 |
7d2ddf24-f397-4205-8f68-04fc8e370c57 | wyfish/opencv_study | samples/cpp/digits.cpp | #include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/ml.hpp"
#include <algorithm>
#include <iostream>
#include <vector>
using namespace cv;
using namespace std;
const int SZ = 20; // size of each digit is SZ x SZ
const int CLASS... | ALGO | 0.961152 | 6.470495 |
fa7e41d9-7d7c-4ef1-84cb-9ff3bd7f7c79 | satellitex/acpc2016 | rollman2/kawabys/kawabys.cpp | #include<bits/stdc++.h>
using namespace std;
int c[51][51],m,n,o,p,x,y,z,an;
int main(){
cin>>m>>n>>o>>p;
for(int i=0;i<p;i++)cin>>x>>y>>z,c[x][y]++;
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)cin>>x,an+=c[j][i]*x;
cout<<an<<endl;
return 0;
}
| ALGO | 0.999776 | 3.216487 |
f56a4b67-865f-4e7c-8c6c-3e3500f9c0e1 | RameshtaVishwakarma/Data-Structures-and-Algorithms | Array Manipulation/Subarray Problems/Subarray with given sum(negative Integers).cpp | /*Given an unsorted array of integers, find the number of subarrays having sum exactly equal to a given number k.
Examples:
Input : arr[] = {10, 2, -2, -20, 10},
k = -10
Output : 3
Subarrays: arr[0...3], arr[1...4], arr[3..4]
have sum exactly equal to -10. */
#include<bits/stdc++.h>
using namespace std;
//Ap... | ALGO | 0.999909 | 5.752924 |
7e88c2a7-2bb1-4bea-a53c-c788a974515d | arafat-yasin-2413/COURSE-2-C_Plus_Plus | Mod 7/1_array_of_obj.cpp | #include <bits/stdc++.h>
using namespace std;
class Student
{
public:
string name;
int roll;
int marks;
};
int main()
{
Student a[3];
for(int i =0;i<3;i++)
{
getline(cin,a[i].name);
cin>>a[i].roll>>a[i].marks;
cin.ignore();
}
for(int i =0;i<3;i++)
... | ALGO | 0.928246 | 3.570553 |
c74c3f19-823f-4f22-b610-479eab530886 | ranjit534/GFG_POTD | 11-03-23_6.cpp | class Solution
{ // Question - Yet another query problem
public:
vector<int> solveQueries(int N, int num, vector<int> &A, vector<vector<int>> &Q)
{
unordered_map<int, int> m;
vector<int> act(N, 0);
for (auto t : A)
{
m[t]++;
}
for (int i = 0; i < N; i+... | ALGO | 0.999677 | 5.2719 |
4c209b75-72b9-43f5-ab72-71d512524deb | katepangLiu/leetcode-cn-daily | 1024.视频拼接/1024-视频拼接.cpp | class Solution {
public:
int videoStitching(vector<vector<int>>& clips, int T) {
vector<int> dp(T + 1, INT_MAX - 1);
dp[0] = 0;
for (int i = 1; i <= T; i++) {
for (auto& it : clips) {
if (it[0] < i && i <= it[1]) {
dp[i] = min(dp[i], dp[it[0]] ... | ALGO | 0.999975 | 6.393929 |
2844f867-4239-488b-a4d2-bf930a426416 | Hanbeom-Park/COUNTER-TEST-FINDER | judge/mwt/temp/src/088665dc15c8405cbb19b21bb2ef313f.cpp |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
int q;
cin >> q;
while (q--) {
cin >> a >> b;
cout << a + b << endl;
}
return 0;
}
| ALGO | 0.997799 | 5.187575 |
680ea5c5-fd1a-4460-b93c-441dbad0c87f | AKANKSHAWAGASKAR/Logic-Building2 | Program219.cpp | #include<iostream>
using namespace std;
#pragma pack(1)
struct node
{
int data;
struct node *next;
};
typedef struct node NODE;
typedef struct node * PNODE;
typedef struct node ** PPNODE;
class SinglyLL
{
public:
// Characteristics
PNODE First;
int iCount;
// Behaviours
... | ALGO | 0.998936 | 5.333515 |
47814035-fc8e-4e9e-a29d-d4445f949c91 | jainisuni/MyContest | maxRewardBlock.cpp |
#include <iostream>
#include <vector>
#include <map>
#include <ctime>
#include <algorithm>
int lastIndex=0;
using namespace std;
class Transaction
{
public:
int id;
long sizebytes;
double fee;
};
class Block
{
int index;
vector<Transaction> tr;
double reward;
size_t blockHash;
... | ALGO | 0.997038 | 5.079247 |
50a89bf0-f2a3-424a-bd95-29d38ed0ab47 | ayoubmajid67/Basic-roadmap | 05 - Algorithms & Problem-Solving Level 2/CODE/problem17.cpp | #include <iostream>
#include <cctype>
#include <string>
using namespace std;
enum enPasswordChecker
{
NotFount,
Found
};
string ReadString(string UserText)
{
string str = "";
do
{
cout << UserText;
cin >> str;
} while (str.length() > 3 || (isdigit(str[0]) || isdigit(str[1]) |... | TOOL | 0.978154 | 3.653719 |
fce4845f-0243-4064-a6bd-c8dc1d855d78 | whquddn55/Algorithm_BojSolves | 3000/3038.cpp | #include <bits/stdc++.h>
#include <cassert>
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>
... | ALGO | 0.999967 | 3.545744 |
e4c5d829-c783-4b5f-afb1-27a7947f8c0d | LincolnMatheus97/ADS-IFPI | Exercicios_ED_I/Bee/1048_basico.cpp | #include <stdio.h>
#include <iostream>
#include <string.h>
using namespace std;
main() {
double salario;
cin >> salario;
string percentual;
double reajuste = 0.0;
if (salario >= 0.0 && salario <= 400.0) {
reajuste = (salario * 0.15);
percentual = "15 %";
} else if (salario > 4... | ALGO | 0.989169 | 3.968968 |
0707196d-0492-43e9-a03a-3ffc8fc2b0ef | v-nekrasov/2kurs | list1.cpp | #include"list.h"
//_____________________Node
List::Node::Node(){ //используем для построения выделенного элемента, в нем данные не хранятся
this->v=T();
}
List::Node::Node(const T &v){//строит узел и загружает данные на хранение
this->v=T(v);
}
//_________________________ List основные методы
List::List(){//создает ... | ALGO | 0.977148 | 3.94948 |
58f4a685-b700-4c75-9b92-b4bce54bf130 | njusegzyf/AtgProjs | CallCPP-CLFF/1-10/source/pythag.cpp | #include <cmath>
#include "nr.h"
using namespace std;
DP pythag(const DP a, const DP b) {
DP absa, absb, result;
absa = fabs(a);
absb = fabs(b);
if (absa > absb)
result = absa * sqrt(1.0 + SQR(absb / absa));
else
result = (absb == 0.0 ? 0.0 : absb * sqrt(1.0 + SQR(absa / absb)));
return result;
}
| ALGO | 0.989387 | 3.83696 |
9f216ea2-2125-4736-9b63-f9b9becccc02 | SrinivasuluCharupally/leetcode_questions_answers | 173_binary-search-tree-iterator.cpp | // 7
// 3 15
// 9 20
//
#include <bits/stdc++.h>
using namespace std;
class TreeNode{
public:
int val;
TreeNode *left, *right;
TreeNode(int data){
val = data;
left = right = NULL;
}
};
void insert(TreeNode **root, int val){
queue<TreeNode*> q;
q.pu... | ALGO | 0.999993 | 4.04227 |
b558aa89-fe3a-46c2-8e8a-a249ba969d00 | vbonnici/grafe-sim | analysis/data/p02240/s913196895.cpp | # include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { re... | ALGO | 0.999975 | 4.92205 |
b642d418-3b6f-4230-b9b8-dbc079f69a6e | pgrones/advent-of-code-2024 | day03/main.cpp | #include <regex>
#include "../lib/lib.h"
using namespace std;
int calculateResult(string const memory) {
regex const pattern{R"~(mul\(\d{1,3},\d{1,3}\))~"};
auto mul_begin = sregex_iterator(memory.begin(), memory.end(), pattern);
auto mul_end = sregex_iterator();
int result = 0;
for (sregex_it... | ALGO | 0.993178 | 5.405719 |
c70833a7-6740-4026-8eb5-8fd6bb62be67 | Shubham2376/Assignment_BTech2026_2201920130181 | PROBLEM-7.cpp | #include<bits/stdc++.h>
using namespace std;
// Define the Workshop structure
struct Workshop {
int start_time;
int duration;
int end_time;
Workshop(int start, int dur) {
start_time = start;
duration = dur;
end_time = start + dur;
}
};
// Define the Available_Workshops stru... | ALGO | 0.999798 | 6.055471 |
0a926a1e-4525-4a87-b752-4ebe5a0f7ffa | Andlpiha/ChessEngine | src/MoveEvaluation/src/search.cpp | #include "../headers/search.h"
#include "../headers/eval.h"
#include "MoveGeneration.h"
#include "MovgenTypes.h"
#include <cassert>
#include <cmath>
#include <cstdint>
#include <vector>
#include <ostream>
#include <fstream>
#include <algorithm>
#define fuzzy_equal(val1, val2) std::abs(val1 - val2) < 0.01
static Trans... | ALGO | 0.999384 | 6.047036 |
c0838723-e74e-473d-a574-10eb65aef39d | quokka-astro/quokka | src/problems/NSCBC/channel.cpp | #include "AMReX.H"
#include "AMReX_Array.H"
#include "AMReX_BC_TYPES.H"
#include "AMReX_BLProfiler.H"
#include "AMReX_BLassert.H"
#include "AMReX_FabArray.H"
#include "AMReX_Geometry.H"
#include "AMReX_GpuDevice.H"
#include "AMReX_IntVect.H"
#include "AMReX_MultiFab.H"
#include "AMReX_ParallelContext.H"
#include "AMReX... | ALGO | 0.975398 | 6.042178 |
5d8c03a2-cf24-485c-99e7-fb28bf347e71 | the0cp/leetcode | src/2140.Solving-Questions-With-Brainpower.cpp | class Solution {
public:
long long mostPoints(vector<vector<int>>& questions) {
int n = questions.size();
vector<long long> dp(n + 1);
for(int i = n-1; i >= 0; i--){
dp[i] = max(dp[i+1], questions[i][0] + dp[min(n, i + questions[i][1] + 1)]);
}
return dp[0];
}... | ALGO | 0.999801 | 5.962081 |
4df5bf5e-d755-4518-84be-8966a5f9f2db | wash-dsl/wash | src/examples/sedov_solution/main.cpp | /**
* @file main.cpp
* @author Jose A. Escartin <<EMAIL>>
* @brief This file is based on the analytical solution presented in SPH-EXA <https://github.com/unibas-dmi-hpc/SPH-EXA>
* @date 2023-11-28
*
* This program generates the analytical sedov solution based in the time and the initial conditions
*/
#include "s... | ALGO | 0.998812 | 5.559305 |
569f9d50-92e2-46ec-8d6c-b83387cca731 | ThoseBygones/ACM_Code | CodeForces/CodeForces 17A.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#define MAXN 1005
using namespace std;
bool isPrime(int x)
{
for(int i=2; i<=sqrt(x); i++)
{
if(x%i==0)
return false;
}
return true;
}
int main()
{
int prime[MAXN],noldbach[MAXN];
int ai=1,bi=0;
prime[0]=2;
f... | ALGO | 0.999904 | 4.099558 |
a6a583e0-3ec8-4246-842b-220430a9e56e | ganeshpawar09/Data-Structures-and-Algorithms | 7_Stack/8_SortStack.cpp | #include<iostream>
#include<stack>
using namespace std;
void solve(stack<int> &a, int x)
{
if(a.empty())
{
a.push(x);
return;
}
int temp=a.top();
if(temp>x)
{
a.pop();
solve(a,x);
a.push(temp);
}
else
{
a.push(x);
}
}
void so... | ALGO | 0.999956 | 4.258875 |
84657df2-521f-4f9d-9002-e7574cca5bf9 | glassechidna/zxing-cpp | core/src/zxing/qrcode/detector/FinderPatternFinder.cpp | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
#include <algorithm>
#include <zxing/qrcode/detector/FinderPatternFinder.h>
#include <zxing/ReaderException.h>
#include <zxing/DecodeHints.h>
using std::sort;
using std::max;
using std::abs;
using std::vector;
using zxing::Ref;
using zxing::qrco... | ALGO | 0.999715 | 3.01216 |
617d13d9-44e3-4862-a977-58735ce255db | katevi/Spbu-homeworks | sem1/hw2/Hw2t3.cpp | #include <iostream>
int gcd(int a, int b)
{
while (a != b)
{
if (a > b)
{
int tmp = a;
a = b;
b = tmp;
}
b = b - a;
}
return a;
}
int findingCommonDenominator(int number)
{
int result = 1;
for (int i = 2; i <= number; i++)
result = result * i;
return result;
}
int sort(int numbers[], int le... | ALGO | 0.999644 | 4.410192 |
5f98d959-8ce2-45e5-bc65-57136313769c | s9v/toypuct | Topcoder/SRMs/SRM-599-II/950.cpp | # include <iostream>
# include <fstream>
# include <sstream>
# include <algorithm>
# include <functional> // greater<int>()
# include <vector>
# include <string>
# include <queue>
# include <stack>
# include <list>
# include <map>
# include <set>
# include <cstdio>
# include <cstdlib>
# include <cmath>
# include <ctime... | ALGO | 0.999825 | 4.68393 |
571cf7c9-ad1b-48db-bac3-c952fb34e918 | ehab-abdelhamid/AnalysisLibrary | libs/ann_1.1.2/src/perf.cpp | #include <ANN/ANN.h> // basic ANN includes
#include <ANN/ANNperf.h> // performance includes
using namespace std; // make std:: available
//----------------------------------------------------------------------
// Performance statistics
// The following data and routines are used for computing
// performa... | ALGO | 0.956115 | 5.822011 |
69fe42ac-3916-487b-a8cd-ca648d9b1387 | chrispduck/advent-of-code | 2024/day3/main.cpp | #include <iostream>
#include <vector>
#include <sstream>
#include <fstream>
#include <regex>
int main(){
auto fpath = "./input.txt";
auto file = std::fstream(fpath);
std::cout << "parsing inputs " << std::endl;
std::stringstream buffer;
buffer << file.rdbuf();
std::string text = buffer.str... | ALGO | 0.994199 | 4.866481 |
80eb1a4f-1f79-40bf-a9e4-9aa10faedba4 | Nashar-Ahmed/UVA-Problems | Parking 11364/Parking 11364.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int tst;
cin>>tst;
while(tst--)
{
int n,a[30];
long long ans;
int mx=0,mn=1000;
cin>>n;
for(int i=0; i<n; i++)
cin>>a[i];
for(int i=0; i<n; i++)
{
if(a[i]>mx)
... | ALGO | 0.999648 | 4.149817 |
bb38a1b5-01b5-41f0-926f-1089482984b9 | Oseias-Augusto/Repositorio-de-Atividades-de-Porg | T1BRAPROG_Oséias_Augusto/Atv - 2.cpp | /*Pedro comprou um saco de rao com peso em quilos.
Ele possui dois gatos, para os quais fornece a quantidade de rao em gramas.
A quantidade diria de rao fornecida para cada gato sempre a mesma. Faa um programa que receba o peso do saco de rao e a quantidade de rao fornecida para cada gato,
calcule e mostre quanto r... | ALGO | 0.999388 | 3.112934 |
c2a795e9-8114-450d-9bf4-7e6d8800739a | singalhimanshu/CB-Algo-Course | Graphs/graphAdjListInt.cpp | #include<bits/stdc++.h>
using namespace std;
#define SQ(a) (a)*(a)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define ll long long int
typedef vector<ll> vi;
typedef pair<ll, ll> pi;
class Graph
{
int n;
vector<int> *lst;
public:
Graph(int v)
{
n = v;
... | ALGO | 0.999693 | 4.325345 |
3c0d8ab3-fb7f-406f-8c30-45729d2d9136 | ashutoshtewari99/striver_sde_sheet | PreInPostorderInSingleTraversal.cpp | /************************************************************
Following is the Binary Tree node structure:
class BinaryTreeNode
{
public :
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this -> data = data;
l... | ALGO | 0.999997 | 6.213815 |
7ef87a82-be74-4cd2-ac40-05566cdb37d0 | facebookincubator/spectrum | cpp/spectrum/core/decisions/MetadataDecision.cpp | #include "MetadataDecision.h"
namespace facebook {
namespace spectrum {
namespace core {
namespace decisions {
image::Metadata calculateOutputMetadata(
const image::Specification& inputImageSpecification,
const folly::Optional<image::Metadata>& extraMetadata,
const image::Orientation& metadataOrientation,... | TOOL | 0.872356 | 6.963604 |
d0a215e6-918e-4454-ad66-161ddaa97d75 | Malibushko/MiniCraft | game/systems/terrain/NoiseTerrainGenerator.cpp | #include "NoiseTerrainGenerator.h"
#include <unordered_map>
#include "game/components/terrain/ChunkComponent.h"
#include "game/utils/NumericUtils.h"
static constexpr float LOWER_GENERATION_BOUND = 0.f;
static constexpr float UPPER_GENERATION_BOUND = LOWER_GENERATION_BOUND + 65.f;
static constexpr float WATER_LEVEl ... | TOOL | 0.936145 | 6.578729 |
23b90b53-454f-4a33-ac11-9f20e68a39e3 | TheKobiThirdParty/Eigen3 | failtest/colpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.978846 | 3.159166 |
77766869-756f-40da-bc1d-42b8eb04b1ab | zhangxiaohu057/SensorsCalibration | online_calib/radar2carcenter/eigen3/doc/examples/Tutorial_ArrayClass_mult.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(2,2);
ArrayXXf b(2,2);
a << 1,2,
3,4;
b << 5,6,
7,8;
cout << "a * b = " << endl << a * b << endl;
}
| ALGO | 0.995865 | 3.527115 |
36bfcc47-6cf9-443a-9726-412fdb1f22ec | QuICC/EPMDynamoCode | src/Equations/Parameters/EPmParameters.cpp | /** \file EPmParameters.cpp
* \brief Source of the implementation of the equation non dimensional parameters
*/
// System includes
//
// External includes
//
// Class include
//
#include "Equations/Parameters/EPmParameters.hpp"
// Project includes
//
namespace EPMDynamo {
const std::string EPmParameters::id... | ALGO | 0.957542 | 4.813337 |
ff9a5c2d-8262-4cfd-a29e-fa4c4fd34547 | abdusss111/pp1-fall | l08/j.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
vector <int> v;
int n, x, mx=-9999, mn;
cin >> n;
for ( int i=0; i<n; i++ ){
cin >> x;
v.push_back(x);
}
sort( v.begin(), v.end() );
mn=v[0];
mx=v[n-1];
cout << mx-mn;
return 0;
} | ALGO | 0.999941 | 4.261941 |
37599dbb-5d0a-4f98-b8e6-f9e41cc7155f | GREED-ED/Academic | CSIT/2nd sem/Discrete/10.TOH.cpp | //to display the moves in Tower of Hanoi problem for user input no of disk.
#include <iostream>
using namespace std;
void towerOfHanoi(int n, char source, char auxiliary, char destination) // Function to solve Tower of Hanoi for 'n' disks
{
if (n == 1)
{
cout << "Move disk 1 from " << source << " to " ... | ALGO | 0.999688 | 6.189428 |
34c96266-60d6-4313-8c06-5334b049113e | shyamal2411/DSA-Practice | leetcodePractice/contests/302/2341MaxPairsOfArr.cpp | #include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<string> vst;
class Solution {
public:
vector<int> numberOfPairs(vector<int>& nums) {
unordered_map<int,int> mp;
vector<int> ans;
int ans1=0,ans2=0;
for(auto i:nums)
mp[i]++;
... | ALGO | 0.999768 | 4.489902 |
0a7518cd-4aaf-4616-a1a6-5dc3c1282841 | NarenderSD/Flutter_Dev | untitled2/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.998296 | 6.761023 |
6c4b8bc6-d767-4375-9488-0e7a935be7db | tactop/AtCoder | ABC/abc124/abc124-b.cpp | #include <iostream>
#include <algorithm>
#include <string>
#define rep(i, x, n) for (int i = x; i < n; i++)
using namespace std;
int main()
{
string S;
cin >> S;
int H[100010];
int N = S.length();
int ki=0;
int gu=0;
rep(i, 0, N)
{
if (S[i] == '1')
{
if(i%2==0... | ALGO | 0.999915 | 4.108907 |
277f95d1-7cfe-42a1-beee-87a5469ed891 | hymsly/CompetitiveProgramming | rodo/grafo2/king.cpp | #include<bits/stdc++.h>
#define fore(i,a,b) for(int i=a,to=b;i<to;++i)
#define fst first
#define snd second
using namespace std;
typedef long long ll;
const ll INF = (1e18);
const int MAXN = 100;
int n,m;
vector<pair<int,ll> > g[MAXN+5]; // u->[(v,cost)]
ll dist[MAXN+5];
bool bford(int src){ // O(nm)
fill(dist,dist+n,... | ALGO | 0.999593 | 3.955071 |
2475efd1-0c07-4454-ad6b-6fae538b5e8e | suchiz/SplineDrawer | src/tensorproduct.cpp | #include "../lib/tensorproduct.h"
TensorProduct::TensorProduct(std::vector<Point> controlPoints, std::pair<int, int> size, KVType knotVectType, int order){
this->order = order;
this->size = size;
this->controlPointsVect = controlPoints;
this->knotVectType = knotVectType;
checkParameters();
}
std::pair<std::vecto... | ALGO | 0.976322 | 5.155473 |
8f3ed5fd-f85c-49c5-8c38-9790979ea7ea | hy00nc/AlgorithmStudy | Session 1/gaonK/4/11005.cpp | #include <iostream>
#include <stack>
using namespace std;
int main() {
stack<int> s;
long long N;
int B;
cin >> N >> B;
while (N) {
s.push(N % B);
N /= B;
}
while (!s.empty()) {
int x = s.top();
s.pop();
if (10 <= x && x <= 36) {
cout <... | ALGO | 0.999831 | 4.61355 |
0304a28f-167e-4058-9b39-7c04c03c63d8 | dikshantkanela/DS-Algo | BINARY SEARCH/sqx.cpp | #include <bits/stdc++.h>
using namespace std;
int mySqrt(int x) {
int start = 0, end = x;
int ans = -1;
long long mid = start + (end - start) / 2; // Avoid overflow
while (start <= end) {
long long sq = mid * mid;
if (sq > x) {
end = mid - 1;
}
el... | ALGO | 0.99911 | 5.082898 |
d891db1f-6bf8-4612-8416-2a985c745d05 | tuannguyenTDT/TestTTC | CAU TRUC LAP/bai 7.30.cpp | #include<string.h>
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{struct {int a,b;}sv;printf("chieu dai = ");scanf("%d",&sv.a);
printf("chieu rong = ");scanf("%d",&sv.b);
printf("dien tich = %d",sv.a*sv.b);
printf("\nchu vi = %d",(sv.a+sv.b)*2);
getch();}
| ALGO | 0.995543 | 3.039875 |
31e31d33-8735-4bd7-a303-6592ec88b9dd | mjwybrow/adaptagrams | cola/libdialect/tests/nearalign02.cpp | #include <vector>
#include <iostream>
#include "libvpsc/assertions.h"
#include "libdialect/commontypes.h"
#include "libdialect/io.h"
#include "libdialect/util.h"
#include "libdialect/graphs.h"
#include "libdialect/opts.h"
#include "libdialect/nearalign.h"
using namespace dialect;
using std::vector;
using std::cout;... | ALGO | 0.938231 | 5.322142 |
201c0165-566b-4cdb-802f-2b06cbce9c7c | lsrosa/myLegUp | 4.0/llvm-2.9_mips/lib/CodeGen/ShrinkWrapping.cpp | #define DEBUG_TYPE "shrink-wrap"
#include "PrologEpilogInserter.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"... | ALGO | 0.900835 | 3.53125 |
82b30a52-69c4-4570-902b-3968d05ad238 | jvafonso/Computa-o-Cientifica-e-Otimiza-o | Algoritimos_Zero_func/Falsa_posic/main.cpp | #include <iostream>
#include <math.h>
using namespace std;
float media_pond(float a, float fa, float b, float fb){
return (((a*fb) - (b*fa)) / (fb - fa));
}
float calculo_fun(float z){
return (pow(z,3) - z - 1);
}
int main()
{
float limite1;
float limite2;
float tolerancia;
float result;
... | ALGO | 0.999971 | 4.40615 |
db35b20d-9db4-4972-a56e-09bc6f3869ad | snehhens/control-statements | OddEvenModulo.cpp | #include <iostream>
// using namespace std;
int main() {
// Number is even or odd using modulo
int number;
std::cout << "Enter an integer: ";
std::cin >> number;
if (number % 2 == 0) {
std::cout << "The number is even." << std::endl;
} else {
std::cout << "The number is odd.... | ALGO | 0.957352 | 5.10896 |
f713698d-9060-4174-92c3-67ca69a9ebf8 | Mohaiminul69/problem-solving | week_9/day_4/concert_tickets.cpp | // https://cses.fi/problemset/task/1091
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m, x;
cin >> n >> m;
multiset<int> mSet;
for (int i = 0; i < n; i++)
cin >> x, mSet.insert(x);
for (int i = 0; i < m; i++)
{
cin >> x;
auto it = mSet.upper_bound(... | ALGO | 0.999975 | 4.058358 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.