uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0ec41d7d-62fe-4864-93d2-c035124efe72 | AlexSlayer69/LeetCode-Solutions- | 0376-wiggle-subsequence/0376-wiggle-subsequence.cpp | class Solution {
public:
int wiggleMaxLength(vector<int>& nums) {
int n = nums.size();
vector<vector<int>> dp(n,vector<int>(2,1));
for(int i = n-2;i>=0;i--){
for(int j = i+1;j<n;j++){
if(nums[i] - nums[j] > 0){
dp[i][0] = max(dp[i][0],1+dp[j][1... | ALGO | 0.999992 | 5.635007 |
12db3866-b3a5-4202-b85e-46d9a0673c00 | yonsei-hpcp/gcom | third-party/boost_1_86_0/libs/math/example/find_root_example.cpp | // find_root_example.cpp
// Example of using root finding.
// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//[root_find1
/*`
First we need some includes to access the normal distribution
(and some std output of course).
*/
#include... | ALGO | 0.999964 | 4.805835 |
5989a186-6d3c-40cd-befc-49a2bcf7138e | SUPREME-SIVA/helpinghand | packet_handler_example.cpp | #include <iostream>
#include <string>
#include <queue>
#include <chrono>
#include <thread>
using namespace std::string_literals; // For string literal "s"
// Simulated network packet
template<typename PayloadType>
struct Packet {
uint32_t id;
std::string source;
PayloadType payload;
Packet(uint3... | TOOL | 0.897731 | 7.909045 |
af2af5a5-af5b-4ef0-a815-64621f5db8ab | Anantshukla007/Daily-dsa--session | dynamic programming/Knapsackdp/Basic3.cpp | /* We are given “N” rows. Each row has “M” elements; we have to select 1 element from each row.
Once we are done with it final sum of all elements should be as close as possible to K
Analysis :->
N = 5
M = 2
K = 40
{
3 5
5 8
8 8
10 10
11 15
}
Output :-> Abs(sum-K) = (40-40) = 0
*/
#include<bits.stdc++.h>
u... | ALGO | 0.999995 | 3.752473 |
9a253397-621c-4947-b2f0-930126288be1 | EliasFarhan/NekoEngine | externals/assimp-5.0.1/code/Common/SGSpatialSort.cpp | /** @file Implementation of the helper class to quickly find
vertices close to a given position. Special implementation for
the 3ds loader handling smooth groups correctly */
#include <assimp/SGSpatialSort.h>
using namespace Assimp;
// --------------------------------------------------------------------------------... | ALGO | 0.998893 | 6.999963 |
9129af4b-ccb6-451c-85f1-3fb4810fcc6d | oosquare/OI-Codes | Storage/Luogu/P1850-换教室.cpp | #include <bits/stdc++.h>
using namespace std;
namespace IO {
template <typename T = int> T read() {
T x = 0, s = 1;
char c = getchar();
while (c < '0' || '9' < c) {
if (c == '-')
s = -1;
c = getchar();
}
while ('0' <= c && c <= '9') {
x = (x << 1) + (x << 3) + (... | ALGO | 0.999972 | 4.32128 |
c058f87d-9695-47a4-88cb-a6bc7e665095 | noob-nilarghya/Striver-SDE-Sheet | Day-09/subsetSum.cpp | vector<int> ans;
void helper(vector<int>& num, int idx, int n, int sum){
if(idx==n){
ans.push_back(sum);
return;
}
helper(num, idx+1, n, sum+num[idx]);
helper(num, idx+1, n, sum);
return;
}
vector<int> subsetSum(vector<int> &num){
ans.clear();
helper(num, 0, num.size(), 0);... | ALGO | 0.999983 | 6.059104 |
6466e21e-41c2-459d-a1cf-7069c40360b7 | abin02/100DaysOfCode | Day11/11.2_ExcelColumnTileFromInt.cpp | #include <bits/stdc++.h>
using namespace std;
string convertToTitle(int A)
{
string ans;
while (A)
{
ans = char((A - 1) % 26 + 'A') + ans;
A = (A - 1) / 26;
}
return ans;
}
| ALGO | 0.999876 | 5.130891 |
1614f103-e25a-444a-8371-f5f1d42ada08 | HungNguyenBa1811/CTDLGT-PTIT-2024 | 20.DatTen - 1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ed "\n"
#define use(x) freopen(x".inp", "r", stdin); freopen(x".out", "w", stdout);
#define BidenJr 0
int x_4axis[] = {-1, 0, 0, 1};
int y_4axis[] = {0, -1, 1, 0};
int x_8axis[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y_8axis[] = {-1, 0, 1, -1, 1, -... | ALGO | 0.99999 | 3.845043 |
65149277-c44b-4486-b473-b5f54ec5843b | hussamEL-Hwary/my-problem-solving | codeforces/round 211/B.cpp | #include<bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int n,k;
cin>>n>>k;
vector<int>arr(n);
for(int i=0;i<n;++i)
{
cin>>arr[i];
}
long long sum=0;
int f=0,sec=k,pos=0;
for(int i=0;i<k;++i)
{
sum+=arr[i];
}
long long tmp=sum;
while(sec<n)
{
tmp-=arr[f++];
... | ALGO | 0.999993 | 3.816661 |
9c1a07b1-85fa-47c8-873a-101c1d51b245 | VarenytsiaMykhailo/algorithms | technoparkContext/module1/task1/var1/main.cpp | #include <iostream>
/*
Подсчитать кол-во единичных бит в входном числе , стоящих на четных позициях.
Позиции битов нумеруются с 0.
Необходимо использование битовых операций.
Использование арифметических операций запрещено.
Формат ввода:
Входное число лежит в диапазоне 0..2^32-1 и вводится в десятичном виде.
Формат ... | ALGO | 0.999296 | 5.740941 |
74d779c5-689e-4d4e-b0e4-12a68feb25fb | SankalpHub/DRP | ESP32/Aniket_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/reduce_common.cpp | #include "edge-impulse-sdk/tensorflow/lite/c/builtin_op_data.h"
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/quantization_util.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/integer_ops/mean.h"
#include "edge-impulse-sdk/ten... | ALGO | 0.981059 | 7.387085 |
cb9f66ad-b8ce-4184-8b6d-4aa322bec19c | Leepo1/CompetitiveProgramming | 2022PagePracticeContest/lineup.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <vector>
#include <map>
#include <string>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
string names[8] = {"Bessie", "Buttercup", "Belinda", "Beatrice", "Bella", "Blue", "Betsy", "Sue"};
map... | ALGO | 0.999943 | 3.413437 |
f6ce8fcd-047f-4706-929c-31a27853aa4e | remysys/llvm-riscv-backend | llvm-project/mlir/lib/IR/Dominance.cpp | #include "mlir/IR/Dominance.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/RegionKindInterface.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/GenericDomTreeConstruction.h"
using namespace mlir;
using namespace mlir::detail;
template class llvm::DominatorTreeBase<Block, /*IsPostDom=*/false>;
template cl... | ALGO | 0.990535 | 7.281507 |
b454ab56-af5d-4927-8f68-b8843b45a278 | eujuu/Algorithm | 프로그래머스/연습문제_다음큰숫자/다음 큰 숫자.cpp | #include <string>
#include <vector>
#include <bitset>
#include <iostream>
using namespace std;
int check_one(string str) {
int cnt = 0;
for (int i = 0; i < str.length(); i++)
if (str[i] == '1')
cnt++;
return cnt;
}
int solution(int n) {
int answer = n, base_cnt = 0;
string converse = bitset<20>(n).to_string(... | ALGO | 0.999875 | 4.618147 |
66d2362c-2fff-479d-86bd-2568f886f477 | miavgu/gem5-nvmain-tfg | gem5/src/systemc/tests/systemc/misc/synth/gcd/gcd.cpp | /*****************************************************************************
gcd.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999527 | 5.771304 |
533d58f8-4df7-4f94-9f97-a653f3803553 | jojo25126/MyCppSpace | 水仙花数.cpp | #include <iostream>
using namespace std;
int main()
{
int a = 100;
do {
int i = a % 10;
int j = a % 100 / 10;
int k = a / 100;
if (a = (i * i * i + j * j * j + k * k * k))
{
cout << a << "ˮɻ" << endl;
}
a++;
} while (a <= 1000);
system("pause");
return 0;
} | ALGO | 0.9991 | 3.175751 |
eaceef19-1471-4ae6-b687-b41b43083fb1 | keerthivnair/Codeforces-toSpecialist | day12/B_Deque_Process.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
int i = 0;
in... | ALGO | 0.999962 | 3.105782 |
888e1759-6293-4a8c-ae20-cd896aec9a1b | zephyrproject-rtos/lvgl | src/libs/thorvg/tvgLottieModifier.cpp | #include "../../lv_conf_internal.h"
#if LV_USE_THORVG_INTERNAL
#include "tvgLottieModifier.h"
/************************************************************************/
/* Internal Class Implementation */
/************************************************************************/... | ALGO | 0.991724 | 5.511131 |
f433adc7-e452-4f15-8a00-415184565eba | unship/algo | src/main/cpp/dsaa/WordLadder.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <ctime>
using namespace std;
/*
DISTRIBUTION OF DICTIONARY:
Read the words...88984
1 1
2 48
3 601
4 2409
5 4882
6 8205
7 11989
8 13672... | ALGO | 0.99366 | 4.849566 |
938cad6f-f710-4723-b3f9-a32846ac4e52 | Gahzi/HighwayChaser | HighwayChaser/libs/Box2D/Collision/b2CollideEdge.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
// Compute contact points for edge versus circle.
// This accounts for edge connectivity.
void b2CollideEdgeAndCircle(b2Manifold*... | ALGO | 0.999808 | 7.516928 |
a6add9a7-a905-455b-bd20-42472dbf70b1 | halogenOS/android_packages_apps_OTAUpdates | jni/boost_1_57_0/libs/graph/example/parallel-compile-time.cpp | namespace std
{
template < typename T >
std::istream & operator >> (std::istream & in, std::pair < T, T > &p)
{
in >> p.first >> p.second;
return in;
}
}
namespace boost
{
enum vertex_compile_cost_t { vertex_compile_cost };
BOOST_INSTALL_PROPERTY(vertex, compile_cost);
}
using namespace boost;
... | ALGO | 0.999649 | 4.425951 |
c87938c7-ebda-4c30-9a6e-2ba0f239394d | Xushi8/Code | 2023/2023_September/div4 1692/h.cpp | // 2023/09/17 16:45:01
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdint>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <functional>
#include <iomanip>
#include <cmath>
#include <stack>
#include <... | ALGO | 0.999938 | 4.100035 |
7e50d848-9677-40e7-a3ff-0a564bcdf8e6 | raincross7/code-similarity | codes/train_code/problem272/problem272_99.cpp | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
const int INF = 1 << 30;
int main() {
int n;
cin >> n;
vector<int> a(n);
rep(i, n) cin >> a[i];
vector<int> dp(n + 1, INF);
rep(i, n) {
auto itr = lower_bound(dp.begin(), dp.end(), a[i]);
*itr ... | ALGO | 0.999962 | 4.006878 |
36267d96-3464-4869-bbaf-7a4b25abc25e | savagecarol/c- | global round 14/22.cpp | /* code by savagecarol */
#include <bits/stdc++.h>
using namespace std;
/* predefined value */
#define yes() cout << "YES"
#define no() cout << "NO"
#define one() cout << "1"
#define two() cout << "0"
#define ll long long int
#define mp make_pair
#define fi first
#define se second
#define pb push_back
/* loops */
... | ALGO | 0.999947 | 3.62779 |
01f8fad2-bef7-4bc2-a6c7-48768df44b4d | baofuhann/FISCO_BCOS_FL | deps/src/boost/libs/compute/perf/perf_stl_search_n.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | ALGO | 0.980292 | 5.232874 |
a1bf053d-9db9-40d7-a5eb-921ed3432799 | zkywsg/CppPrimer | ch03/ex3_05b.cpp | //separate adjacent input strings by a space.
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main()
{
string str;
for (string buff; cin >> buff; str += (str.empty() ? "" : " ") + buff)
cout << "The concatenated string is " << str << endl;
... | ALGO | 0.942739 | 5.07444 |
ca015a3d-f051-47c4-8d6f-10a6ccd4d47d | hacktheinterview/hacktheinterview | problems/27/footer.cpp | int main() {
int testcases;
cin >> testcases;
for (int t = 0; t < testcases; t++) {
Solution s;
int rows, cols;
scanf("%d %d", &rows, &cols);
vector<vector<int> >matrix;
for (int i = 0; i < rows; i++) {
vector<int> tmp(cols);
for (int j = 0; j < cols; j++) {
scanf("%d", &tmp[j]);
... | ALGO | 0.998736 | 3.940602 |
1a43ad55-9990-43ea-8866-8ebba26f3a76 | LordAngel11/Estructura-de-Datos-y-ALgoritmos-II | UVA/anotherlottery.cpp | #include<bits/stdc++.h>
//Juan Angel López Delgadillo
// UVA 11628 Another Lottery..
using namespace std;
//Función para calcular el máximo común divisor utilizando el algoritmo de Euclides
long long int gcd(long long int a, long long int b) {
return (b == 0) ? a : gcd(b, a % b);
}
int main() {
//Se declar... | ALGO | 0.999347 | 4.89153 |
0119675f-81a4-470f-855b-3e069e579bbb | Neflibatata/CPPThings | learn_class/modern_C++_30/compilercompute/fmap.cpp | //
// Created by light on 20-1-5.
//
#include <iostream>
#include <vector>
using namespace std;
template<
template<typename, typename>
class OutContainer = vector,
typename F, class R>
auto fmap(F &&f, R &&inputs) {
typedef decay_t<decltype(f(*inputs.begin()))> result_type;
OutContai... | ALGO | 0.997099 | 5.600224 |
e08a06ff-71aa-48e3-a931-7d720ce68ac9 | EMiheeva/University_projects | semester_4_labs_Algorithms_and_data_structures_part_2/lab_2_BFS_1/main.cpp | #include <iostream>
#include <cmath>
#include <set>
#include <vector>
#include <cstdlib>
#include <fstream>
#include <queue>
using namespace std;
int N;
vector <int> roots;
vector <vector<int>> graf;
ofstream out("output.txt");
void BFS(int j) {
queue <int> array_roots;
array_roots.push(j);
while (!array_root... | ALGO | 0.999901 | 4.290497 |
893e9a23-2d12-49bb-964e-e5d6c70bfe11 | CJuncheng/CSCode | LeeCode/tree/binary_search_tree/501.FindModeInBinarySearchTree.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <utility> // pair
#include <queue>
#include "binary_tree.h"
using namespace std;
/*
// 使用 umap 和优先级队列
struct CompareMore{
bool operator()(const pair<int, int>& lhs, const pair<int, int>& rhs){
return lhs.second < rh... | ALGO | 0.999993 | 5.220216 |
63a4f947-8d79-47ab-858a-67ffcd39c0c2 | alifalhasan/CP-code-vault | CodeChef/Practice/CHEFQUE - Chef and Queries/34924932.cpp | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
int main()
{
FAST();
int q;
LL a,b,s,x,ans=0,mod=1LL << 32;
vector<bool>v(mod/2LL+1LL,false);
cin >> q >> s >> a >> b;
while(q--)
{
x=s/2LL;
... | ALGO | 0.999977 | 3.550879 |
1500e9b4-ce90-46c3-9e35-cc24a6522401 | debug34ed/Rosetta-indivisual | cc/third_party/eigen/doc/examples/Tutorial_BlockOperations_corner.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::Matrix4f m;
m << 1, 2, 3, 4,
5, 6, 7, 8,
9, 10,11,12,
13,14,15,16;
cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl;
cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << ... | ALGO | 0.99829 | 4.092313 |
c33bfbc6-35c6-4a5c-837f-1dd808053116 | P0L3NARUBA/roblox-2016-source-code | CSG/sgCore/Core/S_DESIGN/PIPE.cpp | #include "../sg.h"
lpNPW c_np_top = NULL, c_np_bottom = NULL;
static BOOL write_cover( lpNPW np, lpMNODE node, AP_TYPE stat );
static BOOL form_np( lpNPW np );
//**********************************************************
BOOL c_tip, // c_tip = TRUE -
ZU;
BOOL pipe_mesh(lpLISTH listh_cross, lpVDIM vdim_path, BOO... | ALGO | 0.863103 | 3.793388 |
bc0707d0-a563-4b95-b414-f692ed0c259c | Neutrino888/LeetCode | LongestSubstringWithoutRepeatingCharacters.cpp | /*this is really really bad, I failed too many times!!*/
class Solution {
public:
int lengthOfLongestSubstring(string s) {
std::unordered_map<char,int> umap;
int max_length=0, left=0, right=0;
for(int i=0; i<s.size(); i++){
auto search = umap.find(s[i]);
// not found... | ALGO | 0.999329 | 5.591117 |
8b96ff27-a548-422e-9cde-ffa3318eb93f | raincross7/code-similarity | codes/train_code/problem060/problem060_210.cpp | #include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define vi vector<int>
#define mii map<int,int>
... | ALGO | 0.999703 | 4.513015 |
eba8bf4f-48cd-4f68-b9de-44d655c3664b | prithuchauhan/DSA | ARRAY/BS on Arrays/lower&upperbounds.cpp | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<bits/stdc++.h>
#include<array>
#include<vector>
#include<string.h>
#include<cmath>
using namespace std;
using lli = long long;
// lowerbound is the smallest index where arr[ind]>=target not smaller.
int bsearchlowerbound(vector<int> v, ... | ALGO | 0.999762 | 4.310497 |
91c71153-b8ed-4dd3-a4cd-a8f1ebc622f5 | XxFiEnDxX/DSA | Binary Search Tree/01_BST_Insertion_&_Build.cpp | #include <iostream>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
data = d;
left = right = NULL;
}
};
node *insertInBST(node *root, int d)
{
if (root == NULL)
{
return new node(d);
}
if (d <= root->data)
{... | ALGO | 0.999918 | 4.569202 |
a68b007d-7167-44ee-86ff-9f3f2d186ef0 | Ilihon/SibSUTIS-Bachelor | 2 семестр/САОД/LabSaod/Lab14.cpp | #include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include "function.h"
int random (int N) { return rand()%N; }
int mp=0, cp=0, rec=0;
main() {
stack *head, *tail;
head=NULL;
tail=(stack*)&head;
int i, n, m;
printf ("Vvedite razmer ocheredi: ");
scanf("%d", &n);
printf ("Vvedite razmer... | ALGO | 0.998333 | 3.708626 |
20a48f90-2979-41f0-ad56-9fff4c7d210f | shashankkestwal/ds | stackArrayFunctions.cpp | #include <iostream>
#include "stackArrayFunctions.h"
using namespace std;
void Stack :: push(int data)
{
if (i < n)
{
arr[i] = data;
i++;
}
else
{
cout << "Stack full" << endl;
}
}
void Stack :: pop()
{
if (i ... | ALGO | 0.879385 | 3.935841 |
24708925-4b0a-459a-89ea-fa8eb593ae67 | zenvite2/DSAA_PTIT | _old C++/daycontangdan.cpp | /*
Cho dãy số a[] có n phần tử là các số nguyên dương khác nhu từng đôi một.
Hãy liệt kê tất cả các dãy con có từ 2 phần tử trở lên của dãy a[] thỏa mãn tính chất tăng dần.
Dãy con tạo được bằng cách lấy ra các phần tử trong dãy a[] nhưng vẫn giữ nguyên thứ tự ban đầu.
Coi mỗi dãy con như một xâu ký tự với các phần ... | ALGO | 0.999849 | 4.960437 |
5c3c041a-73f9-48b7-9fd1-40c4a1d6bc45 | susantabiswas/Software-Interview-Essentials | Leetcode/Two_Pointers/remove-duplicates-from-sorted-array-ii.cpp | /*
https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/
TC: O(n)
SC: O(1)
Iterate throught the array:
for current num, iterate till we have traversed all the duplicates of it.
Then write the element and its duplicate (max 2)
*/
class Solution {
public:
int ... | ALGO | 0.999968 | 6.730464 |
e0af2577-9d13-4fe7-a59a-5912d982cfe4 | AyushPandey003/Dsa | fathersDay/Dsa/Day 18(543. Diameter of Binary Tree)/Solution.cpp | #include <algorithm> // For std::max
#include <iostream> // For example usage
#include <queue> // For example usage (if needed for tree construction)
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr)... | ALGO | 0.999992 | 7.442419 |
a625a793-a1e1-41a5-b3f1-48ad6a90cc0b | asiviero/SuperBiraWorld | Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp | #include <Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <new>
using namespace std;
b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem... | ALGO | 0.963096 | 6.861051 |
88c97441-0918-4770-9b66-6fc1f41a0966 | c1kvoy/OOP14 | graph.cpp | #include "graph.h"
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
Graph::Graph() = default;
Graph::Graph(const Graph &g) : adjList(g.adjList) {}
Graph::~Graph() = default;
void Graph::addRoute(int from, int to, int cost) {
for (const auto &route: adjList[from]) {
if (route[0] ... | ALGO | 0.979467 | 5.049861 |
4fe0fa65-d532-4ca8-9d82-4a66870c8abb | finyle/rank-cf | sum/tedukuri-bfs/grid_game_Astar/eight-puzzle/POJ1077_优化做法_带康托展开.cpp | //Author:XuHt
#include <cmath>
#include <queue>
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 362886;
int fa[N], f[N];
bool v[N];
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int jc[10] = {1,1,2,6,24,120,720,5040,40320,362880};
stru... | ALGO | 0.999969 | 4.583004 |
b8f09c0b-c7dd-4892-801f-9a8969eca834 | themrdemonized/xray-monolith | src/xrGame/alife_communication_manager.cpp | ////////////////////////////////////////////////////////////////////////////
// Module : alife_communication_manager.cpp
// Created : 03.09.2003
// Modified : 14.05.2004
// Author : Dmitriy Iassenev
// Description : ALife communication manager
//////////////////////////////////////////////////////////////////////... | TOOL | 0.880036 | 3.910401 |
d9f7e692-6e75-49d8-9f68-e939c7b5f693 | anu-0035/C-and-Cpp-Programming-Practice | 34.cpp | #include<bits/stdc++.h>
using namespace std;
class distance{
private:
int f,i;
public:
distance(){
this->f=0;
this->i=0;
}
distance(int x,int y){
this->f=x;
this->i=y;
}
friend distance operator + (distance&, distance&);
};
distance operator +(distance d1, distance d2){
distance d3;
d3.f=... | ALGO | 0.993023 | 3.476932 |
e0333936-a1b1-41bd-a9db-ad44fe3297aa | lovestories0eng/LeetCode | 2488. 统计中位数为 K 的子数组/official.cpp | #include "../stdc++.h"
using namespace std;
class Solution {
public:
// 将原始数组做转换,将大于 k 的元素转换成 1,小于 k 的元素转换成 −1,等于 k 的元素转换成 0
inline int sign(int num) {
if (num == 0) {
return 0;
}
return num > 0 ? 1 : -1;
}
int countSubarrays(vector<int>& nums, int k) {
int ... | ALGO | 0.99999 | 5.695141 |
afd63e17-1c17-4566-90ab-0b18c5abed5d | sandeshsingh1/leetcode | 7583-164-109-convert-sorted-list-to-binary-search-tree/7583-164-109-convert-sorted-list-to-binary-search-tree.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) {}
* };
*/
/**
* Definition for a binary tree node.
* struc... | ALGO | 0.999997 | 6.790572 |
d8db0825-fc36-4469-abd9-74487a01965d | jayshri-developer/DataStructures_and_Algorithms | Daily Problem/Recursion/Rat in a Maze Problem - I.cpp | // Approach 1 (recursion)
//gfg link: https://practice.geeksforgeeks.org/problems/rat-in-a-maze-problem/1
// TC: o(4^ n*m)
class Solution{
public:
void findpathhelper(int i, int j, vector<vector<int>> m, int n, vector<string> &ans, string s, vector<vector<int>> vis)
{
if(i == n-1 && j == n-1)... | ALGO | 0.999967 | 6.164308 |
1d8479cc-7e47-4fa0-980e-123a437ef809 | Al-Mahmud-2019331048/CODES | CPP_Own/DS-Lab-1_1/singly_linked_list_class.cpp | #include<iostream>
using namespace std;
struct node{
int val;
node *next;
node(){ //parametrer na pathale 0 diye initialize hbe
val=0;
next=NULL;
}
node(int k){
val=k;
next=NULL;
}
};
struct SinglyLinkedList{
node *head,*tail;
SinglyLinkedList()... | ALGO | 0.998922 | 4.096813 |
7c87525b-7452-4134-b217-e6f1d8e83fdd | salasiya/face-recognition-attendance | opencv-python-4.11.0.86/opencv/modules/photo/src/contrast_preserve.cpp | #include "precomp.hpp"
#include "opencv2/photo.hpp"
#include <cmath>
#include <vector>
#include <limits>
#include "contrast_preserve.hpp"
using namespace std;
using namespace cv;
void cv::decolor(InputArray _src, OutputArray _dst, OutputArray _color_boost)
{
CV_INSTRUMENT_REGION();
Mat I = _src.getMat();
... | ALGO | 0.989365 | 4.186191 |
a40ca374-f77c-4a4b-904b-319e801346ad | hjiang13/LLMs-in-IR | POJ-104/58/555.cpp | #include <iostream>
using namespace std;
/*
* qimofuxi_11.cpp
* ????????C????????
* Created on: 2010-12-18
* Author: william
*/
int main()
{
int n, m, b[1000];
char a[1000][100];
cin>>n;
cin.ignore();
for(int i=0; i<n; i++)
{
cin.getline(a[i],100);
b[i]=strlen(a[i]);
}
for(int j=0; j<n; j++)
{
if(!(a[j][0]=='... | ALGO | 0.998692 | 3.283206 |
244820b8-2690-46db-821d-95911c675875 | KIMHYUNUK98/PPS_2021 | 김현욱/1주차/5_1.cpp | #include <iostream>
using namespace std;
int main() {
int col = 0;
int row = 0;
int mul = 0;
cin >> col >> row;
mul = col * row -1 ;
cout << mul;
return 0;
} | ALGO | 0.998856 | 4.043044 |
32dea28b-3e93-49bf-99f5-92dd68028f55 | snucse-23-baekjoon/solutions | koreanenglishu/13353.cpp | #include <iostream>
#include <vector>
#define SIZE 100
using namespace std;
struct edge {int i, u, v;};
struct match {int i1, i2;};
int N, M, u, v, ord[SIZE];
vector<edge> graph[SIZE];
vector<match> matches;
bool dfs(edge e) {
static int cnt = 1;
ord[e.v] = cnt++;
vector<int> chds;
for (auto f: graph[... | ALGO | 0.999994 | 4.031447 |
23c9f13c-1785-4e5e-9a10-bf26d10a952b | shanthi1710/GFG-CodeCamp-Build-Coding-Habit-in-Just-21-Days | Day_2_Count_the_subarrays_having_product_less_than_k.cpp |
#include <bits/stdc++.h>
using namespace std;
class Solution{
public:
int countSubArrayProductLessThanK(const vector<int>& a, int n, long long k) {
int l=0, r=0, ans=0;
long long prod=1;
for( ; r<n; r++){
prod*=a[r];
for( ; prod>=k; l++){
prod/=a... | ALGO | 0.999708 | 4.280674 |
109bb985-e05b-4f75-a79b-c6603f45a576 | IgorKaan/robofootball | vk_fest_robofootball_goalkeeper_W1/lib/TroykaIMU/GOST4401_81.cpp | #include <GOST4401_81.h>
#include <math.h>
static float _GOST4401_geopotential2geometric(float altitude){
return altitude * GOST4401_E / (GOST4401_E - altitude);
}
static float _GOST4401_geometric2geopotential(float altitude){
return altitude * GOST4401_E / (GOST4401_E + altitude);
}
/**
* Returns geometric alti... | ALGO | 0.977186 | 5.465567 |
b1cfbb09-81fa-476e-8989-87dc2d9d0e57 | ankurrai1/GFG-Solutions | Bit Manipulation/onesCompliment.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
string onesComplement(string s,int N){
for(int i = 0; i < N; i++){
s[i] = s[i] == '0'? '1':'0';
}
return s;
}
};
// the above can achieve by xoring the given no with all set bit no of that no of bit
// fo... | ALGO | 0.999944 | 5.265989 |
89f83f6f-945e-4371-8dab-af2b096a15d8 | shashank9aug/DSA_CB | string/Day17/remove_duplicate.cpp |
//Remove duplicate character from string :
// eg:
// Input: str = abcabc
// Output : str = abc
#include<iostream>
#include<string>
using namespace std;
| ALGO | 0.997515 | 3.612342 |
9053d0e7-1f69-4c31-95f3-d7771bf2c79b | wdeyes/Sword_offer | 44/sequenceOfDigits.cpp | #include<iostream>
#include<cmath>
using namespace std;
int digitAtIndex(int n){
if(n<0)
return -1;
int ret=n;
if(n<10)
return ret;
int nCount=n-9;
int nFacter=2;//两位数
int nSum=180;//两位数占180个位置
while(nCount>nSum){
nCount-=nSum;
++nFacter;
nSum=9*pow(10, nFacter-1)*nFacter;
}
int nStart=pow(10, nFac... | ALGO | 0.999178 | 3.784431 |
26091b32-f1a5-47da-a0fc-04eb907dd824 | Niwaht/cpp_stl_study | STL_C02_02_VectorQuickUnsortRemove.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
template <typename T>
void quick_remove_at(vector<T> &v, size_t idx)
{
if(idx < v.size()) {
v[idx] = move(v.back());
v.pop_back();
}
}
template <typename T>
void quick_remove_at(vector<T> &v, typename vector<T>::it... | ALGO | 0.996026 | 5.532381 |
92e83824-5ea4-4d5a-8c49-6b479836fd2c | marytwtw18/leetcode_pratice | recursion/144_Binary Tree_Preorder_Traversal.cpp | //leetcode easy
class Solution {
public:
//middle left right
vector<int> preorderTraversal(TreeNode* root) {
vector<int> list;
if(root == NULL) return list;
vector<int> left = preorderTraversal(root->left);
vector<int> right = preorderTraversal(root->right);
... | ALGO | 0.999997 | 6.235182 |
2799d15f-9367-409c-9e67-d7ae52c8f1d8 | HunterMahmud/LeetCode | 2085. Count Common Words With One Occurrence.cpp | // url = https://leetcode.com/problems/count-common-words-with-one-occurrence
class Solution {
public:
int countWords(vector<string>& words1, vector<string>& words2) {
int ans = 0;
unordered_map<string, int> result;
for(auto i: words1){
result[i] = 0;
}
for(auto... | ALGO | 0.999753 | 5.90158 |
51510178-a8d8-4bc0-89d9-405de6a5d9c4 | SJTU-ACM/Templates | Spear-of-Longinus/template/mandrake/source/string-manipulation/extended-knuth-morris-pratt.cpp | void solve(char *text, int length, int *next) {
int j = 0, k = 1;
for (; j + 1 < length && text[j] == text[j + 1]; j++);
next[0] = length - 1;
next[1] = j;
for (int i = 2; i < length; ++i) {
int far = k + next[k] - 1;
if (next[i - k] < far - i + 1) {
next[i] = next[i - k]... | ALGO | 0.999861 | 4.273115 |
ee39062b-115a-4b92-a728-7529d4549ebe | notmeet13/x | ProgramList1/P1_10.cpp | /*WAC++P to Find Largest Among 3 Numbers.*/
#include<iostream>
using namespace std;
int main(){
cout<<"NAME : MEET MAKADIYA"<<endl;
cout<<"ERNO : 220130318036"<<endl;
cout<<"PROBLEM : WAC++P to Find Largest Among 3 Numbers."<<endl;
int a,b,c,max;
cout<<"Enter three numbers: ";
cin>>a>>b>>c;
... | ALGO | 0.999514 | 3.858389 |
abf56e59-839d-4e18-90f8-de43a23bcb00 | tomas/inkscape | src/2geom/affine.cpp | /*
* Authors:
* Lauris Kaplinski <<EMAIL>>
* Michael G. Sloan <<EMAIL>>
*
* This code is in public domain
*/
#include <2geom/affine.h>
#include <2geom/point.h>
#include <2geom/polynomial.h>
#include <2geom/utils.h>
namespace Geom {
/** Creates a Affine given an axis and origin point.
* The axis is repres... | ALGO | 0.969174 | 6.538762 |
81dbf5f4-bbb0-4978-89e0-d2bcfa289b91 | ssuljic/codeeval | word_cleaning/main.cpp | #include <iostream>
#include <fstream>
using namespace std;
bool isCharacter(char c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
char toLower(char c) {
if(!isCharacter(c)) {
return c;
}
if(c >= 'a' && c <= 'z') {
return c;
}
return c + 'a' - 'A';
}
int main(i... | TOOL | 0.913849 | 5.309454 |
4f405382-c05b-461e-ba53-2a322d3e3a12 | ishandutta2007/codeforces | rg_gr/normal/886/E.cpp | // Problem: CF886E Maximum Element
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/CF886E
// Memory Limit: 250 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <stdio.h>
#include <string.h... | ALGO | 0.999995 | 4.227602 |
164b18f5-92c0-4328-8162-60c5e98783ce | Michshelle/tags_project | Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.914648 | 7.471897 |
ffbf7957-5057-49df-a8df-1bb3ee80b55d | TahshinSharon/Usefull-Algorithm_Solved-Code | DFS/Contest Problem/LOJ-1094.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long LL
#define MAX 500000
#define MOD 100000007
#define INF INT_MAX
#define LINF LLONG_MAX
#define pi acos(-1.0)
#define F first
#define S second
#define pb push_back
#define mp... | ALGO | 0.999881 | 4.596745 |
14374675-5296-4aba-8c52-c0ddefd25e0a | Pixel-Project-Staging/frameworks_av | media/module/codecs/mp3dec/src/pvmp3_imdct_synth.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_imdct_synth.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
--------------------... | ALGO | 0.999665 | 4.159706 |
9a1b9dd1-7e6b-49cf-a95a-059ff095cf2e | Tabby2109/archivosModificados | control_althold.cpp | #include "Sub.h"
/*****************************************************/
/* Variables nuevas */
/*****************************************************/
//Altitud target
float target_profundidad=0;
//Indica si se hace uso del barometro en ves de la IMU
bool uso_barometro=false;
//Erro... | TOOL | 0.858496 | 5.019654 |
922e9669-a36c-45c4-a907-b3a7c01a6031 | roca12/gpccodes | Resueltos/Diana Morales/CodeChefFLOW001.cpp | import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner lector= new Scanner (System.in);
int T;
int A;
int B;
T = lector.nextInt();
for(int h=1;h<=T;h++){
A = lector.nextInt();
B = lector.nextInt();
System.out.println(A+B);
}
}
}
| ALGO | 0.92584 | 3.558299 |
5f78d561-1ea2-4a5d-8e79-cc24e1efcfbd | zetsux/one-problem-per-day | D404_LeetCode_56/LeetCode_56.cpp | #include <vector>
using namespace std;
class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
sort(intervals.begin(), intervals.end());
vector<vector<int>> res;
int start = intervals[0][0], end = intervals[0][1];
for (int i = 1 ; i < intervals.size() ; ... | ALGO | 0.999999 | 5.894147 |
85acf9ee-5d3d-498b-bc68-ca4e3f02f881 | zendtech/zenddbi | plugin/handler_socket/libhsclient/socket.cpp | // vim:sw=2:ai
#include <my_config.h>
#include <stdexcept>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/un.h>
#include "socket.hpp"
#include "string_util.hpp"
#include "fatal.hpp"
namespace dena {
void
ignore_sigpipe()
{
if (signal(SIGPIPE, SIG_I... | TOOL | 0.904624 | 6.961724 |
f4cd99cf-6589-4afa-8dba-d7f14b9af748 | ravnoorsingh/leetcode-solutions | problems/0086-partition-list/solution.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:
ListNode* partition(L... | ALGO | 0.999996 | 5.344338 |
14d46b50-2c1e-4961-968a-07816b5b3fd2 | thomasxm/Akira-obfuscator | llvm/utils/TableGen/DAGISelMatcherOpt.cpp | #include "CodeGenDAGPatterns.h"
#include "DAGISelMatcher.h"
#include "SDNodeProperties.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
#define DEBUG_TYPE "isel-opt"
/// ContractNodes - Turn multiple matcher node patterns like 'MoveChild+Re... | ALGO | 0.997376 | 3.338469 |
c3172093-9a5b-4c6b-8c28-07089543d4bc | xuancang/codeforces | cf781 div2/b.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int time;
cin>>time;
while(time--)
{
int n;
cin >> n;
map<int,int> m;
for(int i = 0;i<n;i++){
int num;
cin>>num;
m[num]++;
}
int ma = 0;
int ans;
... | ALGO | 0.999971 | 3.575759 |
a9ce45a4-3b95-4d7f-94c0-5e9bfc87441f | eldeshue/PS | LeetCode/2976_solved.cpp |
#include <iostream>
#include <vector>
using namespace std;
// solution class
//#pragma GCC optimize("03")
//#pragma GCC target("avx")
//#pragma GCC target("-fsplit-loops")
class Solution
{
private:
using ll = long long;
static constexpr ll INF = 1e9;
public:
// solution method
long long minimumCost(string sour... | ALGO | 0.999969 | 5.681217 |
fdf29597-9a52-4738-9f7c-76c06e3355ab | ghksgp92/MidnightSun_android | cameraLibrary/src/main/jni/cge/filters/cgeTiltshiftAdjust.cpp | /*
* cgeTiltshiftAdjust.cpp
*
* Created on: 2014-1-24
* Author: Wang Yang
* Mail: <EMAIL>
*/
#include "cgeTiltshiftAdjust.h"
#include "assert.h"
#include <cmath>
#define TEXTURE_BIND_ID 0
static CGEConstString s_fshTiltshiftVector = CGE_SHADER_STRING_PRECISION_M
(
varying vec2 textureCoordinate;
un... | ALGO | 0.978221 | 5.707759 |
2d65a6a2-4b48-43ce-ba3a-95159f854eb8 | GeneYu1998/leetcode | 064/minimum-path-sum.cpp | #include "..\utils.cpp"
class Solution {
public:
int minPathSum(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
for(int i = 0; i < m; ++i)
{
for(int j = 0; j < n; ++j)
{
if(i && j) grid[i][j] += min(grid[i][j - 1], grid[i - 1][j]);
e... | ALGO | 0.999953 | 5.805596 |
7987bd05-600b-434f-96a5-2009d6dbaefb | gddavis21/CarND-Path-Planning | src/Bezier.cpp | #include "Bezier.h"
using namespace std;
BezierCurve::BezierCurve(Vector2D C1, Vector2D C2, Vector2D C3, Vector2D C4)
{
this->C1 = C1;
this->C2 = C2;
this->C3 = C3;
this->C4 = C4;
}
BezierCurve BezierCurve::FromControlPoints(Vector2D C1, Vector2D C2, Vector2D C3, Vector2D C4)
{
return BezierCurve... | ALGO | 0.990003 | 5.198256 |
f78a03aa-8ca2-4e81-9e98-9a771b682517 | renbaoshuo/202402-oop-assignments | 20250411_24上级1/R7-1 友元函数.cpp | #include <iostream>
using namespace std;
class student {
private:
int id;
double score;
public:
student() : id(0), score(0.0) {}
void setInfo(int id, double score) {
this->id = id;
this->score = score;
}
friend double average(student *p, int count);
};
double average(st... | ALGO | 0.991268 | 4.876044 |
82eecdfb-7928-4365-9390-44214be0b48a | ishandutta2007/codeforces | keywet06/normal/1641/C.cpp | #include <bits/stdc++.h>
template <typename Type1, typename Type2>
inline Type1 &Mid(Type1 &x, Type2 y) {
return x < y ? x : (x = y);
}
const int M = 10000005;
struct Node {
int l, r, s;
Node() {}
Node(int L, int R, int S) : l(L), r(R), s(S) {}
};
int Cnt = 0;
Node Seg[M];
int main() {
std::io... | ALGO | 0.999839 | 5.017853 |
8d484d10-3b17-4c1d-8ff3-1e70ba8e8782 | chrisxsolo/Singly-Linked-List | LinkedBag340.cpp | // LinkedBag340.cpp
// Created by: CSC340
/*
===> <===
===> PLEASE ADD CODE <===
===> <===
*/
#include "LinkedBag.h"
#include <cstdlib>
#include <cstddef>
#include <ctime>
#include <iostream>
//#include "Include.h"
//#include "LinkedBagClient340.cpp"
using namespace std;
template<typename ItemType>
bool Lin... | TOOL | 0.973678 | 3.507905 |
65317d43-3c07-4083-9654-d78634a3bf66 | ishandutta2007/codeforces | vepifanov/normal/403/C.cpp | #include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>
#include <cassert>
using namespace std;
#define mp... | ALGO | 0.999989 | 3.914389 |
3f204cce-4ab3-48ed-86bb-cd5356f87d46 | Runarok/GeeksForGeeks-solutions | Difficulty: Medium/Number of Palindromic Substrings/number-of-palindromic-substrings.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
// Function to count the number of palindromic substrings in the string 's'
int numberOfPalindromicSubstrings(string s) {
... | ALGO | 0.999643 | 6.851612 |
d8292093-250e-4b89-bf94-f4b3566fa9e0 | jasminmartin/datastructuresandalgorithms | week6/PlayerTree.cpp | #include "Player.cpp"
class PlayerTree {
public:
Player *root;
PlayerTree() { root = 0; }
void Insert(int level, int kills) {
Player* newNode = new Player(level, kills);
if (root ==0) {
root = newNode;
}
else {
Player* current;
current = root;
Player* parent;
... | ALGO | 0.965522 | 3.287138 |
0fc9a2d1-ac13-4554-a9b0-284549dc20ea | addward/cpp-modern-development | White_belt/coursera_4_function_class.cpp | #include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
class FunctionPart {
public:
FunctionPart(char new_operation, double new_value) {
operation = new_operation;
value = new_value;
}
double Apply(double source_value) const {
if (operation == '*') {
return source_va... | ALGO | 0.998987 | 5.409816 |
03ffee14-53a3-4fe0-9da5-a4eab94e8cb9 | Lynricsy/OIEx | archive/codeforces/CF1534D.cpp | /**************************************************************
* Problem: OJ ProID
* Author: 芊枫
* Date: 2021 Mon Date
* Algorithm:
**************************************************************/
#include <bits/stdc++.h>
#include <cstdio>
#include <set>
#include <system_error>
#include <tr1/unordered_set>
#include... | ALGO | 0.999835 | 3.161165 |
da9662ef-674c-4077-824c-f0cc93e43dfa | ampfibi1/Regular_problem_solve | find_min_op.cpp | //https://codeforces.com/contest/2020/problem/A
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t ; cin >> t ;
while(t--)
{
int n , k , cnt = 0 ; cin >> n >> k ;
bool f = true ;
while(f)
{
int p = log(n)/log(k) ;
n -= pow(k,p) ;
cnt++;
if(n==0) break;
}
cout << cnt << endl... | ALGO | 0.999828 | 3.980237 |
aa40b3a8-288c-4ff5-9bb0-b654e45d618c | sp2005-im/Codeforces-Problems | 791A.cpp | //Sri Rama Jayam
//Problem: 791A (Bear and the Big Brother) Difficulty: 800 Tag(s): implementation
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b; //a -> Limak's Weight; b-> Bob's weight
int n_years = 0; //Number of years it will take for Limak to 'outweigh' Bob
while (true){
a+=2*a;
... | ALGO | 0.999834 | 3.436038 |
50fe320b-a8bd-4bd7-916e-106e47e4eeac | HannahHaensen/DynaMoN | src/lietorch/eigen/doc/examples/Tutorial_PartialLU_solve.cpp | #include <Eigen/Core>
#include <Eigen/LU>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
Vector3f b;
A << 1,2,3, 4,5,6, 7,8,10;
b << 3, 3, 4;
cout << "Here is the matrix A:" << endl << A << endl;
cout << "Here is the vector b:" << endl << b << endl;
Vec... | ALGO | 0.999785 | 3.142099 |
262987e0-9d26-4da5-9a41-1eb2417dba78 | thegeorgehewitt/GEC | GEC_Sem1/Sem1_Week3/Program14_10Numbers/Program14_10Numbers.cpp | #include <iostream>
using namespace std;
int main()
{
int inputNum = 0;
int sum = 0;
float mean = 0.0f;
int numCount = 1;
cout << "Please enter a number: " << endl;
cin >> inputNum;
sum += inputNum;
mean = (float)sum / numCount;
cout << "The sum of your numbers is " << sum << " an... | TOOL | 0.977386 | 3.194088 |
be400228-0082-4efb-aba3-f4c7867ca8b5 | nathanzhu144/practices | workspace/temp2/1304_n_unique_ints.cpp | /* Nathan Zhu Wednesday July 14th, 2020 On road near Manteca. Going to go pick up a barbell from San Francisco
* Deploying golang projects to Heroku is really fun. D:
* Leetcode 1304 | easy | easy
* Category: math
*/
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <sta... | ALGO | 0.989793 | 5.297472 |
c60482e9-ce91-481c-b428-70c8b7e7bbb1 | bergfi/dmc | tests/performance/model_sortedlist.cpp | #include <fstream>
#include <dmc/model.h>
#include <dmc/statespace/listener.h>
#include <dmc/modelcheckers/interface.h>
#include <dmc/modelcheckers/multicoresimple.h>
#include <dmc/modelcheckers/singlecore.h>
#include <dmc/modelcheckers/multicore_bitbetter.h>
#include <dmc/statespace/listener.h>
#include <dmc/storage/i... | ALGO | 0.895174 | 5.928782 |
12df4fd7-5561-4bab-8955-de367219e157 | HARISATATAMa/map | earth_enterprise/src/fusion/portableglobe/partialglobebuilder.cpp | // Methods for pruning away all quadtree nodes that are not at or below
// the given default level or encompassing the given set of
// quadtree nodes.
#include "fusion/portableglobe/partialglobebuilder.h"
#include <algorithm>
#include <fstream> // NOLINT(readability/streams)
#include <iostream> // NOLINT(readability... | DATA | 0.934342 | 6.914139 |
1569fd2b-e02c-48f0-92de-91d7cf3feb30 | 1strating/VA | dependencies/opencv/sources/modules/dnn/src/layers/topk_layer.cpp | #include "../precomp.hpp"
#include "layers_common.hpp"
#include <opencv2/dnn/shape_utils.hpp>
namespace cv { namespace dnn {
namespace {
template<typename T>
class ComparatorGreater {
public:
ComparatorGreater(const T* data, size_t step)
: data_(data), step_(step) {}
void addOffset(size_t offset) {... | ALGO | 0.989561 | 7.606197 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.