uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
642d1236-a063-4fda-84b8-b2ebd4705cad | HAN-man-gyun/backjoon | 프로그래머스/lv0/120906. 자릿수 더하기/자릿수 더하기.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int n) {
int answer = 0;
while(n>10)
{
answer+=n%10;
n=n/10;
}
if(n==10)
answer +=1;
else
answer+=n;
return answer;
} | ALGO | 0.999827 | 5.173014 |
3457cdf4-318e-44f8-9a71-9ce0074ca2dd | RandomAmbersky/AmberSkyNet | src/asnPhysicManager/lib/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp | #include "btSphereTriangleCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "SphereTriangleDetector.h"
btSphereTriangleCollisionAlgorithm::btSphe... | ALGO | 0.998089 | 6.735548 |
43c23eff-28e9-43ed-94ef-a3c896b0fd64 | princebansal7/DSA-Sheets-Code | Basic-Concepts/Recursion/10.SumOfNum.cpp | /*
@author: princebansal_
*/
// TC: theta(N+1), SC: theta(N+1), where N is number of digits in number
#include <iostream>
using namespace std;
#define nl '\n'
#define ll long long
int sumOfDigits1(int n)
{
if (n == 0) {
return 0;
}
int lastDigit = n % 10;
return sumOfDigits1(n / 10) + la... | ALGO | 0.999886 | 5.280222 |
f8578731-7805-4f9b-8b21-20106406d75d | Soggy-Pancake/CIS218-Cpp | Assignments/Ch5Hw1/main.cpp | /* Min Max
Write a program with a loop that lets the user enter a series of integers, followed by the end sentinel
−99 to signal the end of the series. After all the numbers have been entered,
the program should display the largest and smallest numbers entered.*/
#include <iostream>
#include <string>
using namespace... | ALGO | 0.986837 | 4.264059 |
c244f3a4-31c0-4c59-8828-d96ad985e9af | nihar021/leetcode | 1669-minimum-cost-to-cut-a-stick/1669-minimum-cost-to-cut-a-stick.cpp | class Solution {
public:
int minCost(int n, vector<int>& cuts) {
cuts.push_back(n);
cuts.insert(cuts.begin(), 0);
sort(cuts.begin(), cuts.end());
int c = cuts.size() - 2; // Number of cuts excluding 0 and n
// Create a DP table to store calculated values.
vector<vec... | ALGO | 0.999922 | 6.297382 |
31b611cf-aa63-46bf-828d-d31d651790fa | malvasan/ejerecicios | multiplicacion.cpp | #include <iostream>
/*
using namespace std;
void multiplicacion(int arreglo1[][10], int arreglo2[][10],int fi1,int fi2,int col1,int col2)
{
if(col1!=fi2)
return
;
int arreglo3[fi1][col2];
for(int j=0;j<fi1;++j){
for(int i=0;i<col2;i++)
arreglo3[j][i]=0;
}
int i,j... | ALGO | 0.993349 | 3.443948 |
d625876d-d884-473a-98f2-7934b47ceeb8 | pochih-code/NYCU_113-2_DSOOP_Lab | Lab8/q2.cpp | #include <iostream>
using namespace std;
class Nodes {
public:
int data;
Nodes* left;
Nodes* right;
Nodes(int data) {
this->data = data;
left = nullptr;
right = nullptr;
}
};
class binary_tree {
public:
Nodes* root;
binary_tree() {
root = nullptr;
}
... | ALGO | 0.999698 | 5.928725 |
ff7cb18a-753d-4bf8-9180-daf2dc11d503 | zhongmicai/GWASwithoutGenome | src/associate_snps.cpp | ///
/// @file associate_snps.cpp
/// @brief Associate snps with phenotypes and output the best n snps to check with a
// non approximated method
///
/// @author Yoav Voichek (YV), <EMAIL>
///
/// @internal
/// Created 11/20/18
/// Compiler gcc/g++
/// Company Max Planck Institute for Develop... | DATA | 0.961606 | 5.912105 |
b4d6f464-7691-409b-9802-e53b6b013b65 | Geek-prince7/DSA-Dynamic-Programming | GetMaxINGeneratedArray.cpp | #include<iostream>
using namespace std;
int getMaximumGenerated(int n)
{
int* ans=new int[n+1];
ans[0]=0;
ans[1]=1;
int max=1;
//ans[2]=1;
for(int i=2;i<=n;i++)
{
if(i/2==i-i/2)
{
ans[i]=ans[i/2];
}
else
{
ans[i]=ans[i/2]+ans[i-... | ALGO | 0.999987 | 5.138821 |
6b20d4d2-b267-4c37-85ba-89b577221c29 | iamarghamallick/LeetCode-Solutions | 0209-35-3342-find-minimum-time-to-reach-last-room-ii/0209-35-3342-find-minimum-time-to-reach-last-room-ii.cpp | class State {
public:
int x;
int y;
int dis;
State(int x, int y, int dis) : x(x), y(y), dis(dis) {}
};
class Solution {
public:
const int inf = 0x3f3f3f3f;
int minTimeToReach(vector<vector<int>>& moveTime) {
int n = moveTime.size(), m = moveTime[0].size();
vector<vector<int>> d(n... | ALGO | 0.999988 | 5.841922 |
ca54b230-069b-43d8-bd6d-cf7ef4bc09e8 | BenQuickDeNN/LeetCodeSolutions | 有效的括号.cpp | #include <string>
#include <stack>
using namespace std;
class Solution {
public:
bool isValid(string s) {
stack<char> stk;
for (size_t i = 0; i < s.size(); i++)
{
char c = s[i];
if (c == '{' || c == '[' || c == '(')
stk.push(c);
else
... | ALGO | 0.99987 | 6.184981 |
cf594d10-1e7c-4d7c-9cb3-69bd5066aa36 | ShaikMunafSharif/CSA0470-Operating-Systems-Concepts-and-its-implementation-Lab-Experiments- | OS Programs/13.cpp | #include <stdio.h>
void bestfit(int mp[], int p[], int m, int n) {
int j = 0;
for (int i = 0; i < n; i++) {
if (mp[i] >= p[j]) {
printf("\n%d fits in %d", p[j], mp[i]);
mp[i] -= p[j++];
i = -1; // Restart to find the best fit
}
}
for (int i = j; i < m... | ALGO | 0.999951 | 4.216074 |
d48e8aaa-89f7-4e4b-871a-de5abb9e5432 | joshualee155/MCPricing | BlackScholesAnalyticEngine.cpp | #include "BlackScholesAnalyticEngine.hpp"
#include "GBM.h"
#include "BSFun.h"
#include <cmath>
BlackScholesAnalyticEngine::BlackScholesAnalyticEngine(const shared_ptr<GeometricBrownianMotion>& process_,double DiscountRate_):process(process_), DiscountRate(DiscountRate_)
{
}
void BlackScholesAnalyticEngine::calculate(... | ALGO | 0.999044 | 7.007543 |
a61e673e-939d-497c-bb0f-ed0aa8315f3c | Kuldeep3330/2025_DSA | June challenge/24June.cpp | // 2200. Find All K-Distant Indices in an Array
class Solution
{
public:
vector<int> findKDistantIndices(vector<int> &nums, int key, int k)
{
vector<int> index;
int n = nums.size();
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < n; ++j)
{
... | ALGO | 0.99981 | 5.572054 |
a45c0468-8e18-48ba-bce1-796e01335ee4 | Sobachynska/Programming_C_labs | Lab01/Lab0303/Lab0303.cpp | #include <cmath>
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_CTYPE, "ukr");
cout << "Довжина сторони > Висота" << endl;
int a;
cout << "Довжина сторони ";
cin >> a;
int h;
cout << "Висота ";
cin >> h;
float osn;
osn = (a * a - h * h);
float c;
c = sqrt(osn) * 2;
float S;
S = (c *... | ALGO | 0.999191 | 3.463189 |
4d3a55fa-8bf3-45f9-a54d-c1fdef3fd5e4 | ishandutta2007/codeforces | egor.lifar/normal/1491/F.cpp | #include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#... | ALGO | 0.999573 | 3.545767 |
f8a1fad7-e92f-4d2a-8d3e-cbe3f818011a | leandoero/labTriangle | labTriangle/classTriangle.cpp | #include "classTriangle.h"
Triangle::Triangle(const Point& first, const Point& second, const Point& third) :coordFirst(first), coordSecond(second), coordThird(third) {};
double Triangle::getSideFirstSecond() {
double side = std::sqrt(((coordSecond.getX() - coordFirst.getX()) * (coordSecond.getX() - coordFirst.getX()... | ALGO | 0.874415 | 5.448834 |
980eb0fd-f840-4609-9942-700700a45689 | vkuasar0/llvm_instr_freq | libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// template<input_iterator I, sentinel_for<I> S, weakly_incrementable O>
// requires indirectly_copyable<I, O>
// constexpr ranges::copy_result<I, O> ranges::copy(I first, S last, O result);
// template<input_range R, weakly_incrementable O>
// requires ... | TEST | 0.968369 | 7.55712 |
b3c01018-0f52-4641-9787-f62c6be81877 | DuduAlmeida/EstruturaDeDados1 | Aula 6/Lista_Ligada_Linear.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <conio.h>
struct no {
int info;
struct no *prox;
};
int main()
{
no *lista, *p, *q;
lista = NULL;
p = (no *) malloc(sizeof(no));
p->info = 8;
p->prox = NULL;
lista = p;
q = p;
p = (no *) malloc(sizeof(no));
p->info = 10;
p->prox... | ALGO | 0.997086 | 3.223043 |
ac962141-bff3-4e33-bb53-e72b7b15ed16 | muhammadhasan01/cp | Lomba Lomba/INC 2018/H.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
long long answer(long long x){
if(x==0)return 0;
if(x>0 && x<=2)return 1;
if(x> 2 && x<=4)return 2;
if(x> 4 && x<=6)return 3;
if(x> 6 && x<=8)return 4;
if(x> 8 && x<=9)return 5;
long long odd, sisa;
sisa = x%10;
odd =... | ALGO | 0.999961 | 4.417812 |
dd821b24-7039-4090-8299-373852c77f15 | Stairway2Evan/CommonAlgorithms | BreadthFirstSearch/RecursiveBreadthFirstSearch.cpp | /* Time complexity of BFS traversal is O(V + E), where V and E are the total
number of vertices and edges in the graph, respectively. Please note O(E)
may vary between O(1) and O(V^2), depending on how dense the graph is.
*/
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
// Data struct... | ALGO | 0.999877 | 5.928746 |
a45226d4-9c5e-4169-a31b-c8329aff2cca | mayanksinha963/DSA | input/practice/function_macro.cpp | #include<iostream>
using namespace std;
#define min(a, b) ((a) < (b) ? (a) : (b))
int main(int argc, char const *argv[])
{
int num1, num2;
cout<<"Enter the number 1 : ";
cin>>num1;
cout<<"Enter the number 2 : ";
cin>>num2;
int mini = min(num1, num2);
cout<<mini;
return 0;
}
| ALGO | 0.997569 | 3.270881 |
53fb9148-5703-4fa0-a9bb-7556e7f930a8 | genesi/firefox | gfx/skia/src/core/SkMath.cpp | #include "SkMathPriv.h"
#include "SkCordic.h"
#include "SkFloatBits.h"
#include "SkFloatingPoint.h"
#include "Sk64.h"
#include "SkScalar.h"
#ifdef SK_SCALAR_IS_FLOAT
const uint32_t gIEEENotANumber = 0x7FFFFFFF;
const uint32_t gIEEEInfinity = 0x7F800000;
#endif
#define sub_shift(zeros, x, n) \
zeros -= n;... | ALGO | 0.998348 | 6.114098 |
20a3e155-0ca3-413a-9446-191020a7179b | junil1030/SolvedAlgorithm | Study/DFS_Class/main.cpp | #include "dfs.h"
int main()
{
C_DFS cDfs{};
cDfs.init(10);
cDfs.addNode(0, 1);
cDfs.addNode(0, 2);
cDfs.addNode(1, 2);
cDfs.addNode(1, 3);
cDfs.addNode(2, 4);
cDfs.addNode(3, 6);
cDfs.addNode(4, 5);
cDfs.addNode(4, 6);
cDfs.addNode(4, 7);
cDfs.addNode(6, 8);
cDfs.print();
cDfs.dfs(3);
cDfs.relea... | ALGO | 0.919865 | 4.364714 |
c974e930-fd95-464f-a70e-3fe81d72add1 | abh253/codeforces | practice/blind/B_Vaccination.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ;
template<typename T>
using ordered_multiset = tree<T... | ALGO | 0.99997 | 3.656818 |
8855bb98-a989-45a3-9f94-84d8baa73d57 | vijaymanikantareddy/LeetCode_GFG_solved | Print adjacency list - GFG/print-adjacency-list.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to return the adjacency list for each vertex.
vector<vector<int>> printGraph(int V, vector<pair<int,int>>edges) {
// Code here
vector<vector<int>> ans(V);
fo... | ALGO | 0.999862 | 6.205261 |
840e0873-699a-493e-bdb2-859d2a057de4 | mcbapo/mpsdyn | src/programs/banulsm/bosehub/bosehubTherm5.cpp |
#include <math.h>
#include <iomanip>
#include "MPS.h"
#include "FoldedOperator.h"
#include "Contractor.h"
#include "BosonMPO.h"
#define SKIPPAR 1 // Not do parity calculations
#define TMPSTORE 0 // Using temporary storage for intermediate results
#include "BoseHubbardHamiltonian.h"
/** bosehubTherm5 tries to find ... | ALGO | 0.998475 | 5.625131 |
4b081c6d-01ee-4b89-9bfb-07b235a02db5 | ShivanshGupta02/DSA | 3761-maximum-difference-between-even-and-odd-frequency-ii/maximum-difference-between-even-and-odd-frequency-ii.cpp | class Solution {
int get_status(int a, int b){
return ((a%2)*2) + (b%2);
}
public:
int maxDifference(string s, int k) {
int n = s.size();
int ans = INT_MIN;
for(char char_a='0'; char_a<'5'; char_a++){
for(char char_b='0'; char_b<'5'; char_b++){
... | ALGO | 0.999852 | 5.334371 |
db739e30-b1e9-4b2a-b8cc-dade8697d02d | FlorenciaLeolianti/Tower-of-Hanoi | main.cpp | #include <iostream>
#include "hanoi.h"
#include "stack.h"
using namespace std;
int main()
{
int input, langkah;
Stack A("A");
Stack B("B");
Stack C("C");
char jawab;
cout<<"Apakah Anda ingin menampilkan detail Stack? Jika iya, maka masukkan y/Y"<<endl;
cin>>jawab;
for(;;)
{
cin.clear();
cin.ignore();
... | ALGO | 0.994305 | 4.282733 |
743e4de5-617d-4cb7-ac22-258815645ac3 | tomqingo/CUMPLE_MLCAD | src/lib/3rdParty/eigen3-src/bench/bench_norm.cpp | #include <typeinfo>
#include <iostream>
#include <Eigen/Core>
#include "BenchTimer.h"
using namespace Eigen;
using namespace std;
template<typename T>
EIGEN_DONT_INLINE typename T::Scalar sqsumNorm(T& v)
{
return v.norm();
}
template<typename T>
EIGEN_DONT_INLINE typename T::Scalar stableNorm(T& v)
{
return v.sta... | TEST | 0.993266 | 6.681669 |
a74dbdd9-06e8-45ab-8eac-d2f4b3844d2f | Alphadexter17/DSA_assignments | DSA_assignment_4.cpp | #include "stack.cpp"
#include "stack.h"
#include<iostream>
using namespace std;
template <class T>
class dnode{
public:
dnode *left;
dnode *right;
T data;
dnode()
{
data=NULL;
left=nullptr;
right=nullptr;
}
};
class tree{
public:
dnode <char> *main_root;
d... | ALGO | 0.999731 | 4.250606 |
6f59f02a-5e9d-4ea7-b321-5e2497df7b46 | yashp23/ATCD | ATCD/005_P5_recursive_decent_parser.CPP | #include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h> // Include this header to use exit()
#include <conio.h>
const char *input; // Input string
int index = 0; // Current index in input
// Function prototypes
void P();
void E();
void T();
void S();
void F();
void D();
void match(char ex... | ALGO | 0.999126 | 5.525987 |
8b759284-7356-405a-b972-e88766391b97 | clay-arras/cp-practice | codeforces/solved/arraycloningtechnique.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n; cin >> n;
vector<int> a;
for (int i=0; i<n; i++){
int t; cin >> t;
a.push_back(t);
}
sort(a.begin(), a.end());
int mx=1, cnt=1;
for (int i=1; i<n; i++){
if (a[i] != a[i-1]){
mx = max(mx, cnt);
... | ALGO | 0.999275 | 4.594893 |
0ed8aabf-f098-4af3-957f-10d87d731a7b | kardandon/First-two-eigenvectors-and-eigenvalues | Matrix.cpp | #include "Matrix.h"
using namespace std;
// Methods of Matrix Class
// Constructers
// Default Constructor
Matrix::Matrix()
{
size_x = 0;
size_y = 0;
}
// Matrix Constructor that constructs a matrix that has size number of columns
Matrix::Matrix(int size)
{
arr.resize(size);
for(int i = 0; i < size ; ... | ALGO | 0.99744 | 4.061025 |
607503e6-4f42-45c8-9f6e-94d56ba3397c | BUCEA/SWEs | Sources/libboundaryconditions/bc_periodic.cpp | /**
* @file bc_periodic.cpp
* @author Pierre-Antoine Ksinant <<EMAIL>> (2010)
* @author Christian Laguerre <<EMAIL>> (2012-2015)
* @version 1.06.00
* @date 2015-02-19
*
* @brief Periodic condition
* @details
* Boundary condition:
* periodic condition.
*
* @copyright License Cecill-V2 \n
* <http://www.cec... | ALGO | 0.982776 | 5.465199 |
6e14e55f-5df4-4e01-8272-711a3b2a6093 | AbhinavTiwari2705/Leetcode | 1641. Count Sorted Vowel Strings.cpp | class Solution {
public:
int countVowelStrings(int n) {
return (n + 1) * (n + 2) * (n + 3) * (n + 4) / 24;
}
};
| ALGO | 0.999745 | 6.617494 |
a8c45b7e-e515-4bed-9a51-2358bfd9ec9c | Acka1357/ProblemSolving | Codeforces/EducationalRound/E65_D2/D.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <utility>
#include <functional>
#include <cstdlib>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
int len;
char s[200001], ans[200001], tmp[200001];
bool psb(int d){
int cnt1 = 0, cnt... | ALGO | 0.999871 | 3.348743 |
6cace866-0fae-4493-8e19-4bf322fe2051 | vikram-rathore1/competitive_programming | hackerearth/April17/2_testcases.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
vector<int> generate(int size, int max_val, bool print) {
vector<int> tc;
while(tc.size() != size) {
tc.push_back((rand() % max_val) + 1);
if (print) cout << tc.back() << " ";
}
if (print) cout << ": ";
return tc;
}
ll brute(vector<int> testca... | ALGO | 0.998686 | 4.128556 |
a5a02c79-8a77-40ec-a8f3-44631f5a7a1c | Afnan-AE/C- | Classes/foreach_loop.cpp | #include <iostream>
using namespace std;
//foreach loop = a loop that eases the traversal index
// of a iterable variable.
string n[] = {"Peter", "Gwen", "Miguel", "Miles"};
int main(){
for(string nm : n){
cout << nm << '\n';
}
return 0;
}
// *has less flexibility than normal loo... | TOOL | 0.94512 | 4.185867 |
20e54cfe-65b9-4b49-9a0a-f2c9034f5ce3 | TCGBench/TCGBench | data/human_performance_code/human_performance_code_noip/P1069/ac_3.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
int n,m1,m2,cnt,mn=0x3f3f3f3f,a[10006],is_prime[30006],numm[30006],numa[30006];
bool check(int x)
{
for(int i=2;i*i<=x;i++)
{
if(x%i==0)
{
return false;
}
}
return true;
}
void zys(int x)
{
for(int i=1;is_prime[i]<=x&&x!=1;i++)
{
while... | ALGO | 0.999993 | 3.623012 |
8301bb35-8da9-4bf4-94ff-ee9905e9c0ab | sm9cq/UVaCompPhys-My-code- | minuit1-sm9cq-main/minuit1_2.cpp | // A simple C++ program to illustrate the use of ROOT class TMinuit
// for function minimization. The example shows a Maximum Likelihood
// fit for the mean of an exponential pdf in which TMinuit
// minimizes - 2*log(L). The user must specify what to minimize in the
// function fcn, shown in this file below.
// fcn... | ALGO | 0.999076 | 5.67685 |
ad58a6a8-278f-4ce9-b5ec-67512d3653e5 | lana555/dynamatic | lsq_sizing/src/DFnetlist_channel_width.cpp | #include <cassert>
#include "DFnetlist.h"
using namespace Dataflow;
void DFnetlist_Impl::inferChannelWidth(int default_width)
{
// First define the known widths
ForAllBlocks(b) {
auto t = getBlockType(b);
// Input port of a constant should be control.
if (t == CONSTANT) {
... | TOOL | 0.916478 | 5.992477 |
6a8494c4-802a-4d19-95f0-c31248e83c46 | vtx123/rdreams_homework | Lesson6/Lesson6_1/Lesson6_1.cpp | // Issue 1 - Arithmetic progression.
#include <iostream>
int main()
{
int firstElement = 0;
int step = 0;
int lastElement = 0;
std::cout << "Arithmetic progression!" << std::endl;
std::cout << "Please enter the first element of progression:" << std::endl;
std::cin >> firstElement;
std::co... | ALGO | 0.999179 | 4.569326 |
e43f5396-311f-4dfa-830a-0c4a01181879 | emilakper/misis_edu_1_semester | akperov_e_b/0978a.cpp | #include <iostream>
#include <array>
int main()
{
const int nMax = 50;
std::array <int, nMax> a{ 0 };
int i;
int j;
int n;
int count;
std::cin >> n;
for (i = 0; i <= n - 1; i++) {
std::cin >> a[i];
}
count = n;
for (i = n - 1; i >= 0; i--) {
for (j = i - ... | ALGO | 0.999989 | 4.162227 |
8d0ea435-ef5e-4bb2-814f-dba8f2559155 | PontoZawrik/StudentCppRevisionTask09Project | StudentCppRevisionTask09Project/task04.cpp | #include "tasks.h"
/* Task 04. Все целые степени двойк (All Integer Powers of Two)
*
* По данному числу N распечатайте все целые степени двойки, не превосходящие N, в порядке возрастания.
* В случае некорректных данных напечатайте ноль.
*
* Формат входных данных [input]
* На вход подаётся целое число в диапазоне типа ... | ALGO | 0.998039 | 5.191261 |
73780084-865d-4910-9e4d-f00d3ed878f8 | martiks-materials/CompMethodsCourseMSc | assign3/transform.cpp | // Computational Methods Assignment 3 - Random Numbers - Program 2
// Martik Aghajanian
//
// This program uses the random number generator structure Ran to generate
// samples of a uniform deviate which are transformed into a random variable
// y which follows a probability distribution function 0.5*sin(y). This is
/... | ALGO | 0.999258 | 5.935613 |
5b22b441-e2b4-4ecc-ae69-94fc79f3ea40 | ishandutta2007/codeforces | krijgertje/normal/818/E.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.999978 | 3.465565 |
09861cf4-7a37-4a53-8922-95e48cd52724 | ZDUC/CTDL-GT_PTIT | demsovatcan.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, s = 0;
char a[2000][2000];
int rx[] = {1,- 1, 0, 0};
int ry[] = {0, 0, 1, -1};
void dfs(int x, int y)
{
for(int i = 0;i < 4; i++)
{
int dx = x + rx[i];
int dy = y + ry[i];
if(dx >= 1 and dx <= n and dy >= 1 and dy <= m and a[dx][dy] == '#')
{
a[dx][dy... | ALGO | 0.99967 | 3.876985 |
46196e6d-f52e-49db-be75-673e09083397 | kahowang/sensor-fusion-for-localization-and-mapping | 第一章 概述/lidar_localization/third_part/g2o-20170730_git/g2o/apps/g2o_simulator/sensor_segment2d_line.cpp | #include "sensor_segment2d_line.h"
#include "g2o/apps/g2o_simulator/simutils.h"
using namespace std;
using namespace Eigen;
namespace g2o{
SensorSegment2DLine::SensorSegment2DLine(const std::string& name_): BinarySensor<Robot2D, EdgeSE2Segment2DLine, WorldObjectSegment2D>(name_) {}
void SensorSegment2DLine::addN... | TOOL | 0.920752 | 5.747688 |
eab23765-0d14-422e-af3b-b695a2806778 | GeekTeam-InfinityOS/android_frameworks_av | media/libstagefright/codecs/mp3dec/src/pvmp3_crc.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_crc.cpp
Functions:
getbits_crc
calculate_crc
Date: 09/21/2007
------------------------------------------------------------------------------
REVI... | TOOL | 0.999292 | 6.677954 |
6ad66a26-1774-4b45-9b13-09eab0397b05 | zhangbowen-jpg/Code--Practice | 16进制下位数.cpp | /*************************************************************************
> File Name: 16进制下位数.cpp
> Author:
> Mail:
> Created Time: 2019年09月15日 星期日 14时36分06秒
************************************************************************/
#include<stdio.h>
#include<string.h>
int main() {
char str[10];
int n... | ALGO | 0.944448 | 4.189247 |
a6c1023c-106d-4aee-a5c7-66f25602819b | chetan541/new | C_Joyboard.cpp | #include <bits/stdc++.h>
using namespace std;
// Shortcuts for "common" data types in contests
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<string, int> msi;
// To simplify repetitions/loops, Note: define your
// loop style and st... | ALGO | 0.99982 | 3.683567 |
dd059297-1593-46b6-a98e-b3bf09f84313 | GuacheSuede/MSSubmission1234567890 | submission/bollinger/boost_1_69_0/libs/math/minimax/f.cpp | #define L22
//#include "../tools/ntl_rr_lanczos.hpp"
//#include "../tools/ntl_rr_digamma.hpp"
#include "multiprecision.hpp"
#include <boost/math/tools/polynomial.hpp>
#include <boost/math/special_functions.hpp>
#include <boost/math/special_functions/zeta.hpp>
#include <boost/math/special_functions/expint.hpp>
#include ... | ALGO | 0.973362 | 4.108557 |
42098e53-fb42-496a-9077-e0974eb11be5 | omi-sha/Leetcode_sols | 344-reverse-string/reverse-string.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
// reverse(s.begin(),s.end());
int left=0;
int right=s.size()-1;
while(left<right)
{
char temp=s[left];
s[left++]=s[right];
s[right--]=temp;
}
}
}; | ALGO | 0.999223 | 5.80759 |
4fd4d3fc-e7fc-486c-bd36-4bf2836eb80b | r-chiba/competitive_programming | atcoder/agc/010/a.cpp | // {{{
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <complex>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#if __cplusplus >= 201103
#include <numeric>
#endif
using namesp... | ALGO | 0.999949 | 3.780974 |
ed3e715d-c1af-4778-b774-d8c5d9e1a154 | sahilkhan03/CF-Solutions | codeforces/231/C.cpp | /*
Author : DemonStar
*/
#pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx2,tune=native")
#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 ordered_set tree<... | ALGO | 0.999993 | 4.15668 |
9531029c-3bec-4543-a2d0-33d22c438a9b | vmingchen/algorithms | 1753/flip1.cpp | /*
* =====================================================================================
*
* Filename: flip.cpp
*
* Description: POJ 1753. Flip Game
*
* Version: 1.0
* Created: 06/29/2009 06:02:21 PM
* Revision: none
* Compiler: gcc
*
* Author: Ming Chen (... | ALGO | 0.999377 | 4.6042 |
10a4c543-a742-445b-ba0c-f35e6a438cf5 | P0L3NARUBA/roblox-2016-source-code | Contribs/boost_1_56_0/libs/numeric/ublas/doc/samples/matrix_vector_binary.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
vector<double> v (3);
for (unsigned i = 0; i < (std::min) (m.size1 (), v.size ()); ++ i) {
for (unsigned j = 0; j < m.size2 (); ++ j)
... | ALGO | 0.999604 | 3.986627 |
fec3a4cf-48f5-48bf-a642-2198e8c5dee2 | zhuxiang555111/PAT_zju | 1038. Recover the Smallest Number (30)/1038. Recover the Smallest Number (30)/main.cpp | #include <iostream>
#include<algorithm>
#include <string>
using namespace std;
bool cmp(string a, string b)
{
return a + b < b + a;
}
int main()
{
int n;
string str[1010],ans;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> str[i];
}
sort(str, str + n, cmp);
for (int i = 0; i < n; i++)
{
ans += str[i];
... | ALGO | 0.999872 | 4.50927 |
88d56c21-7e3b-408c-bfed-9ac1746dac25 | sarvex/leetcode-malbolge | lcof/面试题56 - I. 数组中数字出现的次数/Solution.cpp | class Solution {
public:
vector<int> singleNumbers(vector<int>& nums) {
int xs = 0;
for (int& x : nums) {
xs ^= x;
}
int lb = xs & -xs;
int a = 0;
for (int& x : nums) {
if (x & lb) {
a ^= x;
}
}
int b... | ALGO | 0.999871 | 5.457954 |
c2d1a864-61fd-42a8-a95f-5dd3b81e344e | aierlma/cpp-homework-in-school | homework2/devide.cpp | short int devide(unsigned short a, unsigned short b)
{
if (b == 0)
return -1;
else
return a / b;
} | ALGO | 0.908978 | 4.083741 |
222d3e29-2700-49c9-bd29-6fe0427def5a | AnishMane/Data-Structure-And-Algorithms | Data Structures and Algorithms/BinarySearchTree/binarySearchTree.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
struct node{
int key;
node* left;
node* right;
};
node* createANode(int data)
{
node* newNode = (node*)malloc(sizeof(node));
newNode->key = data;
newNode->left = NULL;
newNode->right = NULL;
return newNode;
}
node* insert... | ALGO | 0.999957 | 4.217 |
6ba3ba18-897a-42ad-b007-6eb201bad2be | rahul-p-007/DSA-2025 | DSA-Questions/Function/Row_sum.cpp | #include <bits/stdc++.h>
using namespace std;
void row_sum(int arr[][3])
{
cout << "Printing the sum of 2-d array in row wise" << endl;
int sum = 0;
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
sum += arr[i][j];
}
cout << sum << " ";
co... | ALGO | 0.99756 | 4.621592 |
03008c8e-d9e7-4eb5-9d69-4f5c0d898433 | Aniketdhar810/Leetcode-grind | DP/3569-count-of-substrings-containing-every-vowel-and-k-consonants-ii/count-of-substrings-containing-every-vowel-and-k-consonants-ii.cpp | class Solution {
public:
long long valid(string word,int k){
int l=0,r=0,n=word.size();
long long ans=0;
map<char,int>mp;
int n_cnst=0;
while(r<n){
if(word[r]=='a'||word[r]=='e'||word[r]=='i'||word[r]=='o'||word[r]=='u') mp[word[r]]++;
else n_cnst++;
... | ALGO | 0.99996 | 5.896795 |
830901a9-265a-40b6-a9fa-7f1cab40b9f8 | rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning | packages/stk/stk_classic/stk_usecases/app/UseCase_14_Common.cpp | /*------------------------------------------------------------------------*/
/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
/* United States Government. */
/*------------------------------------------------------------------------*/
#include ... | ALGO | 0.999771 | 5.121687 |
15d048ce-afa2-4ad5-8c4e-2c3fb2ff6e37 | Sachin24063/30-Days-coding-challange | Challenge Company 3 : Adobe/3. K-th Smallest in Lexicographical Order.cpp | class Solution {
public:
int findKthNumber(int n, int k) {
int x = 1;
while (k > 1)
{
long count = 0;
for (long diff =1, cur=x; cur<=n; cur*= 10, diff*=10)
{
count += min(n - cur + 1, diff);
}
if (k > count)
{
k = k - c... | ALGO | 0.999774 | 6.769081 |
3a491159-1d28-47a9-b5ef-b463f1f58fc7 | MiteshJain8/LC | 2681-put-marbles-in-bags/put-marbles-in-bags.cpp | class Solution {
public:
long long putMarbles(vector<int>& weights, int k) {
int n = weights.size();
if (k == 1 || k == n) return 0;
for (int i=0; i<n-1; i++) weights[i] += weights[i+1];
weights.pop_back();
sort(weights.begin(),weights.end());
long long res = 0;
... | ALGO | 0.999926 | 5.326954 |
65e69e12-c140-465f-8898-202ff4bb81d2 | cpe102/lab13-2562-2-TangJetsada123 | lab13_2.cpp | #include<iostream>
using namespace std;
const int N = 5;
void inputMatrix(double [][N]);
void findLocalMax(const double [][N], bool [][N]);
void showMatrix(const bool [][N]);
int main(){
double A[N][N];
bool B[N][N];
cout << "Input the matrix.....\n";
inputMatrix(A);
findLocalMax(A,B);
cout << "Result is \... | ALGO | 0.999837 | 3.515919 |
b99adb65-c1c1-4215-bb85-085598b86814 | LeeHyungJoo/learn_Algorithm | 프로그래머스/lv0/120803. 두 수의 차/두 수의 차.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int num1, int num2) {
return num1 - num2;
} | ALGO | 0.999334 | 4.72184 |
ff7c310f-4b4b-4930-9ae1-53a1090442c3 | Bonsaigin/UVa-Online-Judge | 10341.cpp | /* Solve it
* http://uva.onlinejudge.org/external/103/10341.html
* Find the root of an equation!
* Since this problem was intended as a divide an conquer problem,
* the bisection method is implemented. However Newtown's algorithm
* typically requires less iterations
*/
#include <cstdio>
#include <cmath>
#defin... | ALGO | 0.999946 | 3.687375 |
9a2b8f55-a0ae-4d31-9794-f871456c432c | balaji1029/CS101_Lab | enigmatic_sequence_analyzer.cpp | #include <simplecpp>
main_program {
int n, input, len_of_sequence, max;
cout << "Enter the number of inputs: ";
cin >> n;
len_of_sequence = 0;
max = 0;
repeat(n) {
cin >> input;
len_of_sequence = 0;
repeat(2147483647){
len_of_sequence++;
if (input % 2 == 0) {
input /= 2;
} else if (input =... | ALGO | 0.999879 | 5.105186 |
6407079a-d591-4417-9be6-5a688e38a8c0 | shbhmexe/GeeksforGeeks-Sol | Hard/ThePainter'sPartitionProblem-II.cpp | class Solution {
public:
bool ispossible(vector<int>& arr, int k,int mid){
int s=0;
for(auto i:arr){
s+=i;
if(s>mid){
k--; s=i;
if(s>mid)return false;
}
}
return k>0? true:false;
}
int minTime(v... | ALGO | 0.999989 | 5.635345 |
b122bd0a-eaae-493e-a509-c2195a1658f3 | FathimaNusha/Recipe-Recommendation-web-application | .venv/Lib/site-packages/sklearn/svm/src/liblinear/tron.cpp | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "tron.h"
#ifndef min
template <class T> static inline T min(T x,T y) { return (x<y)?x:y; }
#endif
#ifndef max
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
#endif
static void default_print(const char *buf)
{... | ALGO | 0.999608 | 5.847107 |
fc07cb2d-3f52-4843-8898-868e80a0c8b3 | keijak/comp-pub | vcon/asa20220303/D/main_D.cpp | #include <bits/stdc++.h>
#define REP_(i, a_, b_, a, b, ...) for (int i = (a), END_##i = (b); i < END_##i; ++i)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(x) std::begin(x), std::end(x)
using Int = long long;
using Uint = unsigned long long;
using Real = long double;
template<typen... | ALGO | 0.999876 | 4.227044 |
130768f9-3868-4810-b95b-d090da3ae150 | fpaboim/gpufem | libs/eigen3.2/doc/examples/tut_matrix_resize.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,5);
m.resize(4,3);
std::cout << "The matrix m is of size "
<< m.rows() << "x" << m.cols() << std::endl;
std::cout << "It has " << m.size() << " coefficients" << std::endl;
VectorXd v(2);
v.resize(5);
... | ALGO | 0.97323 | 3.882785 |
79ce88a9-1907-47e9-9c7a-78c990374277 | ishandutta2007/codeforces | igorfardoc/normal/1627/E.cpp | #include<bits/stdc++.h>
#define inf 1000000000000000000ll
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifdef _FILE
freopen("input.txt", "r", stdin);
freopen("outpu... | ALGO | 0.99996 | 3.510306 |
e1b2c4e2-fa1b-4e55-8877-7d030caedd93 | lhb8125/swOpenFOAM | OpenFOAM-3.0.0/src/OpenFOAM/matrices/lduMatrix/solvers/swGAMG/swVcycle.cpp | #include "swGAMGSolver.hpp"
#include <stdio.h>
#include <iostream>
#include "SubField.H"
#include "amulMacros.h"
#include "vectorOps.h"
#include "BICCG.H"
#include "srPCG.hpp"
#if(SWTIMER)
#include "Timers.hpp"
#endif
void Foam::SW_GAMGSolver::Vcycle
(
const PtrList<lduMatrix::smoother>& smoothers,
scalarFiel... | ALGO | 0.999792 | 5.535658 |
775f0e69-79f1-4496-88f0-691c58127577 | vedbaek/r5 | Source/ThirdParty/Intel/Embree/Embree2140/src/kernels/subdiv/bezier_curve.cpp | #include "bezier_curve.h"
namespace embree
{
BezierCoefficients::BezierCoefficients(int dj)
{
for (size_t i=0; i<=N; i++)
{
for (size_t j=0; j<=N; j++)
{
const float t1 = float(j+dj)/float(i);
const float t0 = 1.0f-t1;
c0[i][j] = t0 * t0 * t0;
c1[i][j] = 3.0f ... | ALGO | 0.988685 | 5.432741 |
f3a93ea7-c2c4-4920-9fd8-573f53513fde | ishandutta2007/codeforces | hank55663/normal/1284/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acos(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memse... | ALGO | 0.999994 | 4.713324 |
5c9e8e9f-4795-446c-9176-b55411f0bc35 | ArcherAn/OJ | bigletter/bigletter.cpp | /*
ҳַддַ('A'-'Z')ĸ
ӿ˵
ԭͣint CalcCapital(String str);
ֵint
֪ʶ ַ
ʱ 10M
ڴ 128
һString
stringддĸĸ
迼ַΪ Ϊ0
add123#$%#%#A
1
*/
#include <iostream>
#include <string>
#include <algorithm>
#include <ctype.h>
using namespace std;
int CalcCapital(string str)
{
int len=str.size(); //ַ or str.length()
in... | ALGO | 0.999296 | 4.279562 |
cb6ea0cb-ef9d-4bb3-b85c-32d93c5c8a96 | zhuoyw/oneAPI-homeworks | oneapi-essentials-training/07_DPCPP_Library/lab/minimum_function.cpp | using namespace sycl;
using namespace oneapi::dpl::execution;
int main() {
queue q;
constexpr int N = 8;
//Input vector
std::vector<int> v{3,-1,-4,1,-5,-9,2,6};
//create a separate scope for buffer destruction
std::vector<int>result(N);
{
buffer buf(v);
buffer b... | ALGO | 0.999882 | 3.274218 |
02ec0291-a90a-4913-bc8f-2649ae81a20c | HJW-storage/CodingTest_Cplusplus | BBarkingDOG/0x07_Deque/1021.cpp | // https://www.acmicpc.net/problem/1021
#include <iostream>
#include <algorithm>
#include <deque>
using namespace std;
#define max_n 54
int n = 0, m = 0, pop_arr[max_n] = { 0, }, res = 0;
deque<int> dq;
int solve() {
int arr_idx = n-1; // ũ()
int cycle_cnt = m;
int idx_pop = 0; // ̾ ϴ ε.
int check = 0; // ... | ALGO | 0.999967 | 4.738021 |
4431c46b-92d3-46d6-bd61-1ce5eab5c4d1 | KenYu910645/lucky_utility | c++/function_call.cpp | #include <iostream>
using namespace std;
/* Note that C++ only implement "call by value"
but user can implement "call by reference" by passing a pointer to a function
*/
void func1(int x){ // call by value
x++;
cout << "In func1, x = " << x << endl;
}
void func2(int *x){ // call by address
(*x)... | TOOL | 0.988503 | 5.894552 |
250991c0-2692-423f-b433-216badc56fe1 | Paulsporsha69/Data-Structure | ackerman function.cpp | #include<iostream>
using namespace std;
int ackerman(int a,int b)
{
int m=a,n=b;
if(m==0)
{
return n+1;
}
else if(m>0 && n==0)
{
return ackerman(m-1,1);
}
else if (n>0 && m>0){
return ackerman(m-1,ackerman(m,n-1));
}
}
int main()
{
int a,b;
cin>>a>>b... | ALGO | 0.999978 | 4.494191 |
8d0149c4-ce4c-49ca-b3a8-0f4c523d6333 | 6o9puH/Labs_PSTU | Sem_2/Labs/recursions/8_queens/8_queens.cpp | #include <iostream>
using namespace std;
int board[8][8];
const int Queen = -1;
void showBoard()
{
for (int y = 0; y < 8; y++)
{
for (int x = 0; x < 8; x++)
{
if (board[y][x] == Queen)
{
cout << "Q ";
}
else
{
cout << ". ";
}
}
cout << endl;
}
cout << endl;
}
void setQueen(int ... | ALGO | 0.998926 | 4.323366 |
e1bb621f-ed70-4f8a-bc22-b9e12ca0b034 | hang245141253/HZOJ | C++11/402.cpp | /*************************************************************************
> File Name: code/HZOJ/C++11/402.cpp
> Author: YuHang
> Mail: <EMAIL>
> Created Time: Thu Sep 28 10:27:33 2023
************************************************************************/
#include <iostream>
#include <queue>
using namespace s... | ALGO | 0.999976 | 3.589587 |
5343b7b9-01e1-4830-83fc-bbb8de50e494 | AndreaLazzari/FisicaComputazionale | Lezione14/C++/set.cpp | //CONTAINER ASSOCIATIVI ( == NON SEQUENZIALI )
//la ricerca al loro interno richiede un tempo O(log(N)) o addirittura meno (in media)
//(la struttura dati tipicamente è un "self-balancing binary tree")
//std::set contiene una collezione di copie *singole* di oggetti (tutti oggetti diversi)
#include<set>
#include<iostr... | TOOL | 0.874984 | 4.082298 |
f2100658-2650-41d5-9e55-c22363317877 | ArisenIO/arisen.contracts | contracts/arisen.system/src/producer_pay.cpp | #include <arisen.system/arisen.system.hpp>
#include <arisen.token/arisen.token.hpp>
namespace arisensystem {
using arisen::current_time_point;
using arisen::microseconds;
using arisen::token;
void system_contract::onblock( ignore<block_header> ) {
using namespace arisen;
require_auth(get_sel... | ALGO | 0.948561 | 6.699821 |
6dfbd999-2a87-481c-8449-56c66666e473 | durgirajesh/Leetcode | Symmetric Tree.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.999974 | 6.547081 |
5e278434-ba4d-4429-96f7-c80a754307ae | 1337DaKL/Bai_Tap_C_Plus_Plus | codePTIT/DSA04004.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll Try(ll n, ll k)
{
if (k == pow(2, n - 1))
{
return n;
}
if (k < pow(2, n - 1))
{
return Try(n - 1, k);
}
return Try(n - 1, k - pow(2, n - 1));
}
int main()
{
int test;
cin >> test;
while (test--... | ALGO | 0.999908 | 4.890257 |
5d8dfb07-60f3-43be-8c01-ceb2c05f1091 | I-Diptiranjan/Learning_CPP-DSA | BASIC (ARRAY & STRINGS)/Day16(14th Feb)/02_Recursion.cpp | #include<iostream>
using namespace std;
void sayDigits(int n , string arr[])
{
if(n==0)
{
return;
}
int digit = n % 10;
n=n/10;
sayDigits(n,arr);
cout<<arr[digit]<<" ";
}
int main()
{
string arr[10] = {"zero","one","two","three","four","five","six","seven","eight","nine"};
... | ALGO | 0.99922 | 5.292831 |
1ed9a7f1-7c0e-4927-8376-666a5bd9cd9a | sulabhmatele/Highway-Path-Planning_SelfDrivingCar_Term3_P1 | src/Eigen-3.3/bench/quat_slerp.cpp | #include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Q>
EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
{
return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
}
template<typename Q>
EIGEN_DONT_INL... | ALGO | 0.993077 | 6.251058 |
64ef11e7-419e-44c2-b751-76ac8cb08017 | CrypticFate/DSA | Lab 1/210041220_T01L01.cpp | #include <iostream>
using namespace std;
void SortArray(int arr[],int count){
for(int i=0 ; i<count-1 ; i++){
for(int j=0 ; j<count-1-i ; j++){
if(arr[j]>arr[j+1]){
swap(arr[j],arr[j+1]);
}
}
}
}
int main() {
int numbers[100];
int num=0,count=0;
... | ALGO | 0.99976 | 3.380544 |
725dbc8b-ea99-4fba-bc5b-6de377e50399 | Edward1217/Intro_to_ComputerScience_COMP051 | 3 - Branches/3.4 - Logical Operators/detect_number_range.cpp | #include <iostream>
using namespace std;
/*
Write an expression that prints "Eligible" if userAge is between 18 and 25 inclusive.
Ex: 17 prints "Ineligible", 18 prints "Eligible".
*/
int main() {
int userAge = 0;
userAge = 17;
if ((userAge >= 18) && (userAge <= 25)) { //<-- answer
cout << "Eligible... | TOOL | 0.954117 | 5.458943 |
2f5cc936-2251-45b7-a662-465ed3b79153 | Pika-Pool/cpp-progs-3rd-sem | 7-VolumeOfShapes.cpp | /*
* V. Sriram
* 10314902019
*/
/* cone: pi * r * r * h / 3
* cylinder: pi * r * r * h
* sphere: 4 * pi * r * r * r / 3
* cube: a * a * a
* cuboid: l * b * h
*/
#include <iostream>
#include <stdio.h>
#define PI 3.141592653589793238462643383
using namespace std;
// cone and cylinder
// cone and cylinder both take 2 a... | TOOL | 0.880441 | 3.191813 |
04824428-d97f-449d-a7a7-0a8136dc0857 | ishandutta2007/codeforces-t | thenymphsofdelphi/normal/1363/A.cpp | #include<bits/stdc++.h>
using namespace std;
// Optimization
//#pragma GCC optimize("O3")
#define endl '\n'
// Shortcut
#define int long long
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#def... | ALGO | 0.999909 | 4.422262 |
266f0111-b587-495d-ae17-a0b25e27fa58 | docclaus/Programacion-UD2 | cuadrado perfecto/cuadradoperf.cpp | //Programa para calcular si un número es cuadrado perfecto
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int num, n=0, resultado=0; //num es la variable para que la guarde el programa elegido por el usuario, n el incremento y resultado el total
bool ozelui=false; //Bandera
cout << "Hola... | ALGO | 0.997434 | 3.85848 |
e04ce965-81a1-4e4c-8069-855994a3f116 | saurabhMayank/sample_code_for_interviews | sample_code_for_interviews_new/dynamic_programming/01_knapsack_dp_memoization.cpp | // constraints
// n = 100
// W = 1000
int dp[101][1001];
memset(dp, -1, sizeof(dp));
int 01_knapsack(vector<int> w, vector<int> val, int W, int n){
if(n == 0 || W == 0){
return 0;
}
if(dp[n][W] != -1){
return dp[n][W];
}
//if wt < W
if(w[n-1] < W){
// two function calls
// choos... | ALGO | 0.999996 | 5.063014 |
ced639ca-b87c-4af6-a420-92efeed46900 | SaidjonRavshanov/problems | c++ learning/1-bo'lim/Untitled11.cpp | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main(){
//11-vazifa
//
//1. Str satr berilgan. Shu satrdagi harflarni shu satrdagi oxirgi belgi bilan almashtiruvchi dastur tuzing.
//
//2. Berilgan str satridagi dastlabki 5 ta raqamni ekranga chiqaring.
//
//3. Berilgan str satridagi bar... | TOOL | 0.962689 | 3.179138 |
f14a7674-a795-4666-ae5b-21bae93a57b3 | codeforsmart/Cp-contest | cf contest/599/vaise.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define mod 1000000007
#define endl "\n"
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define lb lower_bound
#define debug(x) cout<<"["<<#x<<": "<<x<<"]"<<endl
#define f(i,p,n) for(ll i=p;i<n;i++)
ll exp(ll a,ll b,ll m... | ALGO | 0.999945 | 3.438655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.