uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6fa592b2-f299-4277-ae01-31493c72aeeb | zhisu/laneDetection | src/lanepar.cpp | /*
* lanepar.cpp
*
* Created on: Jun 1, 2021
* Author: aina
*/
#include "lanepar.h"
void
LanePar::parseLine(string& line){
stringstream ss(line);
string key;
string value;
getline(ss, key, ' ');
while(getline(ss, value, ' ')){
if(!value.empty()) break;
}
if(key=="SUBREGION_WIDTH")
... | CONFIG | 0.88161 | 4.473398 |
f2cc581e-6e62-40bf-9598-f3944050f1e6 | Juegos-ASADOS/El-Horno | ElHorno/dependencies/Ogre/Src/Components/MeshLodGenerator/src/OgreMeshLodGenerator.cpp | #include "OgreMeshLodPrecompiledHeaders.h"
namespace Ogre
{
template<> MeshLodGenerator* Singleton<MeshLodGenerator>::msSingleton = 0;
MeshLodGenerator* MeshLodGenerator::getSingletonPtr()
{
return msSingleton;
}
MeshLodGenerator& MeshLodGenerator::getSingleton()
{
assert(msSingleton);
return (*msSingleto... | TOOL | 0.965153 | 5.002491 |
52a1f262-1e24-4825-9be5-8b16e1bdd3e8 | joshnagulipilli/gfgsolutions | Medium/All Unique Permutations of an array/all-unique-permutations-of-an-array.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:
vector<vector<int>> uniquePerms(vector<int> &arr ,int n) {
// code here
sort(arr.begin(),arr.end());
vector<vec... | ALGO | 0.999916 | 6.253356 |
65744c43-0279-4ad1-96b3-0efed03ade2f | Mayankjoshi670/cpAlgo | codeforces/quest.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL)
#define vi vector<int>
#define vvi vector<vector<int>>
#define ll long long
#define int long long int
void findAns() {
// Input reading
int n, k, op1, op2;
cin >> n >> k >> op1 >> op2;
vi num... | ALGO | 0.999916 | 4.212744 |
5f5bc0d5-3ed5-4db1-900a-fd17da7eead0 | Debmalya24/learningCpp | primenumber.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter the number = ";
cin>>n;
int factors=0;
for(int i=1;i<=n;i++){
if(n%i==0){
factors+=1;
break;
}
}
if(factors==2){
cout<<"Prime"<<endl;
}
else{
cout<<"No... | ALGO | 0.99992 | 4.041456 |
62e84ead-138b-4c84-bb22-59452186b2f1 | joan-guo/paddle1 | paddle/gserver/layers/CosSimVecMatLayer.cpp | #include "Layer.h"
#include "paddle/math/Matrix.h"
#include "paddle/utils/Logging.h"
#include "paddle/utils/Stat.h"
namespace paddle {
/**
* @brief A layer for computing cosine similarity between a vector
* and each row of a matrix
* out[i] = cos_scale * cos(in1, in2(i,:));
* @note used in NEURAL TURING MACHINE
*... | DATA | 0.975594 | 6.033042 |
78188760-bc38-4e0a-8828-1a735a101a75 | cofop875/Ardupilot_Archer | libraries/AP_Math/AP_Math.cpp | #include "AP_Math.h"
#include <float.h>
#include <AP_InternalError/AP_InternalError.h>
/*
* is_equal(): Integer implementation, provided for convenience and
* compatibility with old code. Expands to the same as comparing the values
* directly
*/
template <typename Arithmetic1, typename Arithmetic2>
typename std:... | TOOL | 0.98639 | 3.62892 |
21f61e67-62cb-4cdf-a36b-c664b6045363 | Aden-Tao/LeetCode | 0130 Surrounded Regions/solution.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int n, m;
void solve(vector<vector<char>>& board)
{
if (board.empty() || board[0].empty()) return;
//遍历四条边
n = board.size(), m = board[0].size();
for (int i = 0; i < n; i++)
{
if (bo... | ALGO | 0.999906 | 5.474071 |
8df05b74-813b-4a1b-aaba-f2b7f2aef0a0 | dutchpatriot/florijncoin | src/wallet.cpp | #include "wallet.h"
#include "walletdb.h"
#include "crypter.h"
#include "ui_interface.h"
#include "base58.h"
using namespace std;
//////////////////////////////////////////////////////////////////////////////
//
// mapWallet
//
struct CompareValueOnly
{
bool operator()(const pair<int64, pair<const CWalletTx*, un... | TOOL | 0.947362 | 4.073135 |
ccdd3b8e-e0dd-45a0-97d8-877f0b307960 | MateyApostolov/HomeWork | Autumn National/fakir.cpp | #include <iostream>
using namespace std;
int main () {
int a, b, c, d;
cin >> a >> b >> c >> d;
int nm = min(a, min(b, min(c, d)));
cout << a + b + c + d + 1 - nm;
return 0;
}
| ALGO | 0.99894 | 3.614157 |
862722c1-d522-4615-985d-cedf32d960b4 | fbricenop/evaluacion_conocimientos_u01 | ejercicio3.cpp | #include <iostream>
using namespace std;
int factorial(int a);
int sumatoria(int b);
int main(){
int y;
cin>>y;
cout<<sumatoria(y);
return 0;
}
int sumatoria(int b){
int s=0;
for(int i=1;i<=b;i++){
s+=(factorial(i)/2*i);
}
return s;
}
int factorial (int a){
int s=1;
for(int i; i<=a;i++){
s=s*i;
}
retur... | ALGO | 0.999633 | 3.598976 |
b751cc03-5f70-4dc3-ac81-4789421c79e2 | pinaki2999/extractObjects | src/estimatePoseVfh.cpp | /*
* extractObject.cpp
*
* Created on: Sep 25, 2011
* Author: reon
*/
#include <ros/ros.h>
#include "sensor_msgs/PointCloud2.h"
#include "sensor_msgs/point_cloud_conversion.h"
#include <ros/publisher.h>
#include <time.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/common/common.... | DATA | 0.932628 | 4.803802 |
27448f12-727a-4d21-9df8-c69ec6e8eba6 | jubaerhosain/data-structures-and-algorithms | Heap/Min Heap.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<vector<int>> vii;
/*****User defined function*****/
int heapsize = 0;
vector<int> heap;
void min_heapify(int i) {
int left = 2*i + 1;
int right = 2*i + 2;
int min_index = i;
... | ALGO | 0.999908 | 4.321294 |
02919e9a-2376-4d6c-aed8-0fbce93ea6e0 | davit-iso/Lamdas | any_of.cpp | #include <iostream>
#include <vector>
template <typename InputIt, typename Pred>
bool any_of(InputIt first, InputIt last, Pred p)
{
for(auto i = first; i != last; ++i)
{
if(p(*i) == true)
{
return true;
}
}
return false;
}
int main()
{
std::vector<int> vec{1,2,3... | ALGO | 0.997956 | 4.928852 |
b9a71a2c-8c34-4c90-b8c8-2d80a4e964b4 | pingchungchang/CP | CF1530C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ld long double
void solve(){
int n;
cin>>n;
priority_queue<int,vector<int>,greater<int>> na,nb;
... | ALGO | 0.999913 | 3.69131 |
71111cae-0e4c-40cc-bfcb-df16c9cd6875 | Shubham-Raj-25/LeetCode-Solutions | 0789-kth-largest-element-in-a-stream/0789-kth-largest-element-in-a-stream.cpp | class KthLargest {
public:
priority_queue<int, vector<int>, greater<int>> pq; // max heap
int size;
KthLargest(int k, vector<int>& nums) {
int n = nums.size();
size = k;
for(int num : nums)
pq.push(num);
}
int add(int val) {
pq.push(val);
whil... | ALGO | 0.999957 | 6.109038 |
e3b9c60c-35e8-406d-b8ea-59392dc7ccce | nis44/DSA | 1129-longest-string-chain/longest-string-chain.cpp | class Solution {
public:
bool compare(string s1, string s2) {
if(s1.size() != s2.size() + 1) return false;
int a = 0;
int b = 0;
while(a < s1.size() && b < s2.size()) {
if(s1[a] == s2[b]) {
a++;
b++;
} else {
a... | ALGO | 0.99999 | 5.753264 |
62c6a3ff-7863-4141-a8d3-68d5156976fa | 2017100235/Mix---Cplusplus | tabuada.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int i=1,j=1;
for(i=1;i<=10;i++)
{
cout<< "TABUADA DO " << i << "\n";
for (j=1;j<=10;j++)
cout<< i <<"x"<<j <<"=" <<i*j <<"\n";
}
}
| ALGO | 0.889008 | 4.057638 |
bce4e96f-7bfd-43ec-808b-10d9570acfbf | WoodFY/DataStructure | Tree/CSTree.cpp | /*
孩子兄弟表示法
*/
#include <stdio.h>
#include <stdlib.h>
#define ElemType int
typedef struct CSNode {
ElemType data;
struct CSNode *firstchild, *nextsibling;
} CSNode, *CSTree;
//初始化树的函数,递归方法
void CreateCSTree(CSTree &T) {
ElemType ch;
scanf("%d",&ch);
//清空缓冲区,输入int型字符时不需要
// getchar();
... | ALGO | 0.999893 | 3.284779 |
53749bf9-75ef-4c9f-9275-ba9fd67ad6a8 | ZhenyingZhu/ClassicAlgorithms | src/CPP/src/leetcode/UniqueWordAbbreviation.cpp | /*
* [Source] https://leetcode.com/problems/unique-word-abbreviation/
* [Difficulty]: Easy
* [Tag]: Hash Table
* [Tag]: Design
*/
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
// [Solution]: Too vague.
// [Corner Case]: Dictionary may contain dup, which should count as 1. i... | ALGO | 0.953125 | 6.78341 |
8feb7d8a-89ee-414c-bfdb-d003c884e2d8 | HariAr2/leetcode-solutions | 458.PoorPigs.cpp | class Solution {
public:
int poorPigs(int buckets, int minutesToDie, int minutesToTest) {
int times = minutesToTest / minutesToDie;
int result = 0;
while (pow(times + 1, result) < buckets) ++result;
return result;
}
};
| ALGO | 0.979583 | 6.144059 |
42d144af-658a-4968-a5b7-ccc3ac1e1f92 | TheDev05/CARDIO | Domains/UnCategorized/LC1391.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
std::cin >> n >> m;
std::vector<std::vector<int>> num;
for (int i = 0; i < n; i++)
{
std::vector<int> temp(m);
for (auto &j : temp)
std::cin >> j;
num.push_back(temp);
}
std::map<int,... | ALGO | 0.999984 | 4.405108 |
b86878d1-dfe5-4139-8a32-7723e64476e2 | mugishakundasarah/cpp-exercises | countNumber.cpp | #include <iostream>
using namespace std;
int numberCount(int n, int countNumber){
int count = 0;
int currentNumber = n;
int digit;
if (n <= 0)
{
return -1;
}
while (currentNumber>0)
{
digit = currentNumber % 10;
if (digit == countNumber)
{
... | ALGO | 0.998973 | 5.168437 |
1fb39610-2b18-4972-91e7-6f60ccce5f15 | Mindjolt2406/Competitive-Programming | Codechef/ACMIND19/Online/OR4.cpp | /*
Rathin Bhargava
IIIT Bangalore
*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>... | ALGO | 0.999932 | 4.21928 |
01068c78-0926-48da-9ff9-0de263344ad6 | Vikram05vikky/30-Days-Coding-Challenge | Day 8/CodeChef_Lucky Four.cpp | Problem - Lucky Four
Karan likes the number 4 very much.
Impressed by the power of this number, Karan has begun to look for occurrences of four anywhere. He has a list of T integers, for each of them he wants to calculate the number of occurrences of the digit 4 in the decimal representation. He is too busy now, so pl... | ALGO | 0.999607 | 4.87273 |
aa1b4191-263d-40ed-840f-366427f3c54f | pedrinhoeu/atcoder | 077/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
cin.tie(0)->sync_with_stdio(0);
string pala1, pala2;
cin >> pala1 >> pala2;
reverse(pala2.begin(), pala2.end());
if(pala1 == pala2) cout << "YES\n";
else cout << "NO\n";
} | ALGO | 0.999998 | 4.492864 |
0b8ae0e9-a5c4-4de6-bbd0-d9781a29820b | notabn/Path_Planning | src/Eigen-3.3/doc/examples/DenseBase_middleCols_int.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl;
return 0;
}
| ALGO | 0.874149 | 3.133398 |
e16674f4-987a-4da9-979b-9544a7b648a0 | Tayebbb/Competitive-Programming | CodeForces/2008-A.cpp | #include <bits/stdc++.h>
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define ll long long int
#define kachao ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int main()
{
kachao
ll t;
cin>>t;
while(t--){
ll a,b;
cin>>a>>b;
... | ALGO | 0.999406 | 4.543768 |
2d55b756-a349-4d39-a93e-6c324863d7fa | ishandutta2007/codeforces | dlalswp25/normal/1540/C1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
int N, Q;
int X[101010];
int A[105];
int B[105];
ll S1[105];
ll D[10101];
ll S[10101];
ll sum(int l, int r) {
l = max(l, 0);
if(!l) return S[r];
return (S[r] + MOD - S[l - 1]) % MOD;
}
int main() {
scanf("%d", &N);
... | ALGO | 0.999874 | 4.057558 |
e6404e64-3315-442d-9839-a2c12cf0a8b7 | iasoule/WMGestures | HaarDetection.cpp | /*
Haar Detection using all 3 line types
all that is necessary is loading of the xml file
Opencv provides the haar-training and performace evalution for
training the various postures.
Idris Soule
Help of Yeshua Ha'Mashiach
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.... | TOOL | 0.872301 | 3.855162 |
4fa20862-4fb1-4bda-87cb-be4afb689aa1 | nirvana369/UVA-problem-solved | 681.cpp | /*
Hoang Linh
*/
#include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <map>
#include <queue>
#include <iostream>
#define fi "681.inp"
#define fo "681.out"
/**/
using namespace std;
/**/
struct toado{
int x,y;
... | ALGO | 0.999849 | 3.796332 |
255bebc5-d2b6-4a0f-8966-acfc841e5098 | Liu-Steve/leetcode-sign-in | 20221121-808.cpp | #include "bits/stdc++.h"
#define io \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>> vv;
inline double ed(int i, int j)
{
if (i <= ... | ALGO | 0.999772 | 3.3599 |
259aaa8d-6c88-4733-9069-354afc36dfc4 | NAgrawal1798/Competitive-coding | 166-fraction-to-recurring-decimal/fraction-to-recurring-decimal.cpp | class Solution {
public:
string fractionToDecimal(int numerator, int denominator) {
if (!numerator) {
return "0";
}
string ans = "";
// if(numerator > )
if(numerator > 0 && denominator < 0) {
ans += '-';
}
if (numerator < 0 && denominat... | ALGO | 0.999962 | 6.367934 |
16322545-7cab-4aed-8f16-1920e5f3bd03 | Dyablo-HPC/Dyablo | core/src/gravity/GravitySolver_point_mass.cpp | #include "GravitySolver_analytical.tpp"
namespace dyablo{
/**
* @brief AnalyticalFormula_gravity implementation for point mass
* to use with GravitySolver_analytical.
**/
class AnalyticalFormula_gravity_point_mass : public AnalyticalFormula_gravity
{
private:
// Position of the central mass
real_t point_m... | ALGO | 0.998942 | 6.724412 |
b63630f9-2443-48bf-bd87-e61ec0796603 | shihan04/CP-codes | codeforces/915A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int a[n];
for(int i=0;i<n;i++) cin>>a[i];
sort(a,a+n,greater<int>());
for(int i=0;i<n;i++){
if(!(k%a[i])){
cout<<k/a[i];
return 0;
}
}
}
| ALGO | 0.999888 | 3.466148 |
8ad18993-c743-4572-b115-127461567564 | ayushkr1999/Competitive-Programming | CodeForces/1305B.cpp | #include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define N 1000005
#define ll long long
#define ld long double
#define lli long long int
#define pb push_back
#define INF 10000000000
#define mod 1000000007
#define MOD 1000000007
#define mp make_pair
#... | ALGO | 0.996513 | 3.095928 |
02733cfa-a251-43f9-b9d4-4fba57559d06 | MRSIMM0/przetwarzanie_rownolegle | klasycznie_rownolegle/ver1.cpp | #include <iostream>
#include <cmath>
#include <chrono>
#include <vector>
#include <cmath>
#include <omp.h>
bool isPrime(int num) {
if (num <= 1) return false;
if (num == 2) return true;
if (num % 2 == 0) return false;
int limit = std::sqrt(num);
for (int i = 3; i <= limit; i += 2) {
if (nu... | ALGO | 0.99971 | 5.87845 |
3a9e1d5b-6a9b-49a1-8a0b-5cef4fcb04e9 | BlackLotus454/Strivers-SDE-sheet | Bubble Sort - GFG/bubble-sort.cpp | //{ Driver Code Starts
//Initial Template for C++
// C program for implementation of Bubble sort
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
// swapping the elements
void swap(int *xp, int *yp)
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
// } Driver Code Ends
//User function Template ... | ALGO | 0.999863 | 5.600103 |
ab60272c-f51b-4148-bbde-f00f558a0a7a | Relph1119/cpp-red-book | beginning/assets/ch08/Ex8_06.cpp | // Passing a two-dimensional array to a function
#include <iostream>
#include <array> // For std::size()
double yield(const double values[][4], size_t n);
int main()
{
double beans[3][4] { { 1.0, 2.0, 3.0, 4.0},
{ 5.0, 6.0, 7.0, 8.0},
{ 9.0, 10... | ALGO | 0.998922 | 6.170363 |
fa6dc37a-811c-4c6c-a198-88989ca71245 | TheUCoin/theucoin | src/timedata.cpp | #include "timedata.h"
#include "netbase.h"
#include "sync.h"
#include "ui_interface.h"
#include "util.h"
#include "utilstrencodings.h"
#include <boost/foreach.hpp>
using namespace std;
static CCriticalSection cs_nTimeOffset;
static int64_t nTimeOffset = 0;
/**
* "Never go to sea with two chronometers; take one or... | TOOL | 0.862078 | 6.284417 |
2201ec28-43b1-4a21-b66d-d0214d2046a2 | NMLT-NTTMK-K18/6-290-recursion | Bai004/Source.cpp | #include <iostream>
using namespace std;
float Tong(int);
int main()
{
int n;
cout << "Nhap n: ";
cin >> n;
cout << "Tong S: " << Tong(n);
return 0;
}
float Tong(int n)
{
if (n == 0)
return 1;
float s = Tong(n - 1);
return (s + (float)1 / (2 * n + 1));
} | ALGO | 0.996438 | 3.314013 |
ec7d9be2-e9b8-4ef8-81ca-427d79c94c5d | Sifat-00/Week-18 | Week 18/Day 2/2.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
priority_queue<int> small_queue;
priority_queue<int, vector<int>, greater<int>> big_queue;
set<int> isnotEqual;
for (int i = 0; i < n; i++) {
int a, x;
cin >> a >> x;
if (a == 1) {
... | ALGO | 0.999887 | 4.60814 |
4d337aea-1efb-425b-86bf-78c90d3f97ba | DrJamali/Object-Oriented-Programming | Class Work/arr_avg.cpp | #include <iostream>
using namespace std;
int avg(int *arr)
{
for (int i = 1; i < 5; i++)
{
arr[0] = arr[0] + arr[i];
}
cout << "The average is " << arr[0]/(sizeof(arr)/sizeof(int)) << endl;
}
int main()
{
int arr[5] = {1, 2, 3, 4, 5};
avg(arr);
return 0;
} | ALGO | 0.996415 | 3.584637 |
8dd29809-7816-4155-9945-5a2e84cd3e1a | Leorasaharia/LeetCode-Solutions | 0350-intersection-of-two-arrays-ii/0350-intersection-of-two-arrays-ii.cpp | class Solution{
public:
vector<int> intersect(vector<int>& a, vector<int>& b){
unordered_map<int,int>m;
for(int i=0;i<a.size();i++){
if(m.find(a[i])==m.end())
m[a[i]]=1;
else m[a[i]]++;
}
int k=0;
for(int i=0;i<b.size();i++){
i... | ALGO | 0.99994 | 4.890956 |
4742b692-2847-437f-adc5-70fef79d00d7 | xmihol00/MPI_projects | heat_propagation/sources/ParallelHeatSolver.cpp | /**
* @file ParallelHeatSolver.cpp
*
* @author David Mihola <<EMAIL>>
*
* @brief Course: PPP 2023/2024 - Project 1
* This file contains implementation of parallel heat equation solver
* using MPI/OpenMP hybrid approach.
*
* @date 2024-02-23
*/
#include <algorithm>
#include <array>
... | ALGO | 0.996777 | 7.242113 |
451b4c3d-fadc-4175-8879-22d3e8d79454 | ivanadriannn/CompetitiveProgrammingSOCS1 | JawabanSOCS1/LAB 2/prob-F.cpp | #include<stdio.h>
int main(){
int tc, a, b;
scanf("%d", &tc);
getchar();
for(int i = 1; i <= tc; i++){
scanf("%d %d", &a, &b);
getchar();
int bitshiftOperation = (a/b) << b;
printf("%d\n", bitshiftOperation);
}
return 0;
}
| ALGO | 0.999686 | 3.582062 |
8b63c692-7a34-4327-8e93-aea1694b8023 | DanEngelbrecht/bikeshed | examples/single_threaded_task_consumer.cpp | #define BIKESHED_IMPLEMENTATION
#define BIKESHED_L1CACHE_SIZE 64
#include "../src/bikeshed.h"
#include "../third-party/nadir/src/nadir.h"
#include "helpers/perf_timer.h"
#include "helpers/counting_task.h"
#include <stdio.h>
int main(int , char** )
{
SetupTime();
long volatile executed_count = 0;
long d... | TOOL | 0.850462 | 6.988558 |
35410571-7745-4399-bc31-7ae9573c4eec | chenhongqiao/USACO | mooyomooyo/mooyomooyo.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k;
char m[105][105];
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
bool v[105][105];
int conum(int x, int y, char c)
{
queue<pair<int, int>> q;
q.push({x, y});
bool v[105][105] = {false};
v[x][y] = true;
int cnt = 1;
while (!q.empty())... | ALGO | 0.999932 | 4.108712 |
35febd6e-b084-4b46-8b15-ae1d1525d3e7 | Radhika-chopde/-CrackYourInternship | 0122-best-time-to-buy-and-sell-stock-ii/0122-best-time-to-buy-and-sell-stock-ii.cpp | class Solution {
public:
int maxProfit(std::vector<int>& prices) {
int max_profit = 0;
for (int i = 1; i < prices.size(); ++i) {
if (prices[i] > prices[i - 1]) {
max_profit += prices[i] - prices[i - 1];
}
}
return max_profit;... | ALGO | 0.998547 | 6.517956 |
5971adaf-a46a-43c1-8195-9bcd714530f9 | jjiny0716/Algorithm | Codewars/c++/4kyu_Roman_Numerals_Helper.cpp | #include <string>
#include <cmath>
#include <iostream>
using namespace std;
class RomanHelper {
public:
char romanChar[4][3] = {
{ 'I','V','X' },
{ 'X','L','C' },
{ 'C','D','M' },
{ 'M',' ',' ' }
};
int order[10] = { 8, 7, 3, 9, 6, 4, 2, 5, 1, 0}; // size ã 迭
std::st... | ALGO | 0.997595 | 5.598109 |
14015a4b-b242-4eee-b488-473502aabaad | RaviGaddipati/computer-integrated-surgery | Programming 1/Submission1/cis-cal/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
MatrixXf::Index maxIndex;
float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex);
std::cout << "Maximum sum at position " << maxIndex << std:... | ALGO | 0.999887 | 4.220459 |
b38ae90b-faa9-4585-8bfe-d8f1885932a7 | bmzhong/dev | poj/poj1/1328.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
struct A
{
int x, y;
double l, r;
};
A a[1005];
int n, d, ans = 0;
bool cmp(const A a1, const A a2);
int main()
{
int index = 1;
while (scanf("%d%d", &n, &d) != EOF && d != 0 || n != 0)
{
ans = 0... | ALGO | 0.999763 | 3.64144 |
7c4654c2-787f-43ba-95b2-bf8e86a60e2c | 2013612/CP-algorithm | codeforces/1181/1181C.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
int N, ans, a[];
int main(){
scanf("%d", &N);
for (int i = 0; i < N; i++) {
scanf("%d", &a[i]);
}
printf("%d\n", ans);
return 0;
}
| ALGO | 0.999176 | 3.296412 |
6b456b38-170f-4068-a9a0-78d8a449c028 | JoaoPKarpinski/avaliacao-de-vestibular | atribuirVetoresPrincipais.cpp | //#include "./functions/funcoes-e-estruturas.h"
#include "./functions/sort.cpp"
#include <string.h>
//#define PESSOA 571567
void dimVet(int *&vetor, int k, int &tam){
vetor[k] = vetor[tam];
tam = tam-1;
}
/**************************************
TROCAR AS CONSTANTES DE ARQUIVOS
POR PARAMETRO DE FUNÇÃO
***... | ALGO | 0.998173 | 4.027172 |
329bd755-45c8-4e4e-84ad-153c353a4833 | mmatrosov/FKN2020 | home1/_by_users/Иванова Алеся Александровна-82739707/A-34059724-gcc_docker2-OK.cpp | #include <iostream>
bool check_password(const std::string& password) {
if (password.size() < 8 || password.size() > 14)
return 0;
int cap_letter = 0;
int low_letter = 0;
int digit = 0;
int symbol = 0;
for (const int& c : password) {
if (c < 33 || c > 126) {
return 0;... | ALGO | 0.993764 | 5.11626 |
d83d0212-3402-4520-bce6-3c7edcfb1b1e | Lladruc37/Physics_2_UPC | PhysicsII_Box2D/Box2D/Box2D/Dynamics/b2ContactManager.cpp | #include <Box2D/Dynamics/b2ContactManager.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Dynamics/Contacts/b2Contact.h>
b2ContactFilter b2_defaultFilter;
b2ContactListener b2_defaultListener;
b2ContactManager::b2ContactManager()... | ALGO | 0.96767 | 6.955931 |
9df43bda-d6b4-4dfc-8d0e-98e28e34bab6 | Zlin0509/Zlin_ACM | _CF/CONTEST/1-499/6/E.cpp | //
// Created by Zlin on 2025/1/13.
//
#include "bits/stdc++.h"
using namespace std;
typedef double db;
typedef long double ldb;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
constexpr ... | ALGO | 0.99987 | 4.926835 |
9ae99a8f-d953-4522-ab11-d3d9c0faf9f5 | nafi103/Solved-Problems | Contest/2025/Codeforces Round 1007 (Div. 2)/A_The_Play_Never_Ends.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/****************************************************************/
#define int long long
#define pi acos(-1.0)
const int mod = 998244353;
#defin... | ALGO | 0.999252 | 4.505031 |
c6e92276-4f12-4281-b407-dcd58d0d6ae7 | rabelhmd/UVA-Solutions | Uva_10929 _You_can_say_11.cpp | #include<stdio.h>
#include <bits/stdc++.h>
using namespace std;
int main()
{
char str[1005];
int len, i, ans;
while(scanf("%s",&str)==1)
{
ans = 0;
len = strlen(str);
for(i=0;i<len;i++)
{
ans = ans*10 + str[i]-'0';
... | ALGO | 0.995749 | 3.112829 |
5f2d6f5b-a494-4e03-a3a5-d0991f1360f0 | SAMIUL-35/my_codeforces_contest | div_3_954/C_Update_Queries.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define op() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
int main ()
{
op();
ll t;cin>>t;
while (t--)
{
ll n, m;
cin >> n >> m;
string k;
cin >> k;
set<ll>... | ALGO | 0.999939 | 4.203098 |
c459c73f-3362-41fe-b8cb-d25e97ad9cf8 | didrlgus/algorithm-practice | programmers/level2/s51.cpp | // 예상 대진표
#include <iostream>
using namespace std;
int solution(int n, int a, int b) {
int answer=1;
if(a>b) {
int tmp=a;
a=b;
b=tmp;
}
if(a%2==1 && b%2==0 && abs(a-b)==1) return answer;
while(true) {
answer++;
if(a%2==1) {
a=a/2+1;
... | ALGO | 0.999812 | 4.700653 |
b26bf6a1-2041-446f-bbb6-15544b77ba88 | gitpan/Ufal-NameTag | nametag/morphodita/tagset_converter/pdt_to_conll2009_tagset_converter.cpp | #include <algorithm>
#include <cstring>
#include "../morpho/czech_lemma_addinfo.h"
#include "pdt_to_conll2009_tagset_converter.h"
namespace ufal {
namespace morphodita {
static const char* names[15] = {"POS", "SubPOS", "Gen", "Num", "Cas", "PGe", "PNu", "Per", "Ten", "Gra", "Neg", "Voi", "", "", "Var"};
inline void... | TOOL | 0.940661 | 5.710015 |
96c1182d-a0c9-4315-ab8f-1e52c2e6ad3e | aryan750/Codeforces_DSA | i_wanna_be_The_guy.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int count[256] = {0};
int p;
int q;
cin>>p;
int a[p];
for(int i=0;i<p;i++)
{
cin>>a[i];
count[a[i]] = 1;
}
cin>>q;
int b[q];
for(int i=0;i<q;i++)
{
cin>>b[i];
count[b[i]] = 1;
}
int sum =0;
for(int i=0;i<256;i++)
{
... | ALGO | 0.999681 | 3.187159 |
48bc9e69-0c34-4620-8ca0-fc239b362bfa | jaypatil22/Leet-Code-Solutions | 1887. Reduction Operations to Make the Array Elements Equal.cpp | class Solution {
public:
int reductionOperations(vector<int>& nums) {
vector<int> cnt(50001,0);
for(int i=0;i<nums.size();i++) {
cnt[nums[i]]++;
}
int curr=0,res=0;
for(int i=50000;i>0;i--) {
if(cnt[i]) {
curr += cnt[i];
... | ALGO | 0.999945 | 5.801811 |
438ab32f-b14e-4185-8afd-787580db0ce9 | Deanmeisong/Leetcode_Puzzle | 1964-find-the-longest-valid-obstacle-course-at-each-position/1964-find-the-longest-valid-obstacle-course-at-each-position.cpp | class Solution {
public:
vector<int> longestObstacleCourseAtEachPosition(vector<int>& obstacles) {
vector<int> arr;
int n = obstacles.size();
vector<int> rets;
for(int x : obstacles) {
if(arr.empty() || arr.back() <= x) {
arr.push_back(x);
... | ALGO | 0.999764 | 6.084312 |
bb4bd144-0f78-4760-a010-58432cfe3f24 | bailiyang/my_git_storage | cpp_study/function_array_test.cpp | #include <iostream>
int big(int a, int* b){ //这里要传递int*指针类型,所以一定要设置为int*类型
if (a > *b){ //由于要比较b指向的元素与a,所以进行解引用操作,得出的数值就是b指向的数字
return a;
}
else {
return *b;
}
}
int main(int argc, char *argv[])
{
int a = 5;
int c = 100;
int* b = &c;
std::cout << big(a,b) <<... | ALGO | 0.910635 | 3.111057 |
2084cddd-80da-497e-9e92-ddf8b70c0ce8 | Yuqian-He/Position-Based-Dynamic | PBDNGL/src/CollisionConstrain.cpp | #include <iostream>
#include "CollisionConstrain.h"
collisionConstrain::collisionConstrain(){}
collisionConstrain::collisionConstrain(std::shared_ptr<ngl::Obj> _mesh,ngl::Transformation _cube_model,ngl::Mat4 _mouseGlobalTX,float _collisionStiffness)
{
m_mouseGlobalTX=_mouseGlobalTX;
cube_model=_cube_model;
... | ALGO | 0.968778 | 3.962367 |
b0a80ead-5f1c-47c4-b8bb-91efff3e19c7 | personalrobotics/or_sbpl | src/CachedAction.cpp | #include <or_sbpl/CachedAction.h>
#include <or_sbpl/SBPLBasePlannerTypes.h>
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
using namespace or_sbpl;
CachedAction::CachedAction() {
setWeight(1.0);
}
CachedAction::CachedAction(const std::vector<WorldCoordinate> &pts, const double &weight) :
_pts(... | TOOL | 0.895577 | 6.513532 |
2915e48b-4ce5-496e-b53a-bb5cd0bb844c | bachtran02/comp-prog | sv/accelforest2.cpp | #include<iostream>
#include<random>
#include<iomanip>
#include<ctime>
using namespace std;
const int TRIALS = 100000;
// const int DRAWS = 22;
const int LADICA = 3, FLOWERING = 3;
const int DECKSIZE = 40;
int main(){
srand(time(nullptr));
for(int ACCELS = 15; ACCELS <= 20; ACCELS++){
cout << "accels: ... | ALGO | 0.914873 | 3.890298 |
1309e40e-b730-429c-b2d8-d59030601594 | topsframework/tops | src/model/HiddenMarkovModel.cpp | /***********************************************************************/
/* */
/* This program is free software; you can redistribute it and/or */
/* published by the Free Software Foundation; either version 3 of */
/* ... | ALGO | 0.997942 | 7.687118 |
6d2261a5-6142-4d85-a2f6-d7b9ae36ec91 | nkurochkin/FreeAdjust | gnu_gama/local/newnetwork.cpp | #include <gnu_gama/local/newnetwork.h>
#include <gnu_gama/local/network_svd.h>
#include <gnu_gama/local/network_gso.h>
#include <gnu_gama/local/network_chol.h>
#include <gnu_gama/local/network_env.h>
namespace GNU_gama { namespace local {
LocalNetwork* newLocalNetwork(std::string algorithm)
{
LocalNetwork... | ALGO | 0.996413 | 5.251646 |
e8280f8e-18c1-47a6-bc44-c8d3ca9a02a0 | p-anastas/PARALiA-Framework | Library_scheduler/src/Functions/daxpy.cpp | ///
/// \author Anastasiadis Petros (<EMAIL>)
///
/// \brief The axpy CoCopeLia implementation using the new mission-agent-asset C++ classes.
///
#include "backend_wrappers.hpp"
#include "Autotuner.hpp"
#include "PARALiA.hpp"
#include "linkmap.hpp"
#include "Decomposer.hpp"
#include "Subkernel.hpp"
#include "DataCachi... | TOOL | 0.994113 | 5.642296 |
ecb3ffe9-e3db-4cbb-9ae8-e7e085e1576c | tanggeTom/ue5_2_1_mirror | Engine/Extras/Windows/cl-filter/cl-filter.cpp | /**
* This program is designed to execute the Visual C++ compiler (cl.exe) and filter off any output lines from the /showIncludes directive
* into a separate file for dependency checking. GCC/Clang have a specific option for this, whereas MSVC does not.
*/
#include <windows.h>
#include <stdio.h>
#include <string>
#... | TOOL | 0.946792 | 6.567276 |
97114c7c-e8ad-44c7-a41a-71c7d58c82a0 | MATCHA-MIT/DAGguise | src/systemc/tests/systemc/misc/unit/data/datawidth_signed/promote_truncation/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.984301 | 5.296924 |
4a1588d7-6a8d-4b1e-bb4a-bb03cd76408d | akashpatilx7/GeeksForGeeks | Strings/Upper case conversion.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
string transform(string str);
int main()
{
int t;
cin>>t;
cin.ignore();
while(t--)
{
string str;
getline(cin,str);
cout<<transform(str)<<endl;
}
return 0;
}
// } Driver Code Ends
string transform(str... | ALGO | 0.999589 | 5.876751 |
4670716c-098a-4207-9848-866cba8b1041 | habeshacoder/chatapp | 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.998733 | 6.76775 |
31f2b4c1-62d0-4d1b-8a08-ddfb16ce92d1 | ishandutta2007/codeforces | shnirelman/normal/1657/C.cpp | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;
const int INF = 1e9 + 13;
const li INF64 = 1e18 + 13;
//const int M = 1e9 + 7;
const int M = 998244353;
const int N = 2e5 + 13;
const int LOGN = 30;
/*
*/
void s... | ALGO | 0.999139 | 4.750436 |
c739e79f-5a17-4452-bb26-235a3688b56f | aydinkasimoglu/Crypto-Market | 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.998859 | 6.785645 |
fe2e4503-4f04-4748-aa91-d3a80ff6141e | 100RAV-AGGARWAL/Final-450 | Heaps/Heap Sort.cpp | class Solution
{
public:
//Heapify function to maintain heap property.
void heapify(int arr[], int size, int i)
{
// Your Code Here
int largest = i;
int left = 2*i+1;
int right = 2*i+2;
if(left < size && arr[largest] < arr[left]) {
largest = left;... | ALGO | 0.99999 | 5.699309 |
a1475617-6834-4701-8d48-a5f9cd59c147 | frandominguezl/SCD | Practica 2/prodcons_su_lifo.cpp | /*
* Práctica 2 - Sistemas Concurrentes y Distribuidos
* Problema de los productores y consumidores múltiples, versión LIFO
* y señales SU (Señalar y Espera Urgente)
*
* autor: Francisco Domínguez Lorente
*/
#include <iostream>
#include <cassert>
#include <iomanip>
#include <thread>
#include <random>
#include "HoareMo... | TEST | 0.867295 | 5.115123 |
d7c41e1b-cbec-4187-83b8-e1df51fbcc89 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4855_12.cpp | #include <bits/stdc++.h>
int a[10];
int main() {
int n, i, ans;
for (i = 1; i <= 8; i++) {
a[i] = (pow(2, i) - 1) * (pow(2, i - 1));
}
scanf("%d", &n);
for (i = 8; i >= 1; i--) {
if (n % a[i] == 0) {
ans = a[i];
break;
}
}
printf("%d\n", ans);
}
| ALGO | 0.999928 | 4.311267 |
5f54523b-dee5-49e0-b922-88ff0946f455 | ishandutta2007/codeforces | flashmt/normal/1185/B.cpp | #include <bits/stdc++.h>
using namespace std;
int check(string s, string t)
{
int j = 0;
for (int i = 0; i < s.size(); i++)
if (j >= t.size() || s[i] != t[j]) return 0;
else
{
j++;
if (i + 1 < s.size() && s[i] == s[i + 1])
continue;
while (j < t.size() && s[i] == t[j])
... | ALGO | 0.999919 | 5.411382 |
a2e35ac5-a15d-4473-8719-0e02863ab8a1 | baojinchang/PAT | Sum_of_Number_Segments.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
double sum = 0;
for (int i = 1; i < n+1; i++)
{
double temp;
cin >> temp;
sum += temp * i * (n + 1 - i);
}
printf("%0.2f", sum);
return 0;
} | ALGO | 0.999711 | 3.594352 |
cf72b7c9-c1eb-4719-9e48-d144f62cd431 | assigmen/midterm | 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.998733 | 6.76775 |
3edbc31f-43a1-4605-9d6c-3e4ab6d1df20 | GlodonOpenSrc/Qt5.9.5_Glodon | qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkGpuBlurUtils.cpp | #include "SkGpuBlurUtils.h"
#include "SkRect.h"
#if SK_SUPPORT_GPU
#include "effects/GrConvolutionEffect.h"
#include "effects/GrMatrixConvolutionEffect.h"
#include "GrContext.h"
#include "GrCaps.h"
#include "GrRenderTargetContext.h"
#include "GrFixedClip.h"
#define MAX_BLUR_SIGMA 4.0f
static void scale_irect_roundo... | TOOL | 0.936416 | 5.933607 |
a2e82222-aa0c-402c-bd60-06e95498ba7a | WilliamJokuS/mywebsite | idek/train2D.cpp | #include <bits/stdc++.h>
using namespace std;
long long tmp;
string cek="welcome to code jam",s;
typedef long long ll;
ll memo[505][30];
ll dp(int idxs,int idxc){
if(memo[idxs][idxc]!=-1)return memo[idxs][idxc];
else if(idxc==cek.size())return memo[idxs][idxc]=1;
else if(idxs==s.size())return memo[idxs][idxc]=0;
if... | ALGO | 0.999946 | 4.051197 |
ed12afc3-f32e-4960-8ac5-ad72906f5211 | trademark4944/CMPT-1109-Assignments | assignment 3.cpp | #include <iostream>
using namespace std;
class polynomial {
double* coeff;
int size;
public:
polynomial() { size = 1; coeff = new double[1]; coeff[0] = 0; }
polynomial(int degree) {
size = degree + 1;
coeff = new double[size];
for (int i = 0; i < size; i++) {
coeff[i] = 0;
}
}
polynomial(int degree, d... | ALGO | 0.995578 | 3.741984 |
78b81238-eb1e-4d58-94f1-9b349857fc60 | JatinNirwan/Codiing-Blocks-C-DSA-Questions | array_median.cpp | #include<iostream>
#include<algorithm>
using namespace std;
void median(int *arr1,int *arr2,int n)
{
int arr[n+n];
int k=0;
int median=0,m1=0,m2=0,n1=0,n2=0;
for(int i=0;i<n;i++)
{
arr[k]=arr1[i];
k++;
}
for(int i=0;i<n;i++)
{
arr[i]=arr2[i];
k++;
}
sort(arr,arr+k);
if(k%2==0)
{
n1=k/2;
n2=k/2+1... | ALGO | 0.999995 | 4.228646 |
4f8f786a-fe05-406a-b66d-bf68a2d45ba4 | raincross7/code-similarity | codes/train_code/problem318/problem318_215.cpp | #include<bits/stdc++.h>
#include<random>
#define int long long
#define pp pair<int,int>
#define ss second
#define ff first
#define pb push_back
#define mod 1000000007
#define mk(arr,n,type) type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "Yes"<<endl
#define no cout<< "No"<<endl
#define all(v)... | ALGO | 0.999858 | 4.470356 |
5fdd4c5a-725e-4223-b264-5b6c33a7c3d2 | a-trumier/atrumier-aoc2024 | day2/day2.cpp | #include <stdio.h>
#include <vector>
#include <string>
#include <sstream>
#include <stdlib.h>
bool safe_input_solver(std::vector<std::string> &input)
{
bool is_safe = true;
int last_num = 0;
bool is_series_lowering = false;
int cur_num = 0;
for (long unsigned int i = 0; i < input.size(); i++)
... | ALGO | 0.980795 | 4.05877 |
7035ad82-ca42-4bf5-9453-9064d7203598 | Lasagnya/Term4 | Semestr 1/UP Lab 1 asm.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a, b, c, d, x, y, s = 0, z, f;
cout << "vvedite x";
cin >> x;
cout << "vvedite y";
cin >> y;
cout << "vvedite z";
cin >> z;
a = sqrt(z);
b = pow(z, 5);
c = abs(y);
d = sin(x) * 1000;
f = pow(y, 3);
s = a * f / (x + 1) + b / 3 - c /... | ALGO | 0.99555 | 3.205206 |
6b5ce9f9-5d49-49b6-a04a-a1861c859b64 | bakachanbaby/CTGL-GT | DSA06014.cpp | #include <bits/stdc++.h>
using namespace std;
int t, n;
int nt(int n){
if(n < 2)
return 0;
for(int i = 2; i <= sqrt(n); i++)
if(n%i==0)
return 0;
return 1;
}
void in(){
int flat;
for(int i = 2; i <= sqrt(n); i++)
{
flat = 1;
if(nt(i) && nt(n-i))
... | ALGO | 0.999817 | 4.584898 |
5e3627e7-45a1-4780-8600-deaf8abe7a15 | yashsiwach/GeekForGeeks-CPP | Basic/Cyclically rotate an array by one/cyclically-rotate-an-array-by-one.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
void rotate(int arr[], int n);
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",&n);
int a[n] , i;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
rotat... | ALGO | 0.999765 | 5.088618 |
e32fe0bf-7951-43df-8a1c-6622b3293a04 | greenbeanpie/OI-training | NOIP2023-ZJ/ZJ-0367/tribool/tribooltest.cpp | #include <bits/stdc++.h>
using namespace std;
const int t=1e9-1,f=1e9,u=1e9+1;
int c,T,n,x,y,m,i,a[100001],fa[100001],ans;
char ch;
bool b[100001],b1[100001],bo;
int zbb(int x)
{
int zz=fa[x],xx;
while (fa[zz]!=zz) zz=fa[zz];
while (fa[x]!=zz) xx=fa[x],fa[x]=zz,x=xx;
return zz;
}
void huan(int x)
{
if (b1[x]) retu... | ALGO | 0.999608 | 5.129903 |
71a58e4a-1b71-4373-958b-1df21b837491 | Quick-One/CC | CF_Quick-One/compfest_15_preliminary_online_mirror/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define range(it, start, end) for (auto it = start; it < end; it++)
#define vin(v) \
for (auto& x : v) cin >> x;
typedef vector<int> vi;
int MOD = 998244353;
struct Node {
int ones, zero, ans;
Node merge(Node a, Node... | ALGO | 0.999863 | 4.267918 |
8406e43b-f773-41ae-8c8b-1bb97a99a9b7 | 2020134032/ps | 4_6_1062가르침.cpp | #include <iostream>
#include <string>
using namespace std;
int N, K;
int words[50];
int res=0;
string s;
void check(int mask) {
int cnt = 0;
for (int word : words) {
if (word && (word & mask) == word)cnt++;
}
res = res > cnt ? res : cnt;
}
void go(int index, int k, int masking) {
if (k > K|| index >=26) return;... | ALGO | 0.999645 | 4.338068 |
60fe0318-6d70-4417-8408-a19ae041602d | alieldeba/Elzero-Cpp-Assignments | Website-Assignments/36-37/2.cpp | #include <iostream>
using namespace std;
int main()
{
int day;
cin >> day;
switch (day)
{
case 1:
case 2:
case 3:
cout << day << " Shop Is Open";
break;
case 4:
case 5:
cout << day << " Shop Is Closed";
break;
default:
cout << "Day Is Not Valid";
}
return 0;
}
| TOOL | 0.982862 | 3.575732 |
ffdd6010-6ba6-43e6-a939-5028ce8f89d9 | DanyloKapkan41/PPZ-3-3- | PPZ#3(3)/PPZ#3(3).cpp |
#include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int val) : data(val), next(nullptr) {}
};
void add(Node*& head, int N, int j)
{
if (N > j)
{
int n;
n = rand() % 200001 - 100000;
Node* cur = new Node(n);
head->next = cur;
j++;
add(cur, N, j);
}
}
void show(Node* h... | ALGO | 0.999114 | 3.582778 |
4da9e288-44bf-4516-8d1d-000bb0fa7413 | DavidePiccinini/thesis_Kimera_Gazebo | 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.857713 | 4.556332 |
f78d0b98-9fa9-4c99-a8c7-95b9a7851fa3 | SS961214/BoundsOnEigenstateThermalization | StatMech/HilbertSpace/Algorithm/IntegerComposition_test.cpp | #include "tests.hpp"
#include "IntegerComposition.hpp"
#include <Eigen/Dense>
#include <iostream>
void test_IntegerComposition(Index N, Index L, Index Max, Index dim) {
std::cout << "# " << __PRETTY_FUNCTION__ << std::endl;
std::cout << "##\t (N, Length, Max) = (" << N << ", " << L << ", " << Max << ")" << std::endl... | TEST | 0.916411 | 7.271287 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.