uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
37463f8a-c761-4d51-aeb9-d63371c12a2d | bognikol/Smart-Gradients-Photoshop-PlugIn | dependencies/eigen/doc/examples/class_CwiseBinaryOp.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
// define a custom template binary functor
template<typename Scalar> struct MakeComplexOp {
EIGEN_EMPTY_STRUCT_CTOR(MakeComplexOp)
typedef complex<Scalar> result_type;
complex<Scalar> operator()(const Scalar& a, const Scalar& b... | ALGO | 0.95887 | 6.700232 |
17f2cfc2-10da-4b14-a282-d4641a663fee | XiaojianTang/Udacity-Path_Planning-Project | src/Eigen-3.3/doc/examples/tut_matrix_coefficient_accessors.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,2);
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
std::cout << "Here is the matrix m:\n" << m << std::endl;
VectorXd v(2);
v(0) = 4;
v(1) = v(0) - 1;
std::cout << "Here is the vector v:\n... | ALGO | 0.992585 | 3.674276 |
b6f150ec-8a23-4b49-8f4f-292b4b9b6676 | ishandutta2007/codeforces | e869120/normal/764/A.cpp | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#pragma warning(disable:4996)
using namespace std;
int n, m, p, a[100000];
int main() {
cin >> n >> m >> p;
for (int i = n; i <= p; i += n)a[i]++;
for (int i = m; i <= p; i += m)a[i]++;
int cnt = 0;
for (int i = 1; i <= p; i++) { if (a[i] >= ... | ALGO | 0.999832 | 3.422688 |
10b9ca44-7f0b-43a4-809f-e979335d57d6 | Lancelot0902/LeetCode | leetcode/40.CombinationSumII/solution.cpp | #include <iostream>
#include <algorithm>
#include <vector>
void dfs(std::vector<int> &candidates, std::vector<std::vector<int>> &res, std::vector<int> &temp, int target, int begin)
{
if (!target)
{
res.push_back(temp);
return;
}
else if (begin < candidates.size())
{
for (int... | ALGO | 0.999996 | 5.706167 |
d5aa4a5b-5853-4a61-b4b0-9b7073466972 | Acedio/craft | gridmap.cpp | #include <queue>
#include <list>
#include <vector>
#include <set>
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
#include "gridmap.h"
#include "objectmanager.h"
#include "globals.h"
GridMap::GridMap(){
}
GridMap::GridMap(vector<vector<TileState> > omap){
object_map = omap;
}
GridMap::G... | ALGO | 0.95847 | 4.15017 |
9cfcc2fa-7c70-46b0-ac7c-d6bfa2886d34 | ishandutta2007/codeforces | wangzhifang/normal/1312/F.cpp | #include <cstdio>
#include <unordered_map>
#define cs const
#define il __inline__ __attribute__((always_inline))
using namespace std;
typedef unsigned int uint;
typedef cs uint& cu;
typedef long long ll;
typedef unsigned long long ull;
typedef cs ull& cull;
#define max_size 1048576
#define max_n 300000
uint f[max_size+... | ALGO | 0.999846 | 3.290959 |
647892b9-e0e3-43b5-9db6-bf4341943419 | Bis-kunal09/DSnAlgo | 11. Reach a given score - GFG/11.-reach-a-given-score.cpp | // { Driver Code Starts
// Initial template for C++
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll count(ll n);
int main()
{
//taking total testcases
int t;
cin>>t;
while(t--)
{
//taking the score
ll n;
cin>>n;
//calling function count()
cout << count(n) << "\n";
}
r... | ALGO | 0.999323 | 5.704325 |
0a2ff93a-a878-49b8-b210-1d201bddd5e7 | maditya01/Code-snippets | DynamicProgramming/StringDP/regularExpression.cpp | class Solution {
public:
//Pattern * inputString Matrix banani hai
//Now Transition is Important.
//
//ith character * hai to
//.*-> ..*
bool isMatch(string s, string p) {
int n=s.size();
int m=p.size();
vector<vector<bool>> dp(m+1,vector<bool>(n+1,fa... | ALGO | 0.999946 | 4.687096 |
1e9b4b18-cb30-4080-8c9c-b26610dd144e | evialbert/LeetCode | 1420-build-array-where-you-can-find-the-maximum-exactly-k-comparisons/1420-build-array-where-you-can-find-the-maximum-exactly-k-comparisons.cpp | class Solution {
public:
int numOfArrays(int n, int m, int k) {
const int MOD = 1000000007;
vector<vector<vector<long long>>> dp(n + 1, vector<vector<long long>>(m + 1, vector<long long>(k + 1, 0)));
for (int i = 1; i <= m; i++) {
dp[1][i][1] = 1;
}
... | ALGO | 0.999976 | 5.410209 |
7aecf320-764e-41ba-9eea-c2d3eccd3ce6 | dangkhoa1210/SLAM-AND-NAVIGATION-FOR-MOBILE-ROBOT-OUTDOOR-INDOOR- | catkin_ws/src/imu_filter_madgwick/src/stateless_orientation.cpp | #include "imu_filter_madgwick/stateless_orientation.h"
#include <tf2/LinearMath/Matrix3x3.h>
#include <tf2/convert.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
template<typename T>
static inline void crossProduct(
T ax, T ay, T az,
T bx, T by, T bz,
T& rx, T& ry, T& rz) {
rx = ay*bz - az*by;... | ALGO | 0.999512 | 6.986126 |
d24c7169-e0a3-4e1d-9cab-a01947eb8bf4 | Raghav354/Striver-s-A2Z-Sheet | Binary Seach/BS on 1D/lowerBound.cpp | int findFloor(vector<long long> v, long long n, long long x)
{
long long int start = 0, end = n - 1;
int ans = -1;
while (start <= end)
{
long long int mid = start + (end - start) / 2;
if (v[mid] == x)
{
return mid;
}
else if (v[mid] < x)
{
... | ALGO | 0.999961 | 5.556319 |
f5527520-654e-456b-ab91-1cf9f7583cfa | nirbhay-design/sem6-assignments | cryptography-assn/project/code/experiments/FEA2_ChiSq.cpp | #include <iostream>
#include <iomanip>
#include "fea_distinguishers.h"
int main(int argc, char** argv) {
size_t block_size = 8;
size_t nb_rounds = 18;
std::vector<double> thresholds {16.013,16.825,19.465,23.586,29.745};
std::vector<size_t> data { 16, 18, 20, 22, 24};
std::vec... | ALGO | 0.996797 | 6.076297 |
ec2346a4-fea8-485f-a40e-d3444d229cc3 | scotthal/mazes-in-cpp | maze/maze.cpp | #include <queue>
#include <vector>
#include "cell.h"
#include "coordinate.h"
#include "maze.h"
namespace maze {
int Maze::linearize(Coordinate c) { return (c.y * width_) + c.x; }
int Maze::linearize(int x, int y) { return (y * width_) + x; }
Maze::Maze(int width, int height) : width_{width}, height_{height} {
maz... | ALGO | 0.99956 | 5.428257 |
071ff99a-4efa-413c-afae-2770f1088da4 | IceEmblem/LearningDocuments | 学习资料/Windows 平台/windows内核操作/Windows核心编程第五版源码/Windows核心编程源码/16-Summation/Summation.cpp | #include "..\CommonFiles\CmnHdr.h" /* See Appendix A. */
#include <windowsx.h>
#include <limits.h>
#include <tchar.h>
#include "Resource.h"
///////////////////////////////////////////////////////////////////////////////
// An example of calling Sum for uNum = 0 through 9
// uNum: 0 1 2 3 4 5 6 7 8 9 ...
// ... | ALGO | 0.960815 | 5.790086 |
2245465f-5f34-4e31-9859-450181997ad6 | chosh95/STUDY | Codility/MissingInteger.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
int solution(vector<int>& A) {
set<int> s;
for (int i = 0; i < A.size(); i++) {
if (A[i] <= 0) continue;
s.insert(A[i]);
}
int res = 1;
for (auto it = s.begin(); it != s.end(); it++) {
... | ALGO | 0.999701 | 4.755846 |
3e22c728-77e6-46d5-86c9-57489d7b9bd4 | HepLib/GiNaC | check/check_matrices.cpp | /** @file check_matrices.cpp
*
* Here we test manipulations on GiNaC's symbolic matrices. They are a
* well-tried resource for cross-checking the underlying symbolic
* manipulations. */
#include "ginac.h"
using namespace GiNaC;
#include <cstdlib> // for rand(), RAND_MAX
#include <iostream>
using namespace std... | TEST | 0.980561 | 6.685307 |
dd3ac223-1b93-4399-b793-42499de89548 | ash-stark-lm/Codeforces-Soln | 44A - Indian Summer.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fo(i, n) for (int i = 0; i < n; i++)
#define inputarr(arr, n) \
for (int i = 0; i < n; i++) \
cin >> arr[i];
#define endl "\n"
#define ... | ALGO | 0.9996 | 5.378 |
1fd267e8-3583-4d3c-b2e3-08cf7ceda169 | keanemind/algorithm-practice | leetcode/contains-duplicates.cpp | // https://leetcode.com/explore/interview/card/top-interview-questions-easy/92/array/578/
#include <algorithm>
using namespace std;
class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
if (nums.empty()) {
return false;
}
std::sort(nums.begin(), nums.end());
... | ALGO | 0.999935 | 6.103343 |
892f15c1-c4a9-4113-af04-b5722fda3e28 | royvisionlab/Lightsheet-1p | CNMF_E/ca_source_extraction/utilities/graph_conn_comp_mex.cpp | #include "mex.h"
#include <string.h> // for memset
/*
* Computing connected components of an undirected graph - assuming sA is symmetric
*
* Usage:
* [l c] = graph_conn_comp_mex(sA);
*
* Inputs:
* sA - sparse adjacency matrix (for directed graph - does not have to be symmetric)
*
* Outputs:
* l - component... | ALGO | 0.999899 | 6.605669 |
7e550862-59a9-4158-a75d-c21b80dd88dc | ishandutta2007/codeforces | t90tank/normal/1161/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
typedef long long ll;
typedef vector<int> vi;
typedef pair<ll,ll> pll;
const int maxn = 100006;
int n, m;
vi a[maxn];
int p[maxn];
bool same(vi x, vi y) {
if (x.size() != y.size()) return false;
for (int i = 0; i < (int)x.size(); ++i)
... | ALGO | 0.999996 | 4.051672 |
b473c275-4d06-4948-a797-dea670fdde46 | sarvex/leetcode-skip | solution/0900-0999/0983.Minimum Cost For Tickets/Solution.cpp | class Solution {
public:
vector<int> t = {1, 7, 30};
vector<int> days;
vector<int> costs;
vector<int> f;
int n;
int mincostTickets(vector<int>& days, vector<int>& costs) {
n = days.size();
this->days = days;
this->costs = costs;
f.assign(n, -1);
return df... | ALGO | 0.999883 | 5.629135 |
be7e527c-532e-40ae-a7c4-51d26d62e95c | SensorsINI/physical-cartpole | FPGA/CustomIPs/encoder_hls/quadrature_encoder_tb.cpp | #include <iostream>
#include "quadrature_encoder.h"
// Test function
void test_encoder(bool A, bool B, bool reset, int &count) {
quadrature_encoder(A, B, reset, &count);
std::cout << "A=" << A << ", B=" << B << ", Count=" << count << std::endl;
}
int main() {
int count = 0; // This variable will hold the ... | TEST | 0.879084 | 7.003452 |
d07aab36-7cc2-4c1a-97a7-2736c32e3525 | dmop02/AlgoritmosAvanzados570 | Sufix Array/main.cpp | // Como base se uso el codigo del profesor encontrado en una carpeta de sharepoint que lleva a un archivo de replit: https://replit.com/@ertello/Arreglo-de-sufijos?error=overlimit#main.cpp
// Tambien se puede utilizar como referencia las siguients paginas : https://usaco.guide/adv/suffix-array?lang=cpp , https://www.g... | ALGO | 0.994224 | 4.107861 |
3643ecd7-6a0c-4620-9e44-7c40e2f57fc4 | JeetYad07/DSA | basicofprogram/pepcodingquestion/pattern5.cpp | #include <iostream>
using namespace std;
int main(int argc, char **argv){
int n;
cin >> n;
int sp=n/2;
int st=1;
for(int i=1;i<=n;i++){
for(int j=1;j<=sp;j++){
cout<<"\t";
}
for(int j=1;j<=st;j++){
cout<<"*\t";
}
... | ALGO | 0.999959 | 4.132002 |
3a16345c-9982-4b95-b6a7-cd39742e91c8 | SmileYik/AlgorithmProblem | leetcode/300 - Longest Increasing Subsequence.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <vector>
typedef long long ll;
using namespace std;
/**
* LIS:
* A = A_1, A_2 ... A_n
* f(i) is the longest increasing subsequence size of A_1 to A_i(include A_i)
* f(i) = max{ f(1), f(2), ... , f(i - 1), 1 }
... | ALGO | 0.999911 | 5.030922 |
31be6e99-8baf-4e9f-9871-c4221472cbf5 | xiaoyeaichif/SuanFa_study | 常见算法的汇总/06流式处理字符串.cpp | #include<iostream>
#include<vector>
#include<string>
#include<sstream>
using namespace std;
int main_input06() {
//ȡԶŷַָ
/*
* str = "yejie,nihao,nizaina"
* Ҫyejie nihao nizaina
*/
string str;
getline(cin, str);
//ʹַǰ
istringstream ss(str);//ʹ stringstream ss(str)ҲǿԵ
vect... | TOOL | 0.983793 | 3.905174 |
9ec3601c-3f5b-4dc9-af7d-419e416a353c | norkish/CS_1181_cpp | f23/ch10/candyBowl2.cpp | #include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
void printVector(const vector<string>& v){
// int i = 0;
// while(i < v.size()){
// cout << v[i] << endl;
// i++;
// }
for (int j = 0; j < v.size(); ++j) {
cout << j << ". " << v[j] << endl;
}
cou... | TOOL | 0.918281 | 4.631031 |
6b9ff0fb-dcd0-4075-bfed-ffa59af8770a | kamalnathdhekwar/competitive-programming | test.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int removeDigitsToMakeDivisibleBy25(const string& s) {
int n = s.size();
int ans = n;
// Iterate over all possible pairs of digits to remove
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n... | ALGO | 0.997389 | 6.45078 |
cd769dab-e2ad-4cc0-94a0-51b4d4df1d3f | metal0-1/AVIARDRD36 | 03.04.2019/Task08.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
#include <functional>
#include <queue>
using namespace std;
int main() {
int time, M, X;
priority_queue<long long, vector<long long>, greater<long long>> station;
scanf("%d %d", &M, &X);
for (int i = 0; i < M; i++)
{
scanf("%d", &time);
if (station.size(... | ALGO | 0.999988 | 4.143611 |
f7139657-a8ba-491d-b50a-d127e6e60ccb | Rudy451/cpp_primer | ex3.1.cpp | #include <iostream>
using std::cin; using std::cout; using std::endl;
int main(){
int i = 50, j = 0;
while(i <= 100){
j += i;
i++;
}
cout << j << endl;
int k = 10;
while(k >= 0){
cout << k << endl;
k--;
}
int l, m;
cout << "Please enter two numbers: " << endl;
cin >> l >> m;
if(l < m){
w... | TOOL | 0.994985 | 3.127745 |
2fac684a-67d1-4984-be15-f33dc1611551 | gdut-yy/leetcode-hub-java | lanqiao/src/main/java/lq250419/LQ250419T5.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
void solve() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
if (n > 3000) {
cout << 0 << endl;
return;
}
ll ans = 1;
for (int i ... | ALGO | 0.99999 | 4.513471 |
11627ab1-b879-4842-a5ef-4b8f770be9b2 | leegao/bionic-vulkan-wrapper | src/amd/addrlib/src/core/coord.cpp | // Coordinate class implementation
#include "addrcommon.h"
#include "coord.h"
namespace Addr
{
namespace V2
{
Coordinate::Coordinate()
{
dim = DIM_X;
ord = 0;
}
Coordinate::Coordinate(enum Dim dim, INT_32 n)
{
set(dim, n);
}
VOID Coordinate::set(enum Dim d, INT_32 n)
{
dim = d;
ord = static_cast... | ALGO | 0.937402 | 5.469735 |
b81bbc51-c9f3-4307-9f40-6be4ac5a2c46 | 06suraj/GeekforGeeks-And-Leetcode | 887. Super Egg Drop(leetcode).cpp | class Solution {
public:
int dp[101][10001];
int solve(int e,int f){
if(e==1)return f;
if(f==1 or f==0)return f;
if(dp[e][f]!=-1)return dp[e][f];
int mi=INT_MAX;
int l=1,r=f,k;
while(l<=r){
k=l+(r-l)/2;
int low,high;
if... | ALGO | 0.999988 | 5.472744 |
514488f1-f19e-47c2-b6f1-3020035b7bec | kevinfrancis/practice | conversions/roman_to_decimal.cpp | #include <iostream>
#include <map>
/**
* Convert a roman numeral to decimal
* Assume input is a valid roman-numeral
*/
std::map<char, int> roman_value_map;
int roman_to_decimal(std::string roman)
{
int total = 0;
int prev_symbol_value = 0;
for (int i=0; i < roman.length(); i++) {
int valu... | ALGO | 0.99946 | 6.824544 |
46b306c9-76b8-47be-a66f-17e332968bec | Yash-Adhiya/Algorithms | NInja's Training/ninjastraining(Memoiazation).cpp | // recursion solution used memoiation
int f(int day, int last, int n, vector<vector<int>> &points,vector<vector<int>> &dp){
if(day == 0){
int maxi = 0;
for(int i = 0;i<3;i++){
if(i!=last) {
maxi = max(maxi,points[0][i]);
}
}
return dp[0][las... | ALGO | 0.999709 | 5.986125 |
5b178584-8a32-4899-a2d1-4554c669708e | heyumin2018-jp/ncnn | src/layer/arm/interp_arm.cpp | #include "interp_arm.h"
#include <math.h>
#if __ARM_NEON
#include <arm_neon.h>
#endif // __ARM_NEON
namespace ncnn {
#include "interp_bilinear.h"
#include "interp_bicubic.h"
#include "interp_bilinear_bf16s.h"
#include "interp_bicubic_bf16s.h"
#if __ARM_NEON
#include "interp_bilinear_pack4.h"
#include "interp_bicubi... | ALGO | 0.986927 | 6.540258 |
a461878b-6080-4af3-9f24-a050f603be3b | prodhan2/codeforce.Sujan-prodhan | taxi.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
// int sum=0,n,i;
// cin>>n;
// int m,k,a[n];
// for(i=0;i<n;i++)
// { cin>>a[i];
// sum=sum+a[i];
// }
// if(sum%2==0)
// { m=sum/4;
// if(m%2==0)
// cout<<m+1<<endl;
// else
// cout<<m<<endl;
//
// }
// else
// { k=sum/4;
// cout<<k+1<<e... | ALGO | 0.999699 | 3.174566 |
adb3b56e-a518-4488-a85d-4223c7d3074f | shubhamkanade/cpp-program | predict the output all/predict the output on operator overloading/5.cpp | #include<iostream>
using namespace std;
class Demo
{
public:
void fun(int i) const
{
cout<<"first defiantion";
}
void fun(int j)
{
cout<<"second defiantion";
}
};
int main()
{
const Demo obj;
Demo obj1;
int i=10;
obj.fun(i);
obj1.fun(i);
return 0;
}
| TOOL | 0.986099 | 5.086673 |
d227ee98-d841-4aa3-9da8-4b7c43334f35 | JawadSher/DSA-LeetCode-GFG-Problems-Repository | 08 - Strings and Characters Problems/16 - Recursively Remove All Adjacent Duplicates/main.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
private:
string removeAdjecent(const string& s){
string unique_s;
int i = 0;
while(i < s.length()){
if(s[i] == s[i+1] && i+1 < s.length()){
while(s[i] == s[i+1] && i... | ALGO | 0.999837 | 5.843528 |
d490d281-c701-40bd-834e-fb0b9236d2d6 | Ashwin-Dotwal/DSA-ALL-TOPIC | sorting/insertionsort.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int>arr{10,4,5,8,9,4,1};
int n=arr.size();
for(int i=0;i<n;i++){
int val=arr[i];
int j=i-1;
for(j>=0;j--;){
if(arr[j]>val){
arr[j+1]=arr[j];
}
else{
b... | ALGO | 0.999987 | 4.350481 |
7c4a0297-8e29-4042-85cc-35f7efa4e5e7 | kdudka/fss | src/SatSolver.cpp | #include <time.h>
#include <iostream>
#include <iomanip>
#include <list>
#include <vector>
#include <set>
#include "fssIO.h"
#include "SatProblem.h"
#include "SatSolver.h"
namespace FastSatSolver {
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | ALGO | 0.966016 | 5.562003 |
d84d3059-7448-4fc4-8dd6-aa13f2b199e6 | wyy-cc18/opencvSourceCode | modules/dnn/src/int8layers/softmax_layer.cpp | #include "../precomp.hpp"
#include "layers_common.hpp"
#include "../op_timvx.hpp"
#include <algorithm>
#include <stdlib.h>
namespace cv
{
namespace dnn
{
class SoftMaxLayerInt8Impl CV_FINAL : public SoftmaxLayerInt8
{
public:
float input_sc;
int input_zp;
SoftMaxLayerInt8Impl(const LayerParams& params)
... | ALGO | 0.905496 | 7.287266 |
2a3588f6-5d54-4b4b-8169-ee661472428b | ishandutta2007/codeforces | coderanshu/normal/698/C.cpp | #include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define sz(a) (ll)a.size()
#define F first
#define S second
#define INF 2000000000000000000
#define popcount(x) ... | ALGO | 0.999976 | 3.492971 |
74c1cb43-efae-4384-8e5a-8074616c687a | ChenRD98/C-plusplus | C++提高编程/STL常用容器/map容器/map排序.cpp | #include<iostream>
#include<map>
using namespace std;
class MyCompare {
public:
bool operator()(int v1, int v2)const {
return v1 > v2;
}
};
void test01() {
map<int, int>m;
m.insert(make_pair(1, 10));
m.insert(make_pair(2, 20));
m.insert(make_pair(5, 50));
m.insert(make_pair(3, 30));
m.insert(make_pair(4, 40... | ALGO | 0.999261 | 4.737322 |
29818bd0-8b9d-4e94-9410-c33a301db64e | CCongCirno/MiracleVision | module/roi/basic_roi.cpp | /**
* @file basic_roi.cpp
* @author dgsyrc (<EMAIL>)
* @brief roi
* @date 2024-02-20
* @copyright Copyright (c) 2024 dgsyrc
*
*/
#include "basic_roi.hpp"
namespace basic_roi
{
cv::Rect RoI::makeRectSafeFixed(const cv::Mat &_input_img,
const cv::RotatedRect &_r_rect)
{
... | TOOL | 0.893 | 6.594694 |
06fee7a1-e59f-4bf2-b17d-e9b5cf1e190a | manchalaharikesh/CODES-POTDs | LeetCode/350. Intersection of Two Arrays II.cpp | // DATE: 02-JUL-2024
// Question URL: https://leetcode.com/problems/intersection-of-two-arrays-ii/description/
// Question: 350. Intersection of Two Arrays II
// Description: Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it show... | ALGO | 0.999993 | 6.237934 |
718a0a67-dfe3-49ce-83bc-a191babc8aae | bogdanov-d-a/oop_lab1_t5_n2_crypt | src/Crypt.cpp | // Crypt.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
using namespace std;
const unsigned BYTE_BIT_COUNT = 8;
typedef unsigned ByteBitPosRatio[BYTE_BIT_COUNT];
typedef function<uint8_t(uint8_t)> ConvertByteFunc;
enum class ReturnCode
{
SUCCESS,
INPUT_ERROR,
OUTPUT_ERROR,
BAD... | TOOL | 0.941994 | 5.880216 |
5b2f9562-306f-4c84-ace8-384e287c672f | thanh-nguyen03/CPP-Code | TRR1/FileCodeGki/Xau9Co3Con1LienTiep.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,k,ans = 0;
string s = "";
ll check() {
ll cnt = 0;
for(int i=0;i<s.size();i++) {
if(s[i]=='1') cnt++;
else cnt = 0;
if(cnt>=k) return 1;
}
return 0;
}
void sinh() {
for(int i=s.size()-1;i>=0;i--) {
if(s[i]=='1') s[i]='0';
else {
... | ALGO | 0.999933 | 3.606831 |
e011d305-9b9a-4275-be68-3d1fcd08bac6 | dennisjueni/algolab-2023 | week10/surveillancephotograph/main.cpp | #include <boost/graph/adjacency_list.hpp>
#include <boost/graph/push_relabel_max_flow.hpp>
#include <iostream>
#include <vector>
// Graph Type with nested interior edge properties for flow algorithms
typedef boost::adjacency_list_traits<boost::vecS, boost::vecS, boost::directedS>
traits;
typedef boost::adjacency_l... | ALGO | 0.998976 | 4.548496 |
569c2697-a5c3-48d5-8429-6186dbe6b822 | ishandutta2007/codeforces | sert/normal/327/B.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <ctime>
#include <cmath>
#include <queue>
#define mp make_pair
#define pb push_back
#define fr(i, n) for (int i = 0; i < int(n); i++)
#define ff first
#define ss second
using namespace... | ALGO | 0.999842 | 3.915443 |
409e4461-700e-458a-8de8-2871e57c39ed | srnit/codeon | codechef programs/MMSUM.cpp | #include<stdio.h>
#include<assert.h>
int main()
{ long long int t,s,i,j,n,a[100000],k,z,l,p;
scanf("%lld",&t);
while(t)
{ s=0;k=-10000000000;
scanf("%ld",&n);
assert(n>=2&&n<=100000);
for(i=0;i<n;i++)
{ scanf("%ld",&a[i]);
if(a[i]>k)
k=a[i];
}
for(i =1;i<n;i++)
for(j=0;j<n-i;j++)
{... | ALGO | 0.999715 | 3.110169 |
54989efa-1300-4c89-9f5c-efa31672a48e | CottonCandyZ/Learning-Cpp-with-Cpp-Primer | 09-Sequential-Containers/14.cpp | //
// Created by CottonCandyZ on 2/18/22.
//
#include <list>
#include <vector>
#include <string>
#include <iostream>
int main() {
std::list<char *> list_char{(char *) "hello", (char *) "world"};
std::vector<std::string> vec_str;
vec_str.assign(list_char.begin(), list_char.end());
for (const auto &i: v... | TOOL | 0.955129 | 3.971637 |
f1354958-0dc1-4859-bfa9-6b75aa3c71eb | rnikhori/Daily_code | GCD_efficient.cpp | #include<iostream>
using namespace std;
int GCD(int a,int b)
{
if(a==0)
return(b);
else if(b==0)
return (a);
else
return(GCD(a%b,b));
}
int main()
{
cout<<"GCD of given numbers are"<<GCD(105,7);
return 0;
}
| ALGO | 0.99873 | 3.994017 |
88378a42-c911-4898-80be-0de1f0ae11ed | le4onardo/Competitive-Programming | Project Euler/0070 - Totient permutation.cpp | #include <bits/stdc++.h>
using namespace std;
const int limit =10000000;
int primes[limit]={};
int primesNum=0;
long minN;
long totientMinN;
int tenPows[10];
void findNum(int num, int p, int totientN){
if(num * totientMinN < minN*totientN){
int copy = num;
long numPerm = 0;
while (copy>0) {
... | ALGO | 0.999895 | 5.394456 |
ff0d4cb2-e569-4f68-b564-f04711e953ff | AkshayKohad/Data-Structures-and-Algorithms-GFG | Dynamic Programming/Palindromic patitioning(Tabulation).cpp | class Solution{
public:
bool ispalindrome(string str,int i, int j)
{
while(i<j)
{
if(str[i]!=str[j])
return false;
i++;
j--;
}
return true;
}
int palindromicPartition(string str)
{
// code here
int n = str.length();
int ... | ALGO | 0.999995 | 6.007464 |
146c4329-d123-4912-82b3-a0ae4c389611 | hjiang13/LLMs-in-IR | POJ-104/64/2624.cpp | #include <iostream>
using namespace std;
void main()
{
int n,i,m,j,k=0;
double d,b[100][7]={
0}
,a[10][3]={
0}
,temp[7];
char c[10][3];
cin >> "%d",&n);
for(i=0; i<n; i++)
{
for(j=0; j<3; j++)
{
cin >> "%lf",&a[i][j]);
cin >> "%c",&c[i][j]);
}
}
for(i=0; i<n; i++)
{
for(j=i+1; j<n; j++)
{
d=sqrt((a[i][0]-a[j][0])*(a[i]... | ALGO | 0.999593 | 3.441931 |
897e5358-ad18-415d-8d22-18b88d256621 | indexdothtml/Flutter_Projects | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998799 | 6.776823 |
eff07e21-fc68-48dc-9881-471ce5e58116 | MikelBarajas38/Grindset | codeforces/1999/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
void solve() {
int n;
cin >> n;
int digit_sum = 0;
while(n > 0) {
... | ALGO | 0.999642 | 6.06625 |
21a1d07a-3dd0-4e2d-980a-30e98a509f45 | noushinpervez/Contest | NGPC/4/Oseye Sort.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
char x;
cin >> x;
if(x == 'a'){
for(int i = 1; i <= n; i++)
cout << i << " ";
}
else{
for(int i = n; i >= 1; i--)
cout << i << " ";
}
}
| ALGO | 0.996123 | 3.006454 |
4c32fe35-ae00-4941-af05-cbde829fdd12 | Persian-Prince/OPEN-GL-Tutorials | bresenham_line_generation.cpp | // Line generation using Bresenham's Line Generation Algorithm.
#include <GL/glut.h>
#include <bits/stdc++.h>
using namespace std;
int X0, X1, Y0, Y1;
void display() {
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
int dx, dy, x... | ALGO | 0.978812 | 3.827772 |
5ef77160-5841-4677-a073-5dd56c82638f | utec-poo/tarea-semana-1-3-AlexPocohuanca | ejercicio6/main.cpp | #include <iostream>
#include "Tipos.h"
using namespace std;
int main() {
entero numero;
vector<int> numeroo={};
do{
numeroo={};
cout << "ingrese un numero:";
cin >> numero;
while(numero>0){
int digit;
digit=numero%10;
numero=numero/10;
numeroo.push_back(digit);
}
}while(numeroo.size()!=3);
int pares=0;
int... | ALGO | 0.979892 | 3.627382 |
56fa5da9-397e-4aa8-a42a-3ab2fd7cd53e | cosmicray001/academic | problem_solving/UVA/993/12596251_AC_0ms_0kB.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long int a;
vector <int> v;
int t;
scanf("%d", &t);
while(t--){
scanf("%lld", &a);
if(a == 0) printf("10\n");
else if(a < 10) printf("%lld\n", a);
else{
for(int i = 9; i >= 2; i--){
whil... | ALGO | 0.999794 | 4.063473 |
e7ed70cb-7c23-419b-912f-613d26c5b434 | raju1207gupta/learncpp_local_opps_concept | quick sort a linked list.cpp | // C++ program for Quick Sort on Singly Linled List
#include <iostream>
#include <cstdio>
using namespace std;
/* a node of the singly linked list */
struct Node
{
int data;
struct Node *next;
};
/* A utility function to insert a node at the beginning of linked list */
void push(struct Node** head_ref, int new_data... | ALGO | 0.999998 | 5.681343 |
f0c4967b-d0f0-4eb4-8529-9befbf36cbdf | llouis0622/Baekjoon | CPP/BOJ1978.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int cnt = 0;
int N;
cin >> N;
for(int i = 0; i < N; ++i) {
bool bl = true; // 소수 판별
int A;
cin >> A;
if(A == 1) continue; // 1이면 그대로 진행
for(int j = 2; j <= sqrt(A); ++j) { // 2부터 소수 판별
... | ALGO | 0.99991 | 4.314696 |
35777a0d-c667-4a68-a616-09de33920824 | siludose/ACM-ICPC | other code/kmp.cpp | #include<iostream>
#include<string.h>
#include<cstring>
#include<cstdio>
using namespace std;
void makenext(const char p[],int next[])
{
int q,k;
int m=strlen(P);
next[0]=0;
for(q=1,k=0;q<m;q++)
{
while(k>0&&P[q]!=P[k])
{
k=next[k-1];
}
if(P[q]==P[k])
... | ALGO | 0.9982 | 3.614879 |
6f787f28-0194-4f3f-95b7-5181fd22b137 | parkhwyy/prolang | Test2/test2_q1/test2_q1_2.cpp | // Using integer variables
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
void TempLevel(int convertedValue);
int main() {
while (true) {
int userInput, choice, convertedValue;
cout << "----------------------------------" << endl;
cout << "Please enter th... | TOOL | 0.938052 | 4.501282 |
92eebc12-faf7-44fa-9a18-43aa7b6d88c5 | kaluginpeter/Algorithms_and_structures_tasks | CodeWars/6kyu/Divisor_harmony.cpp | /*
Consider the following:
The divisors of 6 are: 1, 2, 3 & 6 and their sum is 12. Now, 12/6 = 2.
The divisors of 28 are 1, 2, 4, 7, 14 & 28 and their sum is 56. Now, 56/28 = 2.
The divisors of 496 are 1, 2, 4, 8, 16, 31, 62, 124, 248, 496 and their sum is 992. Now, 992/496 = 2.
We shall say that (6,28,496) is a group... | ALGO | 0.999634 | 5.961288 |
6322a35d-ae95-4fed-a83c-566f25f55ead | patricialarsen/simulations_misc | matchup/src/MurmurHashNeutral2.cpp | //-----------------------------------------------------------------------------
// MurmurHashNeutral2, by Austin Appleby
// Same as MurmurHash2, but endian- and alignment-neutral.
// Half the speed though, alas.
unsigned int MurmurHashNeutral2 ( const void * key, int len, unsigned int seed )
{
const unsigned int m =... | ALGO | 0.979653 | 6.072503 |
3f028779-4618-4cc7-93a2-91344b464885 | Gaurav-20/LeetCode-Solutions | 142-linked-list-cycle-ii/142-linked-list-cycle-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
if (head == nullptr || head->next == nullptr) {
return nullptr;
... | ALGO | 0.99984 | 5.81301 |
27e03f53-5c8c-419b-b045-2594db661762 | tuanpa-tpa/Algorithm-DataStructures-Class | SinhKeTiep/THUẬT TOÁN SINH/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int k,n;
int A[100];
bool check;
vector < vector<int> > res;
void sinh() {
int i = n;
while(A[i] == 1) {
A[i--] = 0;
}
if (i >= 1) {
A[i] = 1;
} else {
check = false;
}
}
bool checkDX() {
int i = 1,j = n;
... | ALGO | 0.999965 | 3.671345 |
bc78337a-4f0b-489e-84b1-96fc3a908bf4 | clockfort/amd-app-sdk-fixes | samples/opencl/cl/app/BoxFilter/BoxFilter.cpp | /* ============================================================
Copyright (c) 2009 Advanced Micro Devices, Inc. All rights reserved.
Redistribution and use of this material is permitted under the following
conditions:
Redistributions must retain the above copyright notice and all terms of this
license.
In no eve... | ALGO | 0.988367 | 6.217705 |
cd46aa9a-42d0-4cd9-9de0-f1f27c506462 | srbmaury/Programming | Number Theory/09 modulo arithmetic.cpp | // a is congruent to b under modulo N if the leave
// same remainder when divided by N a ≡ b(mod N)
/*
if
a≡b(mod N)
then
a-b ≡ 0 (mod N)
a-b is divisible by N
if
a*b=c
then
a(mod N) * b(mod N) ≡ c (mod N)
a%N * b%N ≡ c%N
if
a≡b(mod N)
then
a^k ≡ b^k (mod N)
*/
| ALGO | 0.954103 | 3.200078 |
4de2c88b-b959-42b4-98e9-13bb633edead | Iamutkarshkumar/MyCodes | c++/Vector/RotateArray.cpp | #include<iostream>
#include<vector>
using namespace std;
void display(vector<int>& a){
for(int i=0; i<=a.size()-1; i++){
cout<<a[i]<<" ";
}
cout<<endl;
}
void ReversePart(int i , int j , vector<int>& v){
while(i<=j){
int temp =v[i];
v[i]=v[j];
v[j]=temp;
i++;
... | ALGO | 0.999911 | 4.06395 |
036fd773-f00c-4a96-bc53-1d22f5d34a1d | Ash1327/My-Code-Practice-CodeForces | Restore the weather.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long n, k;
cin >> n >> k;
vector<pair<int,int>> v1(n);
vector<int>v2(n), ans(n);
for (int i = 0; i < n; i++) {
cin >> v1[i].first;
... | ALGO | 0.999985 | 3.530207 |
c951b25e-e4bb-4952-8ffd-328f8d377a00 | JaphethLin/nifH_palmscan | src/rdrpmodel.cpp | #include "myutils.h"
#include "rdrpmodel.h"
#include "xdpmem.h"
#include "objmgr.h"
#include "alnparams.h"
#include "pathinfo.h"
void SeqToFasta(FILE *f, const char *Label, const char *Seq, unsigned L);
/***
Typical spec line:
A Duplorna e:/res/.../model1.pssm
B Burksadf /res/.../model2.pssm
Fields:
1. MotifLetter... | ALGO | 0.983063 | 4.235169 |
1fd2fd02-75e1-4964-9654-881cee481aaa | ideahitme/contest | codeforces/366_div2/B/code.cpp | #include <algorithm>
#include <vector>
#include <string>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int main(int argc, char const *argv[])
{
ios::sync_with_stdio(false);
int n;
cin >> n;
int _xor = 0;
for(int i = 0; i < n; i++){
int a;
cin >> a;
_xor = _xor ^... | ALGO | 0.999935 | 3.786796 |
1643f1e0-0c7a-45ed-ace6-2b6a15a11c18 | sudheer0071/dsa | Linked list/singly linked list basics/length-of-loop.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
class Node{
public:
int data;
Node* next;
public:
Node(int data1, Node* next1){
data=data1;
next = next1;
}
public:
Node(int data1){
data = data1;
next = nullptr;
}
};
Node* convertArr2LL(vector<int>... | ALGO | 0.999787 | 5.191978 |
f2ac8b0c-40e4-437f-a82c-839252d4727d | Thiago-Carollo/Ejercicisos-C | Nivel 4 Funciones/Ejercicio 1.cpp | #include <iostream>
#include <math.h>
using namespace std;
//float cubo(float numero)
//{
// float valorCubo;
// valorCubo = numero * numero * numero;
// return valorCubo;
//}
//float cubo(float numero)
//{
// return pow(numero,3);
//}
void cubo(float numero)
{
float valorCubo;
valorCubo = numer... | TOOL | 0.993522 | 3.542979 |
c3022dc1-fe30-4e98-bbba-2f472ff1b771 | mzsuetam/myAiSD | 16_avl_tree.cpp |
// obracanie
// DSW
#include <iostream>
#include <memory> // std::shared_ptr
#include <cstdlib> //required for rand(), srand()
#include <ctime> //required for time()
//#include "15_bst_tree.cpp"
class AVL{
// Drzewo AVL jest zrównoważonym drzewem BST bez duplikatów kluczy (które mogą być implementowane przez ... | ALGO | 0.994131 | 3.806289 |
e27b786f-bf23-4849-8563-98a320183293 | mfkiwl/CassieHardware | src/amber_developer_stack/qpoases_ros/src/Flipper.cpp | /**
* \file src/Flipper.cpp
* \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches
* \version 3.2
* \date 2007-2017
*
* Implementation of the Flipper class designed to manage working sets of
* constraints and bounds within a QProblem.
*/
#include <qpOASES/Flipper.hpp>
BEGIN_NAMESPACE_QPOASES
/**... | TOOL | 0.910249 | 7.701985 |
3fa041c1-9a72-4ac4-8597-867179c7a99b | jombo23/N64-Tools | objtoan8/MathGeoLib/Math/Polynomial.cpp | #include "StdAfx.h"
/** @file Polynomial.cpp
@author Jukka Jylnki
@brief */
#include "Polynomial.h"
#include "MathFunc.h"
MATH_BEGIN_NAMESPACE
int Polynomial::SolveQuadratic(float a, float b, float c, float &root1, float &root2)
{
// ax^2 + bx + c == 0 => x = [ -b +/- Sqrt(b^2 - 4ac) ] / 2a.
///@todo numerical ... | TOOL | 0.966737 | 5.425295 |
5817eb93-4b51-4ade-9323-3d85b4be4d0f | iwtbam/leetcode | code/lt0299.cpp | // https://leetcode-cn.com/problems/bulls-and-cows/
// bulls and cows
class Solution {
public:
string getHint(string secret, string guess) {
vector<int> record(10, 0);
size_t size = secret.size();
int A = 0, B = 0;
for(int i = 0; i < size; i++){
if(secret[i] == ... | ALGO | 0.999954 | 6.732207 |
1b6e7758-eb66-4fd7-8e6e-8849ddf50bce | ankitsamaddar/blind75_cpp_solutions | cpp-basics/27_Palindrome String.cpp | // DATE: 03-07-2023
/* PROGRAM: 27_Palindrome String
Read a sentence/paragraph and check if its palindrome or not
INPUT
abdcdba
OUTPUT
True
EXPLANATION
*/
// @ankitsamaddar @2023
#include <iostream>
#include <cstring>
using namespace std;
bool isPalindrome(char arr[]){
int i = 0;
int j = strlen(arr) - 1;
while (i... | ALGO | 0.999967 | 5.55039 |
ba13905f-bae3-42ad-821a-7d3fffff7aed | mehedynoman11/Cpractises-main | node.cpp | #include <iostream>
using namespace std;
class Node {
public:
int val;
Node* next;
};
int main() {
Node a, b;
a.val = 10;
b.val = 20;
a.next = &b;
b.next = NULL;
cout<<a.val<<endl;
cout<<a.next->val<<endl;
cout<<(*a.next).val<<endl;
return 0;
} | ALGO | 0.975451 | 3.408188 |
36d4ee14-af33-434e-aaaa-d373a6a26785 | tranhieu-bn/flutter-bootcamp | flutter_fqp_project/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.998771 | 6.761023 |
55e47907-f490-4f93-975a-86d1ad048dcb | pavas23/CS-F211 | Labs/Lab10/q03.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
double medianOfTwoSortedArrays(vector<int> a,vector<int> b){
int n = a.size();
int m = b.size();
if(n > m){
return medianOfTwoSortedArrays(b,a);
}
int start = 0;
int end = n;
int realmidinmergedarray = (n+m+1)/2;
w... | ALGO | 0.99997 | 3.934193 |
2db81bb3-eba3-4fa5-9f08-5c069e4bddbe | Dadopur/Kattis-solutions | src/hopping_islands.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <numeric>
#include <cmath>
#include <string>
using namespace std;
struct Bridge_position {
double x_pos, y_pos;
};
/**
* @brief Recursive find of root node for a integer in a collection of (disjoint) sets.
*
* @param parents Ve... | ALGO | 0.999081 | 5.288018 |
813bb9d0-89d1-4e7b-8de9-2ea4ec61179d | LamChiho/Codeforces_exp | 25Feb/906/c.cpp | using namespace std;
#include <iostream>
#include <string.h>
#include<vector>
#include<unordered_map>
#include<unordered_set>
#include <queue>
#include <algorithm>
#include <array>
#include <functional>
#include <string_view>
#include<cmath>
typedef long long ll;
constexpr ll mod=998244353;
void solve() {
int n;... | ALGO | 0.999785 | 5.173841 |
91fca48a-4298-4b9c-b3a0-ac2ced0e9eab | juned9296/Top_100_Codes_of_DSA | P25-Automorphic_number.cpp | #include <iostream>
using namespace std;
// ◾️ Program 25 ⇢ Find the AutoMorphic Number ⇠ ◾️
int isAutomorphic(int n)
{
int square = n * n;
while (n != 0)
{
if (n % 10 != square % 10)
{
return 0;
}
n = n / 10;
square = square / 10;
}
retur... | ALGO | 0.992459 | 4.139951 |
5dec67c9-9fb0-478a-b026-34c88e00a558 | viacoin/viacoin | src/key.cpp | #include <key.h>
#include <arith_uint256.h>
#include <crypto/common.h>
#include <crypto/hmac_sha512.h>
#include <random.h>
#include <secp256k1.h>
#include <secp256k1_recovery.h>
static secp256k1_context* secp256k1_context_sign = nullptr;
/** These functions are taken from the libsecp256k1 distribution and are very ... | TOOL | 0.934169 | 7.063858 |
d2907357-9197-406b-a255-848408a4a6cd | JungMinWoo99/Algorithmic_solution | algorithmic_c++/10942.cpp | #include <iostream>
using namespace std;
/*
* 사용 알고리즘
* 다이나믹 프로그래밍
*/
int arr[2001];//수열
bool table[2001][2001] = { false, };
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N,M;
cin >> N;
for (int i = 1; i <= N; i++) {//수열 입력 받기
cin >> arr[i];
}
//테이블 채우기
table[1][1] = tru... | ALGO | 0.999922 | 4.243212 |
ad9677fb-c95a-45a5-9534-6ad43de24f69 | AlanBinu007/CodeForces-Solutions | 313B - Ilya and Queries.cpp | //4055457 Jul 12, 2013 6:54:18 PM fuwutu 313B - Ilya and Queries GNU C++0x Accepted 109 ms 500 KB
#include <cstdio>
#include <cstring>
int main()
{
char s[100001];
int a[100001], m, l, r;
scanf("%s%d", s, &m);
int len = strlen(s);
a[1] = 0;
for (int i = 1; i < len; ++i)
{
if (... | ALGO | 0.999874 | 3.888079 |
0f5f38f4-f6f9-4b68-a125-b5cd9379463f | samratalamshanto/LeetCode | 148-sort-list/148-sort-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
// ###### Merg... | ALGO | 0.999997 | 5.631957 |
70b20835-7d29-4624-a169-11f9012f2d1b | Swapnil-Parashare/DP | 4] Matrix Chain Multiplication/05) Egg Dropping Problem/1_Limited_Eggs/Extra/3_Unneccessary_Optimization.cpp | #include <iostream>
#include <vector>
using namespace std;
// Optimization in Memoized Code. Not truly worth it.
class Solution1
{
public :
int count = 0;
vector<vector<int>> dp;
int solve(int e, int f)
{
count++;
// Base Condition
if(e == 1 || f == 1 || f == 0)
... | ALGO | 0.999676 | 5.928785 |
afffa939-e407-4984-a916-0e479d25f4b5 | jerry20091103/Teensy_Harmonizer | lib/DaisySP/Dynamics/crossfade.cpp | #include <math.h>
#include "crossfade.h"
#include "../Utility/dsp.h"
#define REALLYSMALLFLOAT 0.000001f
using namespace daisysp;
const float kCrossLogMin = logf(REALLYSMALLFLOAT);
const float kCrossLogMax = logf(1.0f);
float CrossFade::Process(float &in1, float &in2)
{
float scalar_1, scalar_2;
switch(curve... | ALGO | 0.997231 | 4.664042 |
daaa5853-1876-403e-8169-f83a83eb576e | bak3839/baekjoon_cpp | bj17219.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
map<string, string> m; // map<key, value>
string key, value, search;
int N, M;
cin >> N >> M;
for (int i = 0; i < N; i++) {
cin >> key >> value;... | ALGO | 0.999737 | 4.428013 |
7ecf46c2-4df4-4824-ba8a-3648003e46d3 | EXStevens/Res | CppPrimerPlusRes/Chapter 6/cctypes.cpp | // cctypes.cpp -- using the ctype.h library
#include <iostream>
#include <cctype> // prototypes for character functions
int main()
{
using namespace std;
cout << "Enter text for analysis, and type @"
" to terminate input.\n";
char ch;
int whitespace = 0;
int digits = 0;
... | TOOL | 0.922272 | 4.130687 |
87400c37-d96d-440b-9cdb-91d0731822df | GuessEver/ACMICPCSolutions | Gym/100340/J/J.cpp | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define INF 1000000007
#define MP make_pair
#define FI... | ALGO | 0.999996 | 3.754156 |
fce295bb-6ab0-4399-b7c5-da02af821376 | ishandutta2007/codeforces | hyperbolic/normal/818/F.cpp | #include <Stdio.h>
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
long long int a;
scanf("%lld",&a);
if(a==1)
{
printf("0\n");
continue;
}
long long int min = 1, max = a;
long long int pivot = 0;
while(min<=max)
{
long long int h = (min+max)/2;
long long int C = (long long int)(a... | ALGO | 0.999979 | 4.047324 |
e8a2903f-88cf-442e-ba1b-5f6bc2f1bef4 | tanvir-50198/Problem_Solving | code_forces_problem_solve/A_Zhan's_Blender.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,a,b;
cin>>n>>a>>b;
int x=min(a,b);
if(n%x!=0)cout<<n/x+1<<endl;
else cout<<n/x<<endl;
}
}
| ALGO | 0.999792 | 3.491972 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.