uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9789269d-bf37-48e4-a892-31e1e16635b4 | navaljangir/-6Companies30days | Microsoft/imageSmoother.cpp | class Solution {
public:
int getSum(vector<vector<int>>&img , int row , int col){
vector<int> a= {-1 , 1, 0, 0 , -1 , 1 , -1 , 1};
vector<int> b= {0 ,0 , -1 , 1 , -1 , 1 , 1 , -1};
int n = img.size();
int m = img[0].size();
int sum = img[row][col];
int count=1 ;
... | ALGO | 0.999864 | 6.572192 |
138d9b93-06ad-46ee-a55e-9b1cee35bc8c | EagleEyeKestrel/Leetcode | 1401-1500/1408. 数组中的字符串匹配/template的副本.cpp | class Solution {
public:
vector<string> stringMatching(vector<string>& words) {
vector<string> res;
int n = words.size();
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i != j && words[j].find(words[i]) != string::npos) {
res.p... | ALGO | 0.999842 | 5.497901 |
1b52ad84-60d4-4384-a4da-960748bb99ac | BetterOIer/competitive-cpp-code-backup | Competition/Competition7/A.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int arr[100005];
int val[100005];
int search(int key,int stop,int start){
for(int i=start;i<stop;i++){
if(arr[i]==key){
return i;
}
}
return -1;
}
signed main(){
int n;
cin >> n;
for(int i=0;i<n;i++){
... | ALGO | 0.999873 | 3.886561 |
5ba66916-40df-48af-ae79-f512ed6d49fe | vamshinenavath/Plag_Checker | testcases_phase2/hogwarts/polymorph.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
struct NNmaker {
NNmaker(std::vector<std::vector<int>> __v) : v(__v) {
cum = v;
for (int i = 0; i < v.size(); i++) {
for (int j = 0; j < v[i].size(); j++) {
if (i > 0) cum[i][j] += cum[i - 1][j]... | ALGO | 0.999902 | 4.409492 |
794cdfe5-ce33-44c1-a4e0-13cf9058180e | thanhdat317/code-c-ptit | c03013.cpp | #include<stdio.h>
int main(){
long long A[100];
int n;
scanf("%d", &n);
A[0]= 0, A[1]= 1;
for(int i =2 ; i<= n ; i++){
A[i]= A[i-2]+ A[i-1];
}
for(int i = 0 ; i< n ; i++){
printf("%lld ", A[i]);
}
}
| ALGO | 0.999832 | 3.141115 |
5d97de3b-dc38-4fb0-bb0f-7322458b618e | ishandutta2007/codeforces | antoine/normal/1336/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;
vector<int> a[3];
ll sq(ll x) {
return x * x;
}
ll f(int x, int y, int z) {
return sq(x - y) + sq(y - z) + sq(x - z);
}
void f() {
{
int n[3];
for (int &x:n)
... | ALGO | 0.999972 | 4.840051 |
6462187a-097e-48a5-8ed4-24fd51417538 | ishandutta2007/codeforces | galen_colin/normal/1506/F.cpp | #include <bits/stdc++.h>
using namespace std;
/*
find my code templates at https://github.com/galencolin/cp-templates
also maybe subscribe please thanks
*/
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end());... | ALGO | 0.999948 | 3.603547 |
b671a672-e2c9-4f0e-bb58-4d7fcedb93d7 | Anshul407/LeetCode | 1567-maximum-number-of-vowels-in-a-substring-of-given-length/1567-maximum-number-of-vowels-in-a-substring-of-given-length.cpp | class Solution {
public:
int maxVowels(string s, int k) {
int i=0,j=0;
int ans=0;
unordered_map<char,int>mp;
int v=0;
mp['a']=1;mp['i']=1;
mp['e']=1;mp['o']=1;
mp['u']=1;
while(j<s.size()){
if(mp[s[j]]==1){
v++;
... | ALGO | 0.999991 | 6.114742 |
5bce2d66-86f6-4bad-a079-2e8252063d8d | Sakshamchawla19/DSA | 23_LinkedLists/8DeleteNodes.cpp | //Delete Nodes
#include<iostream>
using namespace std;
class node{
public:
int data;
node*next;
//constructor
node(int d){
data = d;
next = NULL;
}
};
void insertAtTail(node* &head, int data){
if(head == NULL){
head = new node(data);
return;
}
node* ... | ALGO | 0.999932 | 4.857111 |
296e2649-2e3e-4115-adb1-03f9a238c472 | eunnbi/algorithm | dynamic programming/leetcode/279.cpp | int dp[10001];
int numSquares(int n){
int min;
dp[0] = 0; // base case
for (int i = 1; i <= n; i++){
min = i;
for (int j = 1; j * j <= i; j++){
if (min > dp[i - j * j]) min = dp[i - j * j];
}
dp[i] = min + 1;
}
return dp[n]; // answer case
}
/*
dp[i]
= ... | ALGO | 0.999964 | 5.412434 |
683372fb-0e8c-46ed-9925-3edef9240ed4 | saniaahmad6/cppOLD | Questions/matches.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int num;
cin>>num;
vector <vector<int>> initial{
{0,6},{1,2},{2,5},{3,5},{4,4},
{5,5},{6,6},{7,3},{8,7},{9,6}
};
int arr[num][3];
for(int i{};i<num;i++){
cin>>arr[i][0]>>arr[i][1];
arr[i][3]=arr[i][0]+arr[... | ALGO | 0.999922 | 3.504349 |
968229e8-7114-4cac-931c-fb8925294f67 | final-venture/cp | cses/1093.cpp | // moddiv Cheese Method
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define all(x) (x).begin(), (x).end()
#define pb(x) push_back(x)
#define EPS 1e-9
#define MOD 1000000007
void init()
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", st... | ALGO | 0.999989 | 5.486515 |
1e77d7c6-5caa-4d40-89bd-9da6f53cc021 | saidul-07/ProblemSolving | Codeforces/Codeforces Round 983 (Div. 2)/B_Medians.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast() ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vll vector<ll>
#define vs ... | ALGO | 0.999615 | 4.261487 |
448440f0-9a5a-4580-918b-e5132513bd0c | alinzai/learn_boost_stl | stl/adjacent_find.cpp | #include <iostream>
#include <assert.h>
#include <algorithm>
#include <vector>
using namespace std;
class TwiceOver{
public:
bool operator()(int val1, int val2)
{
return val1 == val2/2?true:false;
}
};
int main()
{
int ia[] = {1,4,4,8};
vector<int> vec(ia, ia+4);
int *piter;
vector<int>::iterator i... | TEST | 0.971857 | 4.731769 |
a8025c00-c1cd-4764-b418-1bb35c4ba7a4 | infriend/OJ-Practice | OJNJUSoft/ProblemSet1/1-12.cpp | //
// Created by infriend on 2022/2/21.
//
#include <bits/stdc++.h>
using namespace std;
struct partytime{
int time;
char type;
bool operator<(partytime p){
return time-p.time < 0 || (time-p.time == 0 && type > p.type);
}
};
int main(){
int t, n;
partytime parray[10010];
cin >> t;
... | ALGO | 0.999787 | 3.563293 |
6da2f2f5-6507-493a-aadb-38be828adb5e | foryearslater/template-cpp | 动态规划模板/线性dp/最长上升子序列模板.cpp | #include <bits/stdc++.h>
using namespace std;
#define long long int
#define N 100010
int a[N],f[N],b[N];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
/*朴素
for(int i=0;i<n;i++){
f[i]=1;
for(int j=0;j<i;j++)
if(a[i]>a[j]) f[i]=max(f[i],f[j]+1);
}
int res=0;
for(i... | ALGO | 0.999947 | 4.312088 |
965ed6d4-f85c-4264-9d0e-8ac867f681b9 | Sajalthehacker/-CrackYourInternship | 0217-contains-duplicate/0217-contains-duplicate.cpp | class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
set<int> stt;
for(int it : nums)
if(stt.find(it) == stt.end()) stt.insert(it);
else return true;
return false;
}
}; | ALGO | 0.999241 | 5.621092 |
0f720346-ad99-4e46-9796-9660f0c17dbc | ajbatth/LeetCode-Submissions | 309-best-time-to-buy-and-sell-stock-with-cooldown/309-best-time-to-buy-and-sell-stock-with-cooldown.cpp | class Solution {
private:
int maxP(vector<int>&prices,int idx,bool bought,int bought_price,vector<vector<int>>&dp){
int n=prices.size();
if(idx>=n-1){
if(idx==n-1 && bought) return prices[idx]-bought_price;
// if(idx==n-1 && !bought) return 0;
return 0;
}
... | ALGO | 0.999958 | 5.901578 |
7afb67fc-0500-4941-b930-8632ef699a05 | DuNai0524/algorithm_solving | SCAU2023/T11.cpp | #include <iostream>
#include <string>
using namespace std;
string s;
int ans = 0;
void backTrace(int left,int right,string cur,int index){
if(index > s.size())return;
if(left == 0 && right == 0) {
ans++;
return;
}
if(left > right)return;
if(s[index] != '*'){
if(s[index]=='(... | ALGO | 0.999561 | 3.513696 |
e19ee7d1-8c41-4f40-b4da-ab34f0013032 | ysk24ok/leetcode-submissions | 0438/sliding_window.cpp | #include <string>
#include <unordered_map>
#include <vector>
#include "gtest/gtest.h"
using namespace std;
class Solution {
public:
vector<int> findAnagrams(string s, string p) {
unordered_map<char, int> count;
for (const char& c : p) { count[c]++; }
vector<int> ret;
const size_t m = s.size(), n =... | ALGO | 0.999795 | 6.767329 |
6c1dacc6-e922-4942-9d05-2159407675e5 | agorodetskiy/technopark | algo/module_2/algo_5/main.cpp | /* Дана последовательность целых чисел из диапазона (-10^9 .. 10^9). Длина последовательности не
больше 10^6. Числа записаны по одному в строке. Количество чисел не указано.
Пусть количество элементов n, и числа записаны в массиве a = a[i]: i из [0..n-1].
Требуется напечатать количество таких пар индексов (i,j) из [0..... | ALGO | 0.999681 | 4.404999 |
45d4a36f-b9cf-451d-b04d-0ba3a00d1b6c | Jimmyjean1108/Localization-of-Self-Driving-Car-using-EKF-Sensor-Fusion | src/ekf.cpp | #include "robot_localization/ekf.h"
#include "robot_localization/filter_common.h"
#include <XmlRpcException.h>
#include <iomanip>
#include <limits>
#include <sstream>
#include <vector>
namespace RobotLocalization
{
Ekf::Ekf(std::vector<double>) :
FilterBase() // Must initialize filter base!
{
}
Ekf::~E... | ALGO | 0.990502 | 3.451829 |
9bfbbd56-faf4-44c8-bcec-13c56c68a13d | XJTUIMISS/DP-DICE-Bino | DP_DICE/FHEOffline/Verifier.cpp | #include "Verifier.h"
template <class FD, class S>
Verifier<FD,S>::Verifier(const Proof& proof) : P(proof)
{
#ifdef LESS_ALLOC_MORE_MEM
z.resize(proof.phim);
z.allocate_slots(bigint(1) << proof.B_plain_length);
t.resize(3, proof.phim);
t.allocate_slots(bigint(1) << proof.B_rand_length);
#endif
}
template <cla... | ALGO | 0.933348 | 6.007515 |
efaa6c49-136a-4300-a96f-1ccb438c3d73 | khaledsliti/CompetitiveProgramming | Codeforces/CF1711/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;
void solve() {
int n;
cin >>... | ALGO | 0.999969 | 4.648533 |
0a574b64-606d-42d4-8c21-6fc7066ff030 | 2605govind/Data_Structure_And_Algorithms- | Day99/1_Maximum_Nesting_Depth_of_the_Parentheses.cpp | #include<iostream>
using namespace std;
class Solution {
public:
int maxDepth(string s) {
int count = 0, ans = 0;
for(char x : s) {
if(x == '(') {
count++;
} else if(x == ')'){
count--;
}
ans = max(ans, count);
... | ALGO | 0.999226 | 5.262913 |
07d932b9-49cf-4cef-bf67-e50f340e499c | BombzpakisULTD/Tavern-Tavern | main.cpp | #define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <cassert>
#include "utils.h" // viskas ten
#include "main.h"
int wall_x_texcoord(const float hitx, const float hity, const Texture &tex_walls) {
float x = hitx - floor(hitx+.5); // x and y contain (signed) fractional parts of hitx and hity,
... | ALGO | 0.947002 | 5.488716 |
e6cd6307-53ef-4794-be27-af9a48dcff7b | Lewuathe/mlir-hello | thirdparty/llvm-project/compiler-rt/lib/scudo/standalone/crc32_hw.cpp | #include "checksum.h"
namespace scudo {
#if defined(__CRC32__) || defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
u32 computeHardwareCRC32(u32 Crc, uptr Data) {
return static_cast<u32>(CRC32_INTRINSIC(Crc, Data));
}
#endif // defined(__CRC32__) || defined(__SSE4_2__) ||
// defined(__ARM_FEATURE_CRC32)
#... | TOOL | 0.956006 | 6.447696 |
0b3abbef-8ba4-4f19-a500-9dcf31a3b049 | Amitesh-AL1021/DailyCodeLog | Day18/Array/Problem_09.cpp | // #include<iostream>
// using namespace std;
// // 🔹 Program 1: Find the Nth Fibonacci number using an array
// // -------------------------------------------------------------
// // Yeh program ek array me pehle n Fibonacci numbers ko store karta hai
// // aur last wale (n-1 index pe jo hota hai) Fibonacci number k... | ALGO | 0.999552 | 5.658978 |
f37dfbb4-398e-458d-8381-4228a8324426 | abbash77/DSA | 1448-count-good-nodes-in-binary-tree/1448-count-good-nodes-in-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999934 | 6.450699 |
980753ce-0b2d-4632-9e03-e2bf7fc7013e | Satyanarayan-Parida/Appna-college-C-and-DSA | Day - 03_Practice/Questions_01.cpp | #include <iostream>
#include <iomanip>
int main(){
std::cout<<std::fixed<<std::setprecision(2);
// Integer Value
int x = 2, y = 5;
int exp1 = (x * y / x);
int exp2 = (x * (y / x));
std::cout<< exp1 <<std::endl;
std::cout<<exp2<<std::endl;
//Floating value
float num1 = 2, num2 =5;... | TOOL | 0.956726 | 3.826533 |
3132b507-370c-473c-893b-e085a6fe0db8 | the-7g-girl/Leetcode-daily | 1146-greatest-common-divisor-of-strings/greatest-common-divisor-of-strings.cpp | class Solution {
public:
int gcd(int a, int b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
string gcdOfStrings(string s1, string s2) {
int a = s1.size(), b = s2.size();
if (a < b)
swap(a, b);
int d = gcd(a, b);
string po... | ALGO | 0.999949 | 5.908719 |
24a20faa-6cfe-4d9b-ab13-ca6e2dbd8110 | ishandutta2007/codeforces | subscriber/normal/414/B.cpp | #include<stdio.h>
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<memory.h>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<sstream>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define SS stringstream
#define sqr(x) ((x)*(x))
#def... | ALGO | 0.999911 | 3.320033 |
f0ffd33b-4565-4ed3-ae1a-3e8518584861 | divyanshu0x16/leetcode-submissions | 0031 Next Permutation/Solution.cpp | class Solution {
public:
void nextPermutation(vector<int>& nums) {
int n = nums.size(), k, l;
for(k = n-2; k >= 0; k--){
if( nums[k] < nums[k+1] ){
break;
}
}
if(k < 0){
reverse(nums.begin(), nums.end());
... | ALGO | 0.999998 | 5.929422 |
682349fa-0a76-4c8e-ae2d-bd9e013b3a84 | lwher/Algorithm-exercise | C++/POJ/POJ 1451.cpp | #include<iostream>
#include<map>
#include<queue>
#include<cmath>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int n, m, sz, sum[10010], to[10010][8];
string ans[10010];
char word[310];
std::map<string, int>Q;
inline int char_to_num(char s){
if(s == ... | ALGO | 0.999784 | 3.583839 |
37471425-7194-457b-a592-da95fdff7bfb | ssb001111/PS | Baekjoon/data_structure/22942.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <stack>
using namespace std;
pair<int, string> arr[2020001]; // 0 : index 1010000
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int no_of_circles;
cin >> no_of_circles;
for (int i = 0; i < 2020001; i++){
... | ALGO | 0.999962 | 4.72518 |
c439f075-167b-414a-9bee-2eb651fa88ef | heavenMOJANG/ICPC | .history/Codeforces/CF1935/C_20240323201214.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int inf=0x7fffffff;
void solve(){
int n,l;cin>>n>>l;
array<int,2>arr[n+1];
for(int i = 1; i <= n; i++)
cin >> arr[i][1] >> arr[i][0];
sort(arr ... | ALGO | 0.999932 | 4.826921 |
69920f18-ccc5-43bc-83d1-27cc772b5daf | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/strmatch/kmp/test/2a9c5fd4-e4dc-4bd5-b25e-3f4402511f78.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream fin("strmatch.in");
ofstream fout("strmatch.out");
int n, m, l;
int lps[2000005], sol[1005];
string text, pattern;
void build_lps();
void solve();
int main()
{
fin >> pattern >> text;
n = text.length();
m = pattern.length();
build_lps(... | ALGO | 0.999987 | 3.952302 |
60989b12-d06a-4897-9215-c777562084f0 | ishandutta2007/codeforces | noam527/normal/995/A.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define debug cout << "ok" << endl
#define finish(x) return cout << x << endl, 0
typedef long long ll;
typedef long double ldb;
const int md = 1e9 + 7, inf = 1e9 + 7;
const ll hs = 199;
const ldb eps = 1e-9, pi = ac... | ALGO | 0.999912 | 3.384539 |
98650eaa-ea43-4e1d-9abb-19d427f4389b | kasturikara/Tugas-Loop | src/nomor3.cpp | #include <iostream>
using namespace std;
int main() {
double data, jumlahData, total, rata, max, min;
cout << "Masukkan Jumlah Data Yang Ingin Dimasukkan : "; cin >> jumlahData;
for(int i = 1; i <= jumlahData; i++) {
cout << "Masukkan Data Ke - " << i << " : "; cin >> data;
total += data;
if(i ==... | ALGO | 0.877899 | 3.35674 |
c9737e8b-7171-40a3-93e9-f0684a2f8cec | massitaverna/AlgoLab-ETH-Zurich-2020 | Week12/india.cpp | #include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/cycle_canceling.hpp>
#include <boost/graph/push_relabel_max_flow.hpp>
#include <boost/graph/successive_shortest_path_nonnegative_weights.hpp>
#include <boost/graph/find_flow_cost.hpp>
typedef boost::adjacency_list_traits<boost::vecS, b... | ALGO | 0.999554 | 5.42695 |
a1b990db-aaf2-4932-9776-7afc85ca585f | HEltim7/cpcode | NowCoder/其他/NEUQ-ACM-8th/I.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int q;
cin>>q;
for(int z=1;z<=q;z++){
int aim=0;
bool flag=0;
cin>>aim;
for(int k=2;k<=15;k++){
long day=pow(2,k)-1;
if(aim%day==0){
cout<<"YE5"<<endl;
... | ALGO | 0.999721 | 3.61383 |
75f26d61-22e7-4ecd-8df1-98f5a3815501 | chill-cy/Data-Structure | 3.树与二叉树/5.binary_tree-2.cpp | /*************************************************************************
> File Name: 5.binary_tree-2.cpp
> Author:jiangxiaoyu
> Mail:<EMAIL>
> Created Time: 2019年09月06日 星期五 16时23分52秒
************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <tim... | ALGO | 0.999716 | 4.73915 |
05c06cc2-459b-469f-a625-6a705f7e6b4a | xymxyz/DUCKDB-API | third_party/tpce-tool/utilities/Random.cpp | #include "utilities/Random.h"
#include <cmath>
#include <time.h>
#include "utilities/BigMath.h"
#include "utilities/MiscConsts.h"
using namespace TPCE;
inline RNGSEED CRandom::UInt64Rand(void) {
UINT64 a = (UINT64)UInt64Rand_A_MULTIPLIER;
UINT64 c = (UINT64)UInt64Rand_C_INCREMENT;
m_seed = (m_seed * a + c); // ... | ALGO | 0.98053 | 6.248802 |
4209708a-0655-48dc-aba0-7d81d240bd14 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2134_0.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& out, const pair<T, U>& vec) {
out << "{ ";
out << vec.first << ", " << vec.second;
out << "}";
}
template <typename... T>
ostream& operator<<(ostream& out, vector<T...>& vec) {
out << "{ ";
for (auto& ... | ALGO | 0.999887 | 3.346695 |
cf8cb56c-6ba4-4501-978a-1a4c68aa7a4c | jseobyun/WarpHE4D_ReFLAME | ext/botsch-kobbelt-remesher-libigl/ext/libigl/include/igl/copyleft/cgal/hausdorff.cpp | #include "hausdorff.h"
#include "../../hausdorff.h"
#include <functional>
template <
typename DerivedV,
typename Kernel,
typename Scalar>
IGL_INLINE void igl::copyleft::cgal::hausdorff(
const Eigen::MatrixBase<DerivedV>& V,
const CGAL::AABB_tree<
CGAL::AABB_traits<Kernel,
CGAL::AABB_triangle_primi... | ALGO | 0.999634 | 7.395152 |
1bb567d3-1fb0-46f8-abf0-4f3386f83b18 | sinian666/code_41_18 | cpp_副本15/chapter_array_and_linkedlist/list.cpp | /**
* File: list.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Driver Code */
int main() {
/* 初始化列表 */
vector<int> list = {1, 3, 2, 5, 4};
cout << "列表 list = ";
printVector(list);
/* 访问元素 */
int num = list[1];
cout << "访问索引 1 处的元素,得到 n... | ALGO | 0.97705 | 5.024094 |
7209a191-e86a-42ca-8bfd-fc6a3107ffe5 | huang123aini/Some_Libs | Opencv_Test/opencv-4.x/modules/core/src/types.cpp | #include "precomp.hpp"
namespace cv
{
////////////////////// KeyPoint //////////////////////
size_t KeyPoint::hash() const
{
size_t _Val = 2166136261U, scale = 16777619U;
Cv32suf u;
u.f = pt.x; _Val = (scale * _Val) ^ u.u;
u.f = pt.y; _Val = (scale * _Val) ^ u.u;
u.f = size; _Val = (scale * _Val)... | TOOL | 0.935173 | 7.619246 |
7734dcb8-59d0-4659-b4f7-07ee3c5cb252 | JulianKarrer/moleculardynamics | src/thermostat.cpp | #include "thermostat.h"
double temperature_cur(const Atoms atoms) {
return atoms.kinetic_energy() / (KB_EV_K_3_2 * atoms.nb_atoms());
}
void berendsen_thermostat(Atoms &atoms, double temperature, double dt,
double relaxation_time) {
double temp_cur{temperature_cur(atoms)};
// avo... | ALGO | 0.9959 | 5.986064 |
eb0fbd40-4880-4028-9c28-3545d0c836ea | abhishek18124/PPCPPFeb2025 | Lecture 17/007_2DArrays_SortedMatrixSearch.cpp | #include<iostream>
#include<algorithm>
using namespace std;
// time : O(mlogn)
bool isPresent(int mat[][3], int m, int n, int t) {
for (int i = 0; i < m; i++) {
// apply binary search on the ith row to search for t
if (binary_search(mat[i], mat[i] + n, t)) {
// t found
return true;
}
}
// t not f... | ALGO | 0.999833 | 5.019206 |
aa33425f-b5a2-4967-adbb-e0a0c376f757 | oxygen-hunter/Flashboom | data/leetcode_cpp/remove-all-adjacent-duplicates-in-string-ii.cpp | // Time: O(n)
// Space: O(n)
class Solution {
public:
string removeDuplicates(string s, int k) {
vector<pair<char, int>> stk = {{'^', 0}};
for (const auto& c : s) {
if (stk.back().first == c) {
if (++stk.back().second == k) {
stk.pop_back();
... | ALGO | 0.999953 | 6.061558 |
6a7d378e-9366-4b4a-a42f-c099dc432fa9 | ami-megarac/OSSW-LTS-v13 | Core/UnModified_OpenSource/mariadb-10.3/mariadb-10.3-10.3.31/extra/yassl/taocrypt/src/rsa.cpp | /* based on Wei Dai's rsa.cpp from CryptoPP */
#include "runtime.hpp"
#include "rsa.hpp"
#include "asn.hpp"
#include "modarith.hpp"
namespace TaoCrypt {
Integer RSA_PublicKey::ApplyFunction(const Integer& x) const
{
return a_exp_b_mod_c(x, e_, n_);
}
RSA_PublicKey::RSA_PublicKey(Source& source)
{
Initialize... | ALGO | 0.999375 | 7.306922 |
f1ae2ef3-2010-40aa-9893-6e7e71ad4c1a | MaTianmao/src | src/boost/libs/compute/example/host_sort.cpp | #include <iostream>
#include <vector>
#include <boost/spirit/include/karma.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/sort.hpp>
namespace compute = boost::compute;
namespace karma = boost::spirit::karma;
int rand_int()
{
return rand() % 100;
}
// this example demonstrates how to... | ALGO | 0.999599 | 5.778533 |
86baebf4-ce25-4a17-b6e4-af1026c20c88 | temp-check-wmc/temp-check-frontend | 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.9988 | 6.76073 |
eee5ad50-1ff6-4c48-8d5a-ffd932a1430c | privateLLM001/Private-LLM-Inference | EzPC/SCI/extern/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,4);
Eigen::VectorXf v(2);
m << 1, 23, 6, 9,
3, 11, 7, 2;
v << 2,
3;
MatrixXf::Index index;
// find nearest neighbour
(m.colwise() - v).colwise().squaredNorm()... | ALGO | 0.999961 | 4.138078 |
c23294a6-9519-4bc0-bf14-2907647cdfd4 | avgAnimeOtaku/DSA | hamming.cpp | #include <bits/stdc++.h>
using namespace std;
string onesComplement(string data)
{
for (int i = 0; i < data.length(); i++)
{
data[i] == '0' ? data[i] = '1' : data[i] = '0';
}
return data;
}
string checkSum(string data, int block_size)
{
int n = data.length();
if (n % block_size != 0)
... | ALGO | 0.999979 | 5.205969 |
f63313c9-f259-4c22-a116-c44aac232483 | Mi-Przystupa/PendulumSimulator | C++/eigen/bench/dense_solvers.cpp | #include <iostream>
#include "BenchTimer.h"
#include <Eigen/Dense>
#include <map>
#include <vector>
#include <string>
#include <sstream>
using namespace Eigen;
std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
std::vector<std::string> labels;
std::vector<Array2i> sizes;
template<typename Solver,type... | TOOL | 0.998161 | 6.326138 |
8c37f21a-e3c8-4a99-9d57-dc0914e33e20 | hugo-gclvs/ApplicationChronoLuge | ChronoLuge/boundary/data/QZXing/zxing/zxing/qrcode/encoder/MatrixUtil.cpp | #include "MatrixUtil.h"
#include "MaskUtil.h"
#include <zxing/WriterException.h>
#include "QRCode.h"
namespace zxing {
namespace qrcode {
const int MatrixUtil::POSITION_DETECTION_PATTERN[7][7] = {
{1, 1, 1, 1, 1, 1, 1},
{1, 0, 0, 0, 0, 0, 1},
{1, 0, 1, 1, 1, 0, 1},
{1, 0, 1, 1, 1, 0, 1},
{1, 0, 1... | ALGO | 0.986172 | 4.694141 |
f9695982-0f98-49e5-b266-a0a5674ed492 | saravanannnnn/Playground | Remove character except alphabets/Main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
char str[200];
int i, j;
cin >> str;
for(i = 0; str[i] != '\0'; ++i)
{
while (!( (str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' && str[i] <= 'Z') || str[i] == '\0') )
{
for(j = i; str[j] != '\0'; ++j)
... | ALGO | 0.99875 | 4.32987 |
08a018b2-5f95-4158-87c6-59b37dc1e1c2 | InvalidNamee/OJ-AC-Repository-for-UPC | AC_code/2024新生寒假集训系列/4016_深度优先搜索DFS/3_D_数池塘(八方向).cpp | #include <cstdio>
int dx[] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
char mp[110][110];
int n, m;
bool valid(int x, int y) {
return x > 0 && x <= n && y > 0 && y <= m && mp[x][y] == 'W';
}
void dfs(int x, int y) {
if (!valid(x, y)) return;
mp[x][y] = '.';
for (int i = 0; i < ... | ALGO | 0.998035 | 3.99423 |
6de68b96-f5f4-4b44-a998-b9ba2a716963 | TBradCreech/TJBotSDK | lib/boost_1_60_0/libs/graph/example/kruskal-example.cpp | int
main()
{
using namespace boost;
typedef adjacency_list < vecS, vecS, undirectedS,
no_property, property < edge_weight_t, int > > Graph;
typedef graph_traits < Graph >::edge_descriptor Edge;
typedef graph_traits < Graph >::vertex_descriptor Vertex;
typedef std::pair<int, int> E;
const int num_nodes ... | ALGO | 0.999708 | 5.154422 |
121a10c7-cd04-406f-b147-928cb183ff39 | CGCL-codes/G4S | cantera/test_problems/surfSolverTest/surfaceSolver.cpp | /**
* @file surfaceSolver.cpp
*
*/
#include "cantera/base/Interface.h"
#include "cantera/thermo/SurfPhase.h"
#include "cantera/kinetics.h"
#include "cantera/kinetics/ImplicitSurfChem.h"
#include "cantera/kinetics/InterfaceKinetics.h"
#include "cantera/kinetics/solveSP.h"
#include "cantera/base/fmt.h"
#include <cst... | ALGO | 0.871698 | 4.714262 |
ee8aeedb-1c47-4d09-9264-37baf3eb9f88 | tanmoy27112000/SimpleFormBuilder | example/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.998905 | 6.785645 |
a0b8f0dd-a86f-464d-8b75-95ac413f4abd | ShivanshRajput/Codeforces_Atcoder_Cses_solutions | 510a.cpp | #include<iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
for(int i=0;i<n;i++){
if(i%2){
if(i%4==1){
for(int i=0;i<m-1;i++){
cout<<".";
}
cout<<"#"<<endl;
}
else{
cou... | ALGO | 0.999921 | 3.109573 |
0977367f-e158-4784-be4a-87472966f85a | vaibhaviDixit/AdvancedC | ADS/programs/49-50/ten.cpp | /*
Give a positive integer n, find modular multiplicative inverse of all integer from 1 to n with respect to a big prime number, say, prime.
The modular multiplicative inverse of a is an integer x such that.
a x ? 1 (mod prime)
Input : n = 10, prime = 17
Output : 1 9 6 13 7 3 5 15 2 12
Explanation :
For 1, modular inv... | ALGO | 0.99993 | 6.257617 |
b195c0ea-06c3-40a5-b5a8-9711afec32bb | Divi1107/100DaysOfDSA | power.cpp | class Solution {
public:
double myPow(double x, int n) {
if(n==0)
{
return 1;
}
if(n<0)
{
n = abs(n);
x = 1/x;
}
if(n%2==0)
{
return myPow(x*x,n/2);
}
else{
return x*myPow... | ALGO | 0.999853 | 5.48884 |
333b3881-25d8-48b7-87ff-b851dd3e2e53 | Gautambandil/-ACC45DAYSOFCODE-2024. | Day-12 EXPERT.cpp | #include <iostream>
using namespace std;
int main() {
int T; // Number of test cases
cin >> T;
while (T--) {
int X, Y; // X = number of problems submitted, Y = number of problems approved
cin >> X >> Y;
// Check if at least 50% of problems are approved
if (Y * 2 >= X) {
... | ALGO | 0.999849 | 5.915675 |
95460b68-62a6-4ee7-8999-a247e7e6da51 | cstom4994/SourceEngineRebuild | src/Engine/studiorender/r_studiodecal.cpp | #include "studiorender.h"
#include "studiorendercontext.h"
#include "materialsystem/imaterialsystem.h"
#include "materialsystem/imaterialsystemhardwareconfig.h"
#include "materialsystem/imesh.h"
#include "materialsystem/imaterial.h"
#include "mathlib/mathlib.h"
#include "optimize.h"
#include "cmodel.h"
#include "materi... | TOOL | 0.96428 | 4.458673 |
832b4f20-b118-49b5-bb0f-347015a886b3 | abtahi2024/Algorithms_2023 | module18/knapsack_top_down.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxN = 1000;
const int maxW = 1000;
int dp[maxN][maxW];
int knapsack(int n,int weight[],int vale[],int W)
{
if(n==0||W==0)
{
return 0;
}
if(dp[n][W]!=-1)
{
return dp[n][W];
}
if(weight[n-1]<=W)
{
int op1=knap... | ALGO | 0.999997 | 4.407046 |
d542f152-1bbd-49f0-90c1-b3bfd66d0c68 | MoeinGhaniyoun/LLVM-SLH-RISCV | clang-tools-extra/clangd/ClangdServer.cpp | #include "ClangdServer.h"
#include "CodeComplete.h"
#include "Config.h"
#include "Diagnostics.h"
#include "DumpAST.h"
#include "FindSymbols.h"
#include "Format.h"
#include "HeaderSourceSwitch.h"
#include "InlayHints.h"
#include "ParsedAST.h"
#include "Preamble.h"
#include "Protocol.h"
#include "SemanticHighlighting.h"
... | TOOL | 0.925299 | 7.196372 |
dd2b2440-e9c7-467b-8e96-6328437101d0 | heavenMOJANG/ICPC | .history/luogu/P2774 方格取数问题_20241102215428.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
constexpr int N = 1e4 + 10;
constexpr int M = 2e5 + 10;
struct Edge {int to, nxt, vol;}e[M];
int m, n, a[110][110], s, t;
int hea... | ALGO | 0.999985 | 4.090114 |
caa2b0f2-c623-42fe-b195-9544c692b569 | nitish-sharma1/leetcode-daily | 2503-maximum-number-of-points-from-grid-queries/2503-maximum-number-of-points-from-grid-queries.cpp | class Solution {
public:
int m,n;
vector<pair<int,int>> direction = {{0,1},{1,0},{0,-1},{-1,0}};
void bfs(vector<vector<int>>& grid,int &points,int val){
int start =0 ;
int end = 0;
vector<vector<int>> vis(m,vector<int>(n,0));
queue<pair<int,int>> q;
q.push({start,end});
vis[start][end]=1;
w... | ALGO | 0.999992 | 5.728467 |
e34e6498-2d38-41c5-953e-e1e69fb3c106 | moo1o/AlgorithmPractice | Baekjoon/3197.cpp | #include <iostream>
#include <memory.h>
#include <queue>
#define MAX 1600
using namespace std;
int R, C, ans;
char map[MAX][MAX];
int watermap[MAX][MAX];
struct INFO {
int y, x;
}SWAN[3];
int visit[MAX][MAX];
queue<INFO> ice;
int dy[] = { 0, 1, 0, -1 };
int dx[] = { 1, 0, -1, 0 };
bool is_inside(int y, int x) {
re... | ALGO | 0.999677 | 3.206464 |
5524bbd3-ba52-43be-96d2-46100f946549 | ishunikhil/codeforce | boredome.cpp | #include<bits/stdc++.h>
using namespace std;
//{
#define ceil(n,k) ((n-1)/k+1)
#define sets(a) memset(a, -1, sizeof(a))
#define clr(a) memset(a, 0, sizeof(a))
#define max(a,b) ((a)>(b)? (a):(b))
#define min(a,b) ((a)<(b)? (a):(b))
#define fr(n) for(int i=0;i<n;i++)
#define pb push_back
#define INF 10000007
#define all... | ALGO | 0.999968 | 3.503131 |
83ff326c-1e8f-4a71-9990-7887a9f14650 | erichu92/chusa_bot | 3d_mapping/octomap/octomap/src/compare_octrees.cpp | #include <octomap/octomap.h>
#include <fstream>
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <list>
#include <cmath>
#ifdef _MSC_VER // fix missing isnan for VC++
#define isnan(x) _isnan(x)
#endif
// on MacOS, isnan is in std (also C++11)
using namespace std;
using namespace octomap;
void ... | ALGO | 0.97204 | 6.045464 |
1b8b316c-711f-489d-9206-f5be983721f0 | ishandutta2007/codeforces | ludo/normal/980/A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
#define x first
#define y second
#define pb push_back
#define eb emplace_back
#define rep(i,a,b) for (auto i = (a); i != (b); ++i)
#define rs resize
#de... | ALGO | 0.999855 | 4.128527 |
be43f16f-a0ef-4b9f-9c47-d825b47932a1 | arafathosense/Codeforces-Problems-Solution | 1281A.cpp | //! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
#defin... | ALGO | 0.999031 | 4.007758 |
c84a281c-a018-4fc3-a923-c64b34a78db8 | slaierno/AoC2021 | Day17/part12.cpp | #include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iostream>
#include <fstream>
//7381
//3019
int main()
{
// constexpr auto target_area = std::pair{std::pair{20, 30}, std::pair{-10, -5}};
constexpr auto target_area = std::pair{std::pair{185, 221}, std::pair{-122, -74}};
constexpr a... | ALGO | 0.999728 | 4.975736 |
7b3f1b33-9cd6-48ac-9f91-a1de9b714834 | codebyrifaf/CODEFORCE | (486A)Calculating_Function.cpp | //Money can buy happiness. Dont fool by foolish qoutes.
#include<bits/stdc++.h>
using namespace std;
int main()
{
// int t;
// cin>>t;
// while(t--)
// {
// }
long long int n;
cin>>n;
long long int sum;
if(n%2==0)
{
sum=n/2;
cout<<sum;
}
else
{
... | ALGO | 0.999894 | 3.353078 |
dac05bc4-9176-4816-96b3-f155226b2718 | gautamaggarwaldev/Dynamic-Programming | 37_MinimumNumberOfInsetionAndDeletionToConvertAToBByRecursion.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
int lcs(string s, string t, int n, int m)
{
if (n == 0 || m == 0)
{
return 0;
}
if (s[n - 1] == t[m - 1])
{
return 1 + lcs(s, t, n - 1, m - 1);
}
el... | ALGO | 0.99994 | 5.094376 |
f21f74de-35d0-4a26-bf65-182486b91ec2 | chandupoola181620/c- | inverted left angle triangle.cpp | #include<iostream>
using namespace std;
int main(){
int rows;
cout<<"enter the rows = ";
cin>>rows;
for(int i=rows;i<=rows;i--){
cout<<string(rows-i,' ')<<string(i,'*')<<endl;
}
return 0;
}
| ALGO | 0.999176 | 3.703198 |
14a21171-5b30-4d57-9847-c9c8e80025d8 | Masa-kuchii/V2V | src/microsim/MSLink.cpp | /****************************************************************************/
/****************************************************************************/
/****************************************************************************/
/// @file MSLink.cpp
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/... | TOOL | 0.996248 | 5.299128 |
6fada6e9-c203-4be3-a369-ce0a33934a70 | hselasky/usb4 | contrib/llvm-project/llvm/lib/CodeGen/PHIElimination.cpp | #include "PHIEliminationUtils.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineBasic... | ALGO | 0.99855 | 7.835744 |
be2fe14d-eeea-48df-bdca-743a88ec87c0 | abdullah-124/xpsc | Week-11/day-4/10101_Bangla_Numbers.cpp | #include<iostream>
#define fastread() {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define ll long long
using namespace std;
void solve(ll n){
if(n >= 10000000){
solve(n/10000000);
cout<<" kuti";
n%=10000000;
}
if(n >= 100000){
solve(n/100000);
cout<<" lakh";
n%=100000... | ALGO | 0.999226 | 3.030041 |
8b5a0331-cb48-4dc6-adeb-64e22f926917 | wvu-navLab/gnss-ins-zupt | GNSS_INS_ZUPT/3rdparty/RobustGNSS/gtsam/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-LambertConformalConic.cpp | using namespace System;
using namespace NETGeographicLib;
int main(array<System::String ^> ^/*args*/)
{
try {
// Define the Pennsylvania South state coordinate system EPSG:3364
// http://www.spatialreference.org/ref/epsg/3364/
const double
lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.... | TOOL | 0.882025 | 4.556332 |
080aba5f-46d4-4400-9358-4e1f471ff3f6 | scashnetwork/scash | src/rpc/request.cpp | #include <rpc/request.h>
#include <util/fs.h>
#include <common/args.h>
#include <logging.h>
#include <random.h>
#include <rpc/protocol.h>
#include <util/fs_helpers.h>
#include <util/strencodings.h>
#include <fstream>
#include <stdexcept>
#include <string>
#include <vector>
/**
* JSON-RPC protocol. Bitcoin speaks ... | WEB | 0.927868 | 7.342144 |
91f5c1bc-8f76-4327-80d5-d3aeebe77a64 | beingsidharth/help | 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.9988 | 6.76073 |
e562d5d1-57f7-4bdb-aa8f-def9c14db0e4 | shub39/C-Cpp | Learning-C++/checkPallindrome.cpp | // Check if given string is a pallindrome
#include <iostream>
#include <string>
using namespace std;
bool checkPallindrome(string &a, int end, int start = 0) {
if (start > end)
return true;
if (a[start++] != a[end--])
return false;
return checkPallindrome(a, end, start);
}
int main() {
string a = "";... | ALGO | 0.993396 | 4.537198 |
5a55e91d-07df-4123-ae63-761fcd1c238a | gupta-apurva/c | polynomial_addition.cpp | #include<stdio.h>
#include<stdlib.h>
struct poly
{
float coeff;
int expo;
struct poly*next;
};
void poly_create(struct poly**,int);
void poly_add(struct poly*,struct poly*,struct poly**);
struct poly*insert(struct poly*,float,int);
void traverse(struct poly*);
int main()
{
struct poly*head1=NULL;
struct poly*hea... | ALGO | 0.993464 | 3.098751 |
2f32d665-f564-4d0a-a75d-a1a40f6e38cd | cassiemetzger/iterative_methods | problem1.cpp | #include"iterative_methods.h"
#include<tuple>
#include<iostream>
#include<cmath>
#include <iomanip>
//this is me trying to run some tests to see if my stuff works, please ignore
int main(){
// Test function for fixed point iteration
auto f1 = [](double x) { return 0.1*(x*x-4); };
// Run fixed point itera... | TEST | 0.887937 | 5.866975 |
871d53df-76ac-4d5c-be93-cbd627c4dc5c | hozan66/College-Practical-Code | Compiler by C++/test33(strtoken)/main.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
char str[]="Hello,World,I'm,Token,text";
char* token=strtok(str,","); //parameter must be array of characters
int counter=0;
cout<<*token<<endl;
cout<<token<<endl<<endl;
while(token != NULL){
cout<<token<<endl;
... | TOOL | 0.96647 | 3.266016 |
2d4d881d-75ee-4403-b2d8-8d6240645757 | cait7/myLeetCode | 601_1900/1122.cpp | class Solution {
public:
vector<int> relativeSortArray(vector<int>& arr1, vector<int>& arr2) {
unordered_map<int, int> theMap;
unordered_set<int> theSet;
vector<int> disapper;
for (int &i: arr2) {
theSet.insert(i);
}
for (int &i: arr1) {
if (th... | ALGO | 0.999998 | 5.424586 |
d10af5f0-d78e-4d47-9fbc-561c6cd04984 | AAI1234S/cpp | function/default_arg.cpp | #include<iostream>
void display(char ch='*', int len=40)
{
for(int i=0;i<len;i++)
printf("%c",ch);
printf("\n");
}
float total(float amount, int year, float rate=5)
{
float sum=amount;
int y=1;
while(y<=year)
{
//std::cout<<"rate="<<rate<<std::endl;
sum=sum*(1+rate);
//year++;
y=y+1;
}
return sum;... | ALGO | 0.985281 | 3.342738 |
7ffd7247-3972-4ab4-a77d-98d5495089bf | NobodyFiancee/Tinkoff | АиСД Тинькофф 2024 (100 из 100)/Дерево отрезков 2/E.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
void updateSegmentTree(vector<long long> &segmentTree, long long key, long long newValue, long long n) {
vector<vector<long long>> stack {{1, -1, 0, n}};
while (!stack.empty()) {
stack.back()[1]++... | ALGO | 0.999853 | 5.519629 |
0db827ab-138b-4fc0-8915-da143d8aad1a | floxcap/fly2040 | app/sysmodule/lib/Atmosphere-libs/libvapours/source/crypto/impl/crypto_bignum_operations.cpp | #include <vapours.hpp>
namespace ams::crypto::impl {
namespace {
constexpr ALWAYS_INLINE BigNum::Word GetTop2Bits(BigNum::Word w) {
return (w >> (BigNum::BitsPerWord - 2)) & 0x3u;
}
constexpr ALWAYS_INLINE void MultWord(BigNum::Word *dst, BigNum::Word lhs, BigNum::Word rhs) {... | ALGO | 0.991368 | 6.951118 |
ca2eeedd-da44-457b-a355-15e65bca8707 | carlosgabriel11/URI | 1020/1020.cpp | #include <iostream>
using namespace std;
//start of the main function
int main(){
int total;
int days;
int months;
int years;
//get the total of days
cin >> total;
//calculate the total of year
years = total/365;
//get the new total
total %= 365;
//get the number of mon... | ALGO | 0.994097 | 4.146522 |
2952032e-8a8a-4a2c-b2ce-5d7f2fbc8f7b | BhaveshPatil12/CPP-Basic-Programs | FunctionF8.cpp | #include<iostream>
using namespace::std;
int max(int num1, int num2);
int main () {
int a = 500;
int b = 200;
int ret;
ret = max(a, b);
cout << "Max value is : " << ret << endl;
return 0;
}
int max(int num1, int num2) {
int result;
if (num1 > num2)
result = num1;
else
result = nu... | ALGO | 0.999323 | 4.446809 |
eea6a803-a9eb-4015-8d9f-7704f1e6c184 | RafaelPilato/Linguagem_C | Ex7.cpp | #include <stdio.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "PORTUGUESE");
float altura, peso_ideal;
char genero;
printf("\nUse (M) para Masculino e (F) para Feminino");
printf("\nInsira o seu gnero: ");
scanf("%c", &genero);
printf("\nInsira a sua altura em metros (ex: 1,70)\n-->Insira sua altura... | ALGO | 0.941482 | 3.993834 |
e6fccb3b-9fc2-4163-8ac6-c1b008827af1 | ryanbabcock/anthony-and-ryan-code-projects | c4/c4d1.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <vector>
using namespace std;
int main() {
double conversion = 0;
A:
vector<double> nums(2);
vector<string> units(2);
nums.clear();
units.clear();
while(cin >> nums[0] >> units[0] >> nums[1] >> units[1]){
if (cin.fail()){
cout << "\nBad input!\... | ALGO | 0.961507 | 3.417037 |
6c211e54-257d-4c60-84ec-e9dbbb0678d5 | organizedmess/DSA | Binary Trees/BurningTree.cpp | #include<iostream>
#include<map>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int d){
this->data= d;
Node* left = NULL;
Node* right = NULL;
}
};
Node* buildTree(Node* &root){
int data;
cout<<"Enter the data... | ALGO | 0.999981 | 4.646688 |
52ac5c9f-b945-4d99-8318-1959e47c150e | sourav-0-sahu/DSA-Codes | OOPs/Basics/1.GlobalVsLocalVariable.cpp | #include<iostream>
using namespace std;
int x = 2; //Global Variable
int main() {
x=59; //Modifying the Global Variable
cout << x << endl;
int x = 885; //local variable x
cout << x << endl; //Output : 885
return 0;
} | ALGO | 0.993848 | 3.724972 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.