uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a7e75592-6342-46cd-8934-8da95a19b38f | pmhmist/AlgorithmStudy | 백준/단계별 문제풀이(C++)/백준-동적 계획법 1/01003 피보나치 함수.cpp | #include <iostream>
#include <algorithm>
using namespace std;
#define FAST cin.tie(NULL); ios::sync_with_stdio(false);
int arr[50] = { 0,1, };
int solve(int a)
{
if (a == 0)
{
return 0;
}
if (a == 1)
{
return 1;
}
else
{
if (arr[a] != 0)
{
return arr[a];
}
else
{
arr[a] = solve(a - 2) + so... | ALGO | 0.999969 | 4.365327 |
6fe0dae5-8567-48e7-a738-3876d884c275 | Avinash0308/Geeks_For_Geeks_POTD_2024 | 17_Oct_Split_Linked_List_Alternatigly_Solution.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *next;
Node(int x)
{
data = x;
next = NULL;
}
};
class Solution
{
public:
// Function to split a linked list into two lists alternately
vector<Node *> alternatingSplitList(struct Node *head)
... | ALGO | 0.999879 | 5.101525 |
0dfec21a-5419-473e-b946-fe11e22966d0 | Kuhhhhhhh/2023aaia3 | week11/week11-2.cpp | ///week11-2.cpp nդ@ C++ 2011 c++11\
#include <iostream>
#include <vector>
#include <unordered_map>
///Setting ]w-1 Compiler sĶ,c++11
using namespace std;
int main()
{
vector<int> a;
unordered_map<int,int>m;///pGιw]c++98,|
m[999] = 13;///Bash Map ,iHֳtBYӭ
m[137] = 7;
cout << "m[999] ȬO"<<m[999] << e... | ALGO | 0.947304 | 5.003258 |
cf30be72-658a-42b2-bac6-3814520ec36a | vikas148/dsa-rohit-negi | day80/binaryrec.cpp | #include<iostream>
using namespace std;
bool binarySearch(int arr[],int start,int end, int X ){
if(start>end)
return 0;
int mid =start+(end-start)/2;
if(arr[mid]==X)
return 1;
else if(arr[mid]<X)
return binarySearch(arr,mid+1,end,X);
else
return binarySearch(arr,start,mid-1,X);
}
int main()
{
int arr[]= {2,4,6,8... | ALGO | 0.999866 | 4.001812 |
04a15f13-7415-41eb-9a10-cd557932676a | Pritee668/cpp-language | macroSwap.cpp |
# include<bits/stdc++.h>
using namespace std;
# define swapN(x,y) int temp=x; x=y; y=temp;
int main(){
int a=10,b=20;
cout<<"value of a="<<a<<"and b="<<b<<"before swapping"<<endl;
swapN(a,b);
cout<<"value of a="<<a<<"and b="<<b<<"after swapping"<<endl;
}
| ALGO | 0.992965 | 3.099743 |
23c4d229-9939-4936-a468-200ade4aa8fa | Tanvir-Mahamood/C-Plus-Plus | Discrete Mathematics Lab Task/InverseMod.cpp | //In the name of Allah, the Gracious, the Merciful
#include <bits/stdc++.h>
using namespace std;
#define nn "\n"
#define ll long long
#define ull unsigned long long
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
int GCD, S, T;
int inverseMod(int a, int b)
{
int q, r, s1, s2, s, t1, t2, t;
s1 = 1; s2 =... | ALGO | 0.999755 | 5.228288 |
3b8c1085-8396-4e53-8edc-9ca7d4a07082 | thegamer1907/Code_Analysis | Implementation/2184.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output1.txt","w",stdout);
#endif
ll n,x,y,z;
ll sx,sy,sz;
sx=0;
sy=0;
sz=0;
c... | ALGO | 0.999642 | 3.579343 |
611b415a-a408-4d58-a338-7fb42d2d8d3f | hectorratia/CarND-Path-Planning-Project | src/Eigen-3.3/doc/examples/nullary_indexing.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
// [functor]
template<class ArgType, class RowIndexType, class ColIndexType>
class indexing_functor {
const ArgType &m_arg;
const RowIndexType &m_rowIndices;
const ColIndexType &m_colIndices;
public:
typedef Matrix<typename ArgType::Scalar,
... | ALGO | 0.93805 | 7.050192 |
21c277f3-6d50-4e94-b641-c003f8d87653 | infernuslord/Cryptool2 | LibSource/ExtendedNTL/src/WordVector.cpp |
#include <NTL/WordVector.h>
#include <NTL/new.h>
#include <stdio.h>
NTL_START_IMPL
void WordVector::DoSetLength(long n)
{
long m;
if (n < 0) {
Error("negative length in vector::SetLength");
}
if (NTL_OVERFLOW(n, NTL_BITS_PER_LONG, 0))
Error("length too big in vector::SetLe... | TOOL | 0.853013 | 4.884054 |
d9d4108d-1e74-4444-a027-1650b3b64608 | YeremiaLaurentH/remidiuas_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.998784 | 6.761023 |
d68b6461-402a-4373-83b8-2e900d55df5f | prakHr/CSES-CPBeginnerJourney | Range Queries/Forest Queries.cpp | #include <bits/stdc++.h>
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define double long double
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define PI acos(-1)
#define sqr(a) ((a)*(a))
#define ff first
#define ss second
#de... | ALGO | 0.999812 | 3.753217 |
d6c5c548-6693-45ad-89b4-fac433ea9264 | vitomc22/cpptips | basics/FactorialException.cpp | //exemplo de exceções usando uma função fatorial
#include<cstdio>
#include<iostream>
#include<cstdlib>
// factorial - computa fatorial
int factorial (int n)
{
//voce nao pode manipular valores negativos
//de n; melhor checar a condição primeiro
if (n < 0)
{
throw std::string("argumento para fa... | ALGO | 0.972683 | 5.329268 |
d15c41cf-cb2e-4667-a8f7-ac59a0116753 | cothan/2x2NTT | dilithium-256/hardware_code/ntt2x2_fwdntt.cpp | /*
* From our research paper "High-Performance Hardware Implementation of CRYSTALS-Dilithium"
* by Luke Beckwith, Duc Tri Nguyen, Kris Gaj
* at George Mason University, USA
* https://eprint.iacr.org/2021/1451.pdf
* =============================================================================
* Copyright (c) 2021 ... | ALGO | 0.998261 | 5.974978 |
28331cab-32bd-4ec8-a89f-8d3ebaa7edda | cmcarowland/UMBC- | Day 9/Ex18-1/Ex18-1.cpp | /*
* Raymond Rowland
* Ex 18-1
* Create a function template
* - Convert the bubble_sort function to a template
* - Add code to sort and print the prices array
*
*/
#include <iostream>
using namespace std;
template<typename T>
void bubble_sort(T arr[], int size) {
bool is_swap;
T temp;
do {
is_swap = fal... | ALGO | 0.99577 | 6.267178 |
3eb0cb07-5b82-400d-a403-a8db11233615 | ShreeniwasKolagal/DSAFromScratch | Graphs/Learning/weightedMatrix.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int v,e; // v -> vertices, e -> edges
cin >> v >> e;
vector<vector<int>> adj(v+1, vector<int>(v+1, 0));
for(int i=0; i<e; i++)
{
int v1, v2;
int wt;
cin >> v1 >> v2;
cin >> wt;
adj[v1]... | ALGO | 0.999925 | 3.583732 |
6d54b962-a158-46f6-a53e-1cee62c5fd3d | Sahilll94/Cpp-STL-Detailed | Containers/Stack/Member Funtions/top.cpp | #include<iostream>
#include<stack>
using namespace std;
int main()
{
stack<int>s;
s.push(10);
s.push(20);
s.push(30);
s.push(40);
//It will show the topmost element means the element which was inserted at the last.
cout<<s.top();
} | ALGO | 0.969007 | 3.642223 |
2051d81c-a3f9-47f8-9348-e39cba56966c | Gesic/cmu_defense_project | libs/dependencies/tesseract/ccstruct/quadlsq.cpp | #include <stdio.h>
#include <math.h>
#include "quadlsq.h"
#include "tprintf.h"
// Minimum variance in least squares before backing off to a lower degree.
const double kMinVariance = 1.0 / 1024;
/**********************************************************************
* QLSQ::clear
*
* Function to initialize a QLSQ.
... | ALGO | 0.995859 | 6.26833 |
7ceec4c0-7ccb-4988-a6b8-7223129ddd83 | maxgerhardt/teensy-core-pio-package | libraries/Audio/effect_reverb.cpp | // https://github.com/joaoRossiFilho/teensy_reverb
#include <Arduino.h>
#include "effect_reverb.h"
#include "utility/dspinst.h"
#include "math_helper.h"
void
AudioEffectReverb::_do_comb_apf(struct comb_apf *apf, int32_t *in_buf, int32_t *out_buf)
{
int32_t acc_x, acc_y, g;
int32_t w, z;
uint32_t n, buf_len;
... | ALGO | 0.977665 | 5.956983 |
487aff4c-59cf-4b08-968e-8f4b2ba6cdd3 | ninedayhx/code_log | list/206_reverseList.cpp | #include <iostream>
using namespace std;
class MyLinkedList {
public:
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {};
ListNode(int x) : val(x), next(nullptr) {};
ListNode(int x, ListNode *ptr) : val(x), next(ptr) {};
};
MyLinkedList() {
virtual_head = new ListNode(... | ALGO | 0.999734 | 4.961658 |
aeda0f59-091c-4353-a562-7672398e5bdf | lecongminhnhut/24120211 | week3/flash-sort.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void flashSort(int arr[], int n) {
if (n == 0) return;
// Bước 1: Tìm min, max
int minVal = arr[0], maxVal = arr[0], maxIndex = 0;
for (int i = 1; i < n; i++) {
if (arr[i] < minVal) minVal = arr[i];
if (arr... | ALGO | 0.999992 | 5.411728 |
87cf0c26-9f20-47f6-9ad4-98b65ade8300 | yingling-group/lammps-mspin | src/EXTRA-MOLECULE/dihedral_quadratic.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Loukas D. Peristeras (Scienomics SARL)
[ based on dihedral_helix.cpp Paul Crozier (SNL) ]
------------------------------------------------------------------------- */
#include "dihedral_quadratic.h... | ALGO | 0.995761 | 6.603828 |
f6acf726-96a4-429e-8dd8-f80e0a2eddbd | devLupin/algorithm-prev | BOJ/2979[Simulation].cpp | #include <iostream>
#include <deque>
using namespace std;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int a, b, c, ans = 0, arr[101] = { 0, };
cin >> a >> b >> c;
for (int i = 0; i < 3; i++) {
int x, y; cin >> x >> y;
for (int j = x; j < y; j++)
arr[j]++;
}
for (int i = 1; i < 10... | ALGO | 0.9991 | 3.657445 |
5fd5d276-ac4e-4eab-928c-9cbb9f2a33ba | thinkhy/LeetCode | issymmetric_iterate.cpp | #include <iostream>
#include <string>
#include <map>
#include <unordered_set>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <limits>
#include <utility>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NUL... | ALGO | 0.999973 | 6.305547 |
975c34bd-c6f0-4c65-b310-2de6057ea86a | truongcongthanh2000/TrainACM-ICPC-OLP | 2018 ICPC South Central USA Regional Contest/G.cpp | #pragma GCC diagnostic ignored "-Wunused-parameter"
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define INP "solve"
#define OUT "solve"
const long long INF_LL = 1e17;
const int INF = 1e9 + 100;
const int MOD = 1e9 + 7;
const int Base = 311;
const double EPS = 1e-9;
const int BLOCK = 1000;... | ALGO | 0.999946 | 5.725409 |
708fecdf-a52c-4b69-b113-f64153e31093 | Jiaqi07/Usaco-Bronze-Silver-XCamp-Practice-Cpp | XCamp200/XCamp 200 Midterm/Pizza.cpp | /*
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int *s;
s = new int[n];
s[0] = 1;
s[1] = 2;
s[2] = 4;
s[3] = 7;
for (int i = 4; i <= n; ++i) {
s[i] = s[i-1] + i;
}
cout << s[n];
}
... | ALGO | 0.999867 | 3.699819 |
7b2d7914-8180-402e-9b92-027d8bbd33d9 | jmlopez-rod/spp | main/cpp/lotka_volterra_ssa_pylib.cpp | // File generated on Sun Jan 05, 2014 12:53:25 PM by xcpp.
/*Lotka-Volterra SSA
Set of functions to perform simulations on the Lotka-Volterra model
using Gillespie's Stochastic Simulation Algorith (SSA).*/
#include <debugoff.h>
#include <excentury/excentury.h>
#include <spp/spp.h>
#include <models/lotka_volterra_ssa.h... | ALGO | 0.993874 | 5.92875 |
39cd60bd-62ea-4add-b19d-3fb4779e60ab | HackerDom/ructf-2013-final | services/database/Sources/cryptopp/rc5.cpp | // rc5.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "rc5.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
void RC5::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameValuePairs ¶ms)
{
AssertValidKeyLength(keylen);
r = GetRoundsAndThrowIfInvalid(params, thi... | ALGO | 0.998151 | 7.488848 |
2a9a6ea1-7557-4d81-8841-f5a44d6c3711 | Nispeter/Competitive_programming_Udec | 2020-2/L3/preg01203.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(int argc, char const *argv[])
{
//freopen("query.txt","r",stdin);
string reg;
typedef pair<int,vector<int>>pa;//estructura que almacena la suma de los valores de iteracion, y un vector con el q_num y el periodo
priority_queue<pa... | ALGO | 0.998788 | 3.137117 |
bc3037d1-02a6-4df6-93b0-3df9c5a50a67 | tiagodsp/godot | thirdparty/bullet/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp | #include "btGjkConvexCast.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "btGjkPairDetector.h"
#include "btPointCollector.h"
#include "LinearMath/btTransformUtil.h"
#ifdef BT_USE_DOUBLE_PRECISION
#define MAX_ITERATIONS 64
#else
#define MAX_ITERATIONS 32
#endif
btGjkConvexCast::btGjkConvexCast(... | ALGO | 0.99661 | 6.775271 |
6ba40303-221e-436f-9816-6296af4262b4 | YinWenAtBIT/LeetCode | twosum/version_2.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> result(2);
int len = nums.size();
int max = 0;
for(int i =0; i<len; i++)
{
if(abs(nums[i]) >max)
max = abs(nums[i]);
}
if(abs... | ALGO | 0.999969 | 5.616971 |
5cc8afe7-d4dc-46f6-b65e-6ee8baf3619e | alanyy/GAMES202_Homework | A2/prt/ext/tbb/src/perf/time_split_node.cpp | #include <iostream>
#include "tbb/flow_graph.h"
#include "tbb/tick_count.h"
#include "tbb/task_scheduler_init.h"
static double bm_split_node(tbb::flow::graph& g, int nIter);
static double bm_broadcast_node(tbb::flow::graph& g, int nIter);
static double bm_queue_node(tbb::flow::graph& g, int nIter);
typedef int my_typ... | TEST | 0.962915 | 6.061878 |
dd477683-980c-405e-b01a-67c348618ee2 | anthony-chaudhary/self-driving-car-nanodegree-nd013 | p10-model-predictive-control/quizes/CarND-MPC-Quizzes-master/mpc_to_line/src/Eigen-3.3/doc/examples/tut_arithmetic_redux_basic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::Matrix2d mat;
mat << 1, 2,
3, 4;
cout << "Here is mat.sum(): " << mat.sum() << endl;
cout << "Here is mat.prod(): " << mat.prod() << endl;
cout << "Here is mat.mean(): " << mat.mean() ... | ALGO | 0.998866 | 3.870119 |
145561f2-9467-4d8e-8d01-8b8e969c573b | Khong-cam-xuc/CODE_T | 28tech/BT/mang2chieu/bai2.cpp | /**
* Author: Andrew
* Created: 30.04.2024 07:57:48
**/
#include <bits/stdc++.h>
//#pragma GCC target("popcnt,lzcnt,bmi,bmi2,abm")
using namespace std;
#ifdef Andrew
#include "debug.h"
#else
#define debug(x...)
#endif
#define TIME (1.0 * clock()/ CLOCKS_PER_SEC)
#define FOR(i,a,b) for(int i = (a);i <= (b);++... | ALGO | 0.999988 | 3.26961 |
b94cc1f5-ad05-4b02-8e66-eeb3eb2ad880 | DevangTyagi/LeetCode | 1502-construct-k-palindrome-strings/construct-k-palindrome-strings.cpp | class Solution {
public:
bool canConstruct(string s, int k)
{
unordered_map<char,int>mpp;
int odd_char = 0;
if(s.size() < k)
return false;
if(s.size() == k)
return true;
for(auto &itr : s)
mpp[itr]++;
for(auto &itr : mpp) {
... | ALGO | 0.999989 | 6.207273 |
abd9e119-784b-4b06-a9a4-e09faa3fa2cd | elkcl/tinkoff | lesson23-mitm/A23_dumb.cpp | #pragma GCC optimize("O3")
#include <iostream>
#include <vector>
#include <random>
#include <cmath>
#include <algorithm>
#include <functional>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vii = vector<ii>;
using vvi = vector<vi>;
using vc ... | ALGO | 0.999986 | 3.098946 |
a847a354-7771-481a-bd2a-097f0e6fa5d5 | starga2er777/PointCloudCompression | modules/dnn/src/vkcom/src/op_prior_box.cpp | #include "../../precomp.hpp"
#include <limits>
#include "common.hpp"
#include "internal.hpp"
#include "../include/op_prior_box.hpp"
namespace cv { namespace dnn { namespace vkcom {
#ifdef HAVE_VULKAN
#define LOCAL_SZ_X 256
struct PriorBoxParam {
int global_size;
int nthreads;
float step_x;
fl... | ALGO | 0.974812 | 5.975616 |
b7a75a50-a517-4f51-b85d-3a6e59bd4161 | vanah313/2019_Spring_CSC_5 | labs/Lab 040419/FibonacciSequence/main.cpp | /*
* File: main.cpp
* Author: Torres, Savanah
* Created on April 4th, 2019, 12:06 PM
* Purpose: Generate the Fibonacci Sqequence
*/
//System Libraries
#include <iostream> //Input/Output Library
using namespace std;
//User Libraries
//Global Constants, no Global Variables are allowed
//Math/Physics/Conversi... | ALGO | 0.999401 | 4.072019 |
03f5f7a2-9597-4a00-bf81-3b17a347f2da | pulumboom/nn_from_scratch | lib/eigen-3.4.0/bench/sparse_lu.cpp |
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out
#define EIGEN_SUPERLU_SUPPORT
#define EIGEN_UMFPACK_SUPPORT
#include <Eigen/Sparse>
#define NOGMM
#define NOMTL
#ifndef SIZE
#define SIZE 10
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifnd... | ALGO | 0.987762 | 4.187482 |
b3a47236-1e15-4098-a32a-dca0281ca4a1 | tracy/Bluetune | ThirdParty/FhgAAC/libFDK/src/autocorr2nd.cpp |
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Frderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
T... | ALGO | 0.997121 | 5.742535 |
3bc00b8f-038a-4868-9fd7-a25286f764b8 | kishori82/fastpro_single-cell-rna | tools/src/utilities.cpp | /**
* @file utilities.cpp
* @brief Utility functions for file processing
* @author Kishori Konwar
* @date 2021-08-11
***********************************************/
#include "utilities.h"
using namespace std;
namespace fs = std::experimental::filesystem;
/** @copydoc filesize */
int64_t filesize(const... | TOOL | 0.854876 | 6.541933 |
6f1de8fe-9de6-4aa3-bfab-5786ab3e71ba | nguyentungg/DataStructures | C++/8. Tree/Binary Search Tree/Balance BST/RedBlackTree.cpp | // Implementing Red-Black Tree in C++
#include <iostream>
using namespace std;
struct Node
{
int data;
Node *parent;
Node *left;
Node *right;
int color;
};
typedef Node *NodePtr;
class RedBlackTree
{
private:
NodePtr root;
NodePtr TNULL;
void initializeNULLNode(NodePtr node, NodePtr... | ALGO | 0.999796 | 5.991326 |
7222536e-1903-478a-b814-085469b6605a | aspschn/SeshatCpp | src/normalize.cpp | #include <seshat/unicode/normalize.h>
#include <seshat/unicode/dm.h>
#include <seshat/unicode/hangul.h>
#include <seshat/unicode/normalization_props.h> // comp_ex(), quick checks
#include <seshat/unicode/properties.h>
namespace seshat {
namespace unicode {
bool starter(uint32_t cp)
{
// Refer D107 in Starters, 3... | ALGO | 0.980184 | 7.224686 |
37cee01f-69f3-4a06-8f52-191cc039f468 | leothatidiot/algorithm-exercise | offer/58-I/c++/main.cpp | #include "Solution.cpp"
int main() {
Solution s1;
s1.reverseWords("");
return 0;
} | ALGO | 0.989728 | 5.379179 |
46ae14c9-6959-4e19-a737-69b923106b66 | roytam1/mozilla45esr | tools/power/rapl.cpp | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
// This program provides processor power estimates. It does this by reading
// model-specific registers (MSRs) that are part Intel's Running Average Power
// Limit (RAPL) interface. These MSRs provi... | TOOL | 0.891522 | 6.270334 |
27f4c353-cb92-4516-8b9f-ee76f5931c1a | TURING132/Game | leetcode/n0227-Basic_Calculator_II.cpp | #include <iostream>
#include <string>
#include <stack>
#include <unordered_map>
using namespace std;
class Solution {
public:
unordered_map<char, int> pri = {
{'+', 1}, {'-', 1}, {'*', 2}, {'/', 2}
};
stack<char> op;
stack<int> nums;
void eval(){
int b = nums.top(); nums.pop();
... | ALGO | 0.999793 | 4.8408 |
ce5a174c-e57d-46a7-bd1a-cc50d7e30eca | miiitomi/atcoder | mayocon/20240101/5.cpp | // https://atcoder.jp/contests/abc174/tasks/abc174_e
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, K;
vector<ll> A;
bool can_lower_than_x(ll x) {
ll cnt = 0;
for (ll a : A) {
ll b = (a + x - 1) / x;
cnt += b-1;
}
return cnt <= K;
}
int main() {
cin >> N... | ALGO | 0.999876 | 4.720284 |
a7dc06ed-45ca-43be-9e72-98bd89de2674 | HarshAnand17/Data_structures_and_algo | pattern/Vector1D.cpp/passvecttofn.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void change(vector<int>&v) {
v[0]=100;
for(int i=0;i<v.size();i++) {
cout<<v[i]<<" ";
}
cout<<endl;
}
int main() {
vector<int>v;
v.push_back(2);
v.push_back(9);
v.push_back(1);
v.push_back(5);... | ALGO | 0.98114 | 3.270141 |
49c01d69-def7-486d-824c-d71c7f2c2dcc | skollhati/boost_srv | libs/sort/example/parallelstring.cpp | // See http://www.boost.org/libs/sort for library home page.
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <boost/sort/spreadsort/spreadsort.hpp>
#include <boost/thread.hpp>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#incl... | ALGO | 0.997938 | 4.75403 |
1ee1dfa8-5f92-4cd7-9d2c-5d750091e492 | Fighohji/Competitive-Programming | Record/PassRecord/cf900/F.cpp | #include <map>
#include <set>
#include <array>
#include <cmath>
#include <queue>
#include <stack>
#include <tuple>
#include <bitset>
#include <cctype>
#include <cstdio>
#include <random>
#include <string>
#include <vector>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <algorithm>... | ALGO | 0.998665 | 4.8018 |
0d1298b1-6420-4baa-8164-2019259670eb | legendsovermyths/DSA | C++/MaxProductSubArray.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution
{
public:
// Function to find maximum product subarray
long long maxProduct(int *arr, int n)
{
long long int MAXproduct = 1;
long long int tempMin = ... | ALGO | 0.999945 | 6.289863 |
66848f2a-28b3-4d45-9bea-26bf5f684803 | nickwang333/Leetcode | LC 2955. Number of Same-End Substrings.cpp | class Solution {
public:
vector<int> sameEndSubstringCount(string s, vector<vector<int>>& queries) {
vector<int> ret;
int n = s.size();
// aaa: a, a, a, aa, aa, aaa
vector<int> v(26, 0);
vector<vector<int>> dp(n+1, v);
for(int i=0; i<n; i++){
v[s[i]-'a']++... | ALGO | 0.999396 | 5.700535 |
dcb3c781-f922-408a-9144-58aeb3035499 | Ishrak-Tawsif/Accepted-Codes | Ishrakk_Tawsif-ac/UVA/352/14430639_AC_0ms_0kB.cpp | #include <bits/stdc++.h>
using namespace std;
int dx[8]={0,0,1,-1,1,1,-1,-1};
int dy[8]={1,-1,0,0,1,-1,1,-1};
/*#pragma comment(linker,"/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#define sf(nn) scanf ("%d", &nn)
#de... | ALGO | 0.999201 | 3.985227 |
9973d448-eef8-4f04-8917-3dab9b8f4588 | Shubham141102/Coding_Days | days4/arrays/easy/9maxcount.cpp | class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int count = 0;
int maxi = 0;
for(int i=0;i<nums.size();i++)
{
if(nums[i]==1)
{
count++;
}
if(nums[i]!=1)
{
count=0;
... | ALGO | 0.99992 | 6.018514 |
4508b393-47c7-48f3-b4f8-6b485b80957a | rockychowdhury/Data_Structure | Queue/Queue_Using_Singly_LinkedList.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
class myQueue
{
public:
Node *head = NULL;
Node *tail = NULL;
int sz = 0;
void push(int val)
{
sz++;
No... | ALGO | 0.999914 | 4.484933 |
96ce7583-5490-440e-b2c8-bd9b41eee624 | ferryyoga14/UTS-DASAR-PEMPROGRAMAN | BAB III/lintasan.cpp | // program: lintasan.cpp
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double sudut = 40;
double kecepatan = 32;
double radian = sudut * 3.14 / 180;
double jarak = 2 * kecepatan * kecepatan ;
sin (radian) * cos (radian) / 9,8;
cout << "Jarak = " << jara... | ALGO | 0.96972 | 3.703674 |
9f19c3ce-c90a-49f2-8479-1b4d0a9ecdfa | ParasWaghela07/DSA-SUPREME-2.0 | (WEEK 17) TRIES/prefix_suffix_match.cpp | //Approach-1 Brute Force
//T.C : O(n^2 * l)
//S.C : O(n^2 * l)
//lc-3042
class Solution {
public:
bool isPrefixAndSuffix(string &check, string &s) {
int n = check.length();
//You can use fine() function as well
string s1 = s.substr(0, n);
string s2 = s.substr(s.length() - n... | ALGO | 0.999739 | 6.165682 |
947901ee-2a91-4f0b-bcbd-a761174b3d90 | Ahmedkhalid404/codeforces-Solutions | CodeForces/GNU C++20 (64)/66B | Petya and Countryside/184038711.cpp | /*
* author: Ahmed khaled
* */
#include <bits/stdc++.h>
#define ll long long
#define all(x) x.begin(),x.end()
#define Sort(x) sort(all(x))
#define Reverse(x) reverse(all(x))
#define yes cout<<"yes"
#define Yes cout<<"YES"
#define no cout<<"no"
#define No cout<<"NO"
#define ln endl
#define MAX 500
#define tryIt() l... | ALGO | 0.999829 | 4.029073 |
729f55ac-b938-4679-8b0c-2dd4c836ddb9 | OPlincn/SZTU-OJ-OO | 16week二叉排序树/二叉排序树之创建和插入.cpp | #include <iostream>
using namespace std;
struct BiNode {
int data;
BiNode *lchild, *rchild;
BiNode() {
data = 0;
lchild = nullptr;
rchild = nullptr;
}
};
class BiSortTree {
private:
BiNode *root;
public:
BiSortTree(int array[], int arrayLength);
// ~BiSortTree();
... | ALGO | 0.999963 | 5.347208 |
c00a4009-7c9b-41ab-9e5b-39569ea6f1dc | kyoonge/Study | 알고리즘/Programmers/Level0/comparision.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int num1, int num2) {
int answer = 0;
if(num1==num2){
answer=1;
}
else{
answer=-1;
}
return answer;
} | ALGO | 0.999904 | 4.328251 |
af844ba3-5761-4b6a-b74d-97561b62f4a1 | Brnn043/2110211-Intro-Data-Structure | d62_q2c_wasted_space.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int x;
cin>>x;
int n = ceil(log2(x));
n=1<<n;
cout<<n-x;
} | ALGO | 0.999597 | 4.318565 |
4f99d6f2-f3d8-4412-8e83-5b7d9f97b2e2 | Ijiang6/iwork | opengl/QGLObjPro/openGL/glm/test/gtx/gtx_fast_trigonometry.cpp | #include <glm/ext/scalar_ulp.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_trigonometry.hpp>
#include <glm/gtx/integer.hpp>
#include <glm/gtx/common.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/trigonometric.hpp>
#include <cmath>
#i... | TEST | 0.966253 | 6.277224 |
f3b75de3-682e-4873-aaef-b0122fc53192 | honey0632/Leetcode-2024-Daily | 05-26-2024.cpp | // 552. Student Attendance Record II
// https://leetcode.com/problems/student-attendance-record-ii/
#include<bits/stdc++.h>
using namespace std;
class Solution {
private:
static const int MOD = 1000000000 + 7;
public:
int checkRecord(int n) {
vector<vector<int>> prevDP(2, vector<int>(3, 1));
... | ALGO | 0.999924 | 4.62863 |
8be4ba45-87dd-4af8-91cd-07df2e0319cd | IvanDzanija/competitive_programming | AdventOfCode/2024/Day09/02.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <fstream>
#define INF (int)1e9
#define all(x) (x).begin(), (x).end()
#define MOD (int)(1e9 + 7)
using ll = int64_t;
using ull = uint64_t;
using ld = long double;
using namespace __gnu_pbds;
using namespace ... | ALGO | 0.999891 | 4.257912 |
e700f598-446b-4da0-bad3-060a3ace1104 | nodchip/icfpc2021 | libs/boost_1_76_0/libs/graph/example/boost_web_graph.cpp | template < class Distance >
class calc_distance_visitor : public boost::bfs_visitor<>
{
public:
calc_distance_visitor(Distance d) : distance(d) {}
template < class Graph >
void tree_edge(
typename boost::graph_traits< Graph >::edge_descriptor e, Graph& g)
{
typename boost::graph_traits<... | ALGO | 0.999607 | 5.156023 |
145a1eda-355f-4c8b-9cc7-66c685877418 | MeghneelG0/dsa_prep | sorting/selectionSort.cpp | #include <bits/stdc++.h>
using namespace std;
void selectionSort(vector<int>& arr) {
int n = arr.size();
for (int i=0; i<n;i++) {
int min_idx = i;
for (int j=i+1; j < n; j++) {
if (arr[min_idx] > arr[j]) {
min_idx = j;
}
swap(arr[i], arr[min_idx])... | ALGO | 0.999876 | 5.184912 |
15dca486-b886-40e9-af6a-aa2150e4188b | Vdtpro/DSA | Test2.cpp | #include<bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
#define file() freopen("Test2.inp", "r", stdin); freopen("Test2.out", "w", stdout);
#define faster() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pq_min priority_queue<ll, vector<ll>, greater<ll>>
#... | ALGO | 0.99998 | 3.377565 |
256b1045-c2e3-4312-ac92-c4c6f1aa37bd | SahilKumar1792/C---Field | Acenture3.cpp | #include<iostream>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
void ReplaceCharacter(string str,int n,char ch1,char ch2){
if(ch1==ch2){
cout <<"string Unchanged" << endl;
return;
}
for(int i=0;i<n;i++){
if(str[i]==ch1)
str[i]=ch2;
else if(str[i]==ch2){
str[i]=ch1;
... | ALGO | 0.991903 | 3.240658 |
1f02e5c5-5947-4be8-9442-0aa5b12a1988 | GioF71/upmpdcli-plugins | src/smallut.cpp | #define _FILE_OFFSET_BITS 64
#include "smallut.h"
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <string>
#include <utility>
#include ... | TOOL | 0.911878 | 5.905757 |
a56d9731-b5a1-45fe-98e9-bf582a2d0807 | abhijaatgupta/GooberEats | PointToPointRouter.cpp | #include "provided.h"
#include "ExpandableHashMap.h"
#include <list>
#include <queue>
using namespace std;
class PointToPointRouterImpl
{
public:
PointToPointRouterImpl(const StreetMap* sm);
~PointToPointRouterImpl();
DeliveryResult generatePointToPointRoute( //function to generate segment to segment route... | ALGO | 0.992766 | 5.167976 |
3c35670d-9654-48fc-bbb3-6da9c0c43ea9 | ishandutta2007/codeforces | zidder/normal/1637/E.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
void solve(int test_ind){
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i=0;i<n;++i){
scanf("%d", &a[i]);
}
map<int, int> mp;
for (int i: a) mp[i]++;
map<int, set<int> > c; /... | ALGO | 0.999919 | 3.844447 |
99ecacb6-fa57-4651-87bb-5518c108ab3f | ishandutta2007/codeforces | shayan.p/normal/878/D.cpp | // new day,new strength,new thougts
#include<bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define F first
#define S second
#define sz(c) int((c).size())
#define REP(i,n) for(int i=0;i<int(n);i++)
#define REPD(i,n) for(int i=int(n)-1;i>=0;i--)... | ALGO | 0.999897 | 3.10536 |
62c2e470-be80-49c7-a945-368754ac3c81 | cppalliance/cuda-math | test/test_pareto_quan_nvrtc_float.cpp | #define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
#define BOOST_MATH_PROMOTE_DOUBLE_POLICY false
// Must be included first
#include <nvrtc.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <random>
#include <exception>
#include <boost/math/distributio... | ALGO | 0.944311 | 6.418017 |
30bfd0f0-6514-4377-805c-3547ac5e41fa | Thinker28/USACO | 2016-2017/December/Bronze/cowsignal.cpp | // #include <iostream>
// #include <fstream>
// using namespace std;
// char aout[100][100];
// int main(void){
// ifstream fin("cowsignal.in");
// ofstream fout("cowsignal.out");
// int m, n, k;
// fin >> m;
// fin >> n;
// fin >> k;
// // cout << "output\n";
// for (int row = 0; row < m... | ALGO | 0.999588 | 3.097668 |
8b889d57-d4d5-423e-af46-5f2d7f7cbbce | Praveen1116/DS_ALGO | deletion, sorting, double linked list, merging.cpp | // You are using GCC
// WAP to delete an element in a single linked list
/*#include<iostream>
using namespace std;
struct link
{
int data;
struct link *next;
};
struct link *start = NULL, *node, *current;
void create()
{
int n;
cin >> n;
for(int i=0; i<n; i++)
{
node = new link();
... | ALGO | 0.999904 | 4.431668 |
89970568-8bbf-4a35-9b61-ff34c411ce6e | shulp2211/Hisat-TLA | aligner_driver.cpp | #include "aligner_driver.h"
void AlignerDriverRootSelector::select(
const Read& q,
const Read* qo,
bool nofw,
bool norc,
EList<DescentConfig>& confs,
EList<DescentRoot>& roots)
{
// Calculate interval length for both mates
int interval = rootIval_.f<int>((double)q.length());
if(qo != NULL) {
// Boost interv... | ALGO | 0.950154 | 5.358502 |
4630bd44-3d37-49d7-bba2-f364282a68fb | Wild-Donkey/Code | ybt/ybt1150-1199/ybt1173阶乘和.cpp | #include<iostream>
#include<cstring>
using namespace std;
string a;
int A[100005],Answer[100005],X,b,n;
void Times() {
X=0;
for(int i=1;i<=A[0];i++)//öÿһλ
{
A[i]=X+A[i]*b;
X=A[i]/10;
A[i]%=10;
}
A[++A[0]]+=X;
while(A[A[0]]>=10) {
A[++A[0]]+=A[A[0]-1]/10;
A[A[0]-1]%=10;
}
while(A[A[0]]==0&&A[0]>1)
A... | ALGO | 0.999949 | 4.008514 |
5e0d804d-db8f-486b-a86b-80eaecc90cc9 | sarvex/leetcode-assembly | solution/2500-2599/2503.Maximum Number of Points From Grid Queries/Solution.cpp | class Solution {
public:
const int dirs[5] = {-1, 0, 1, 0, -1};
vector<int> maxPoints(vector<vector<int>>& grid, vector<int>& queries) {
int k = queries.size();
vector<pair<int, int>> qs(k);
for (int i = 0; i < k; ++i) qs[i] = {queries[i], i};
sort(qs.begin(), qs.end());
... | ALGO | 0.999968 | 5.984317 |
094cdc40-a2e0-488a-91ca-a2dbe653f7fe | wisdompeak/LeetCode | Recursion/1274.Number-of-Ships-in-a-Rectangle/1274.Number-of-Ships-in-a-Rectangle.cpp | /**
* // This is Sea's API interface.
* // You should not implement it, or speculate about its implementation
* class Sea {
* public:
* bool hasShips(vector<int> topRight, vector<int> bottomLeft);
* };
*/
class Solution {
public:
int countShips(Sea sea, vector<int> topRight, vector<int> bottomLeft)
... | ALGO | 0.999816 | 5.837226 |
c0b1dcf4-21f1-4ed6-bf29-5da48c89aefc | nelhage/graphviz | lib/vpsc/remove_rectangle_overlap.cpp | #include <iostream>
#include <cassert>
#include "generate-constraints.h"
#include "solve_VPSC.h"
#include "variable.h"
#include "constraint.h"
#ifdef RECTANGLE_OVERLAP_LOGGING
#include <fstream>
#include "blocks.h"
using std::ios;
using std::ofstream;
using std::endl;
#endif
#define EXTRA_GAP 0.0001
double Rectangle:... | ALGO | 0.999338 | 5.283598 |
ff608618-33d8-43dc-b1ba-9372a4f7fcf2 | ShivamMaru/LeetCode | 0268-missing-number/0268-missing-number.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
int n = nums.size();
int sum = 0;
for(int i=0; i<n; i++){
sum += nums[i];
}
int original_sum = n*(n+1)/2;
return original_sum - sum;
}
}; | ALGO | 0.999884 | 5.714108 |
45f1817a-5e83-43e4-9892-81bc097dd2f9 | Shounak710/neuralnet_cpp | neural_net.cpp | #include "neural_net.h"
#include "matrix.h"
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
Matrix<double> NeuralNetMLP::int_to_onehot(Matrix<float> y) {
Matrix<double> y_onehot(y.row_count, num_classes);
for(int i=0; i < y.row_count; i++) {
if(y[i].size() == 0) {
cout << ... | DATA | 0.993891 | 4.086594 |
dcc381b9-075e-4e55-817b-e90ade4d7e9c | hfutcgncas/mpl_cpp | Thirdparty/eigen/demos/opengl/quaternion_demo.cpp | #include "quaternion_demo.h"
#include "icosphere.h"
#include <Eigen/Geometry>
#include <Eigen/QR>
#include <Eigen/LU>
#include <iostream>
#include <QEvent>
#include <QMouseEvent>
#include <QInputDialog>
#include <QGridLayout>
#include <QButtonGroup>
#include <QRadioButton>
#include <QDockWidget>
#include <QPushButton... | ALGO | 0.858481 | 5.849781 |
8b49bf2f-7467-453e-bd95-e0a01e22ecfd | Prashantkumar210/GeeksForGeeks | Difficulty: Easy/First Repeated Character/first-repeated-character.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
string firstRepChar(string s) {
vector<bool>nums(26, false);
string ans = "-1";
for(int i=0; i<s.length(); i++){
int index = s[i]-'a'... | ALGO | 0.999472 | 5.609608 |
130f5f3a-f4c1-484d-bdd4-ebee874e495f | stringing/Federated-LLM-Based-APR | RoPGen/src/coding style attacks/author-style-transform/transform/sources/389.cpp | #include <bits/stdc++.h>
using namespace std;
string a,b;
int n;
void little(string x){
string m;
for(int i = 0;i < x.size();i++){
m=x;
if(x[i]!='I'&&x[i]>64&&x[i]<91){
x[i]=m[i]+32;
}
}
}
int main(){
cin>>n;
for(int i = 0;i < n;i++){
cin>>a;
... | ALGO | 0.982539 | 4.033006 |
38a0b26e-1754-44f7-96ca-eafe2e9584af | oudream/leetcode | referto/analysis_of_algorithm/2/2.2.cpp | 集合S中有n个元素,其中的元素可能重复,设计一个算法,计算出S的不同排列。
样例输入:
4
aacc
样例输出:
aacc
acac
acca
caac
caca
ccaa
6
#include <stdio.h>
#include <string.h>
int a[4]={1,1,2,2};
int notExists(int index, int left, int right)
{
int flag=1;
for(int i=left;i<index;i++){
if(a[i]==a[index]){
flag=0;
break;
}
}
return flag;
}
v... | ALGO | 0.999969 | 3.020903 |
d7cccb5f-2645-4268-ad3b-1c93ba422121 | SeungjunHa/algorithm | 10610/a.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
#include <climits>
using namespace std;
#define likely(x) __builtin_expect((x), 1)
#define unlikely(x) __builtin_expect((x), 0)
bool compare(char a, char b)
{
return b < a;
}
int main(v... | ALGO | 0.999953 | 4.263976 |
ee4615b8-df51-4d71-baa2-db9570fde8b6 | hjiang13/LLMs-in-IR | POJ-104/90/581.cpp | #include <iostream>
using namespace std;
//?? - ?????
int sum=0;
int main ()
{
int t,n,m;
int i,j;
int num(int m,int n);
cin >> "%d",&t);
for(i=0; i<t; i++)
{
cin >> "%d %d",&m,&n);
cout << "%d\n",num(m,n));
}
getchar();
getchar();
getchar();
return 0;
}
int num(int m,int n)
{
if(n==1||m==0) return 1;
if(m<n) return nu... | ALGO | 0.999926 | 3.831255 |
535c6126-6747-43c5-b648-d85e09578b80 | Beman/boost-trunk-git-svn | libs/program_options/src/variables_map.cpp | #define BOOST_PROGRAM_OPTIONS_SOURCE
#include <boost/program_options/config.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/value_semantic.hpp>
#include <boost/program_options/variables_map.hpp>
#include <cassert>
namespace boo... | TOOL | 0.901224 | 7.806762 |
94dff8cc-77aa-4229-9784-9b052636ba47 | ia2407-114/112-1-junior-college-C-plus-plus-program | 1111134021/1206/ConsoleApplication4/ConsoleApplication4.cpp | // ConsoleApplication4.cpp : 此檔案包含 'main' 函式。程式會於該處開始執行及結束執行。
//
#include <stdio.h>
#define SIZE 10
void result(int a[SIZE]);
int binarySearch(const int b[], int searchKey, int low, int high);
int main()
{
int a[SIZE] = {},num;
int key = 1;
printf("請輸入10個數字\n");
for (int i = 0; i < SIZE; i++)
{... | ALGO | 0.999856 | 4.186391 |
d4aef914-df28-475c-b696-362de79139b3 | printfErik/InceptionEngine | thirdParty/entt/test/entt/core/algorithm.cpp | #include <array>
#include <vector>
#include <gtest/gtest.h>
#include <entt/core/algorithm.hpp>
struct boxed_int {
int value;
};
TEST(Algorithm, StdSort) {
// well, I'm pretty sure it works, it's std::sort!!
std::array<int, 5> arr{{4, 1, 3, 2, 0}};
entt::std_sort sort;
sort(arr.begin(), arr.end())... | TEST | 0.975698 | 7.310421 |
48a095dc-7e95-44b7-8f98-ea07542a8c41 | simnalamburt/snippets | cpp/log2.cpp | #include <chrono>
#include <iostream>
using namespace std;
using namespace chrono;
static inline uint32_t log2(const uint32_t x) {
uint32_t y;
asm ("bsr %1, %0" : "=r"(y) : "r" (x));
return y;
}
static inline uint32_t log2_slow(uint32_t x) {
uint32_t ret = 0;
while (x >>= 1) { ++ret; }
return ret;
}
int... | ALGO | 0.877597 | 5.679209 |
5619888e-17a6-43cf-a1c5-1c589336d5d5 | Beisenbek/FallPP12021 | week5/g2/15.cpp | #include <iostream>
using namespace std;
int main(){
string s;
getline(cin, s);
string x;
cin >> x;
if(s.find(x) == string::npos){
cout << "not found!" << endl;
}else{
cout << "found!" << endl;
}
return 0;
} | ALGO | 0.999563 | 4.410158 |
fa8b05be-b844-4fdf-adba-13ee7f365843 | YuChainWeng/C-Practice | Others/計算猜數字.cpp | #include "bits/stdc++.h"
using namespace std;
int main (){
while(1){
bool b=1;
cout<<"JƦr:(J0)";
string yous;
cin>>yous;
while(b){
string nows;
cout<<"q:";
cin>>nows;
if(nows.size()==1)b=0;
int counta=0,countb=0;
for(int i=0;i<4;i++){
... | ALGO | 0.98876 | 3.951565 |
7581cdae-e32b-49c2-be7a-6cc175c6521a | Shubham28/CodeChef | RRATING.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#define FOR(A,B,C) for(int A=B;A<C;A++)
#define EFOR(A,B,C) for(int A=B;A<=C;A++)
#define RFOR(A,B,C) for(int A=B;A>=C;A--)
#define MEM(A,B) memset(A,B,sizeof(A))
#define P... | ALGO | 0.999971 | 3.739024 |
1d8517ea-bb4d-4b0e-8029-9fff10ad96a4 | ishandutta2007/codeforces | amoo_safar/normal/1237/B.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " : " << x << '\n'
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef string str... | ALGO | 0.999963 | 3.651306 |
9a6501b5-8eb3-4ee9-ab49-d3ab778b19a9 | memfault/llvm-project | mlir/lib/Dialect/Vector/Transforms/VectorDropLeadUnitDim.cpp | #include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h"
#include "mlir/Dialect/Vector/Utils/VectorUtils.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/IR/TypeUtilities.h"... | TOOL | 0.950615 | 7.940575 |
6bd6a4de-ce9a-4bd9-9a99-92ab25b5fa8c | timothyshull/epicode | cpp/binary_tree_zigzag_level_order_traversal.cpp | #include <cassert>
#include <iostream>
#include <memory>
#include <stack>
#include <vector>
#include "binary_tree_prototype.h"
using std::cout;
using std::endl;
using std::make_unique;
using std::ostream_iterator;
using std::stack;
using std::unique_ptr;
using std::vector;
vector<int> result;
// @include
void print... | ALGO | 0.999799 | 6.30793 |
09da4381-f3b3-4a9b-8ec0-613e57b44302 | colour-y/algorithm-2025_with_coloury | 2025/D_Array_and_GCD.cpp | #include<bits/stdc++.h>
using namespace std;
const char nl = '\n';
typedef long long ll;
typedef long double ld;
using i64 = unsigned long long;
using i32 = unsigned;
using i128 = unsigned __int128;
#define all(x) (x).begin(), (x).end()
vector<ll> minp, primes;
void sieve(ll n)
{
minp.assign(n + 1, 0);
... | ALGO | 0.999924 | 4.381806 |
e51bec01-14d5-4048-94d8-c902b3fe5388 | ericasilvaa/Programando_cpp | ex24.cpp | /*Criar um algoritmo que leia os limites inferior e superior de um intervalo e
imprimir todos os números pares no intervalo aberto e seu somatório. Suponha que
os dados digitados são para um intervalo crescente.*/
#include <iostream>
using namespace std;
int main()
{
int liminferior, limsuperior,... | ALGO | 0.999062 | 3.873736 |
985b6de0-11ce-4a70-85d6-05b040ee3423 | Abhinavtodmal/LEETCODE | 3332-minimum-operations-to-exceed-threshold-value-ii/minimum-operations-to-exceed-threshold-value-ii.cpp | class Solution {
public:
int minOperations(vector<int>& nums, int k) {
int n = nums.size();
priority_queue<long long int, vector<long long int>, greater<long long int>> pq;
for(auto it: nums){
pq.push(it);
}
long long int cnt=0;
while(pq.top()<k){
... | ALGO | 0.999944 | 5.458877 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.