uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
319ad5aa-8a31-4577-92cf-0acda7ee5daf | a3828162/1081 | C++Practice/HW1/HW1.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(){
int gender, age;
int mass, activity, BMR, TDEE;
float heightm,height;
float BMI;
cout << "Input Gender(Male:1/Female:2):";
cin >> gender;
cout << "Input Age(year):";
cin >> age;
cout << "Input mass(kg):";
cin >> mass;
cout << "Input... | TOOL | 0.864021 | 3.489099 |
d1d1006b-d479-47c6-b272-4b99d6c3315c | DanielBrito/competitive-programming | Solutions/Neps Academy/DroneDeEntrega.cpp | // https://neps.academy/problem/14
#include <iostream>
using namespace std;
int main(){
int a, b, c, h, l;
cin >> a;
cin >> b;
cin >> c;
cin >> h;
cin >> l;
if(a<=h && (b<=l || c<=l)){
cout << "S\n";
}
else
if(b<=h && (a<=l || c<=l)){
cout << "S\n";
}
else
if(c<=h &... | ALGO | 0.998836 | 3.112866 |
0b981783-252b-4eb9-a389-d6e8a8784051 | jeounpar/codingtest-with-cpp | 10주완성코테/3주차 완전탐색, 백트래킹/4179.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int r, c;
int fire[1001][1001];
int dist[1001][1001];
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
vector<string> vc;
int main(void) {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(NULL);
cin >> r >> c;
string s;
queue<pair... | ALGO | 0.999839 | 4.827056 |
cab05561-8ce2-4733-82db-4a4eeb91bd4d | sd8103/basic-programs | fact.cpp | #include <iostream>
using namespace std;
int main() {
int n, fact = 1, i;
cin>>n;
for(i=1; i<=n; i++)
fact = fact * i;
cout<<"Factorial of "<<n<<" is "<<fact;
return 0;
}
| ALGO | 0.999702 | 4.182402 |
95ee66a1-f57c-443e-8f61-98ef0463968b | soikot-22/Beecrowd-problem-solving | 1332 - One Two Three.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string str;
cin>>str;
if(str=="one" || (str[0]=='o' && str[1]=='n') || (str[0]=='o' && str[2]=='e') || (str[1]=='n' && str[2]=='e')){
cout<<"1"<<endl;
}
else if(str=="two"... | ALGO | 0.999913 | 4.113467 |
6c31aff4-684a-4149-acd6-25d64882cc9d | udaykiran04/1BM17CS120_ADA | 2a.bsort.cpp | #include<iostream>
#include<time.h>
using namespace std;
int main()
{
int k,n;
cout<<"Enter a number\n";
cin>>k;
cout<<"Enter the array size\n";
cin>>n;
int a[n];
cout<<"Enter the array elements:\n";
for(int i=0;i<n;i++)
{
cin>>a[i];
}
clock_t start,end,t;
start=clock();
for(int i=0;i<k;i++)
{
for(in... | ALGO | 0.999735 | 3.864388 |
16299e6f-3656-4064-80e1-b2bf959ee469 | pratikraj315/450-DSA-SHEET | sort012.cpp | #include<bits/stdc++.h>
using namespace std;
void sort012(int arr[], int n)
{
int low = 0, mid= 0, high = n-1;
while(mid<high)
{
if(arr[mid] == 0)
{
swap(arr[low], arr[mid]);
low++;
mid++;
}
else if(arr[mid]==1)
{
mid++... | ALGO | 0.999889 | 4.572968 |
8b4ad6cd-a410-457d-8f9f-886edaae8721 | SHK24/multilateration | src/LinearSolver_mul2.cpp | #include "LinearSolver_mul2.h"
#include <Eigen/Dense>
Vector3d LinearSolver_mul2::locate_linear(const std::vector<LocatorData>& locators) {
const int n = static_cast<int>(locators.size());
Eigen::MatrixX3d position_mat(n, 3);
for (int i = 0; i < n; ++i) {
position_mat.row(i) << locators[i].positio... | ALGO | 0.999623 | 5.17028 |
11d61bab-5f4a-4768-810e-ec2be0cee90d | Mohammed-Ihab/Robotics-Program-Codeforces-Tasks | contest_1_src/data_guess.cpp | #include <iostream>
using namespace std;
int main(){
double A {}, B {}, C {}, result_float {}, float_checker {};
cin >> A >> B >> C;
result_float = A * B / C;
long long result_int = result_float;
float_checker = result_float - result_int;
if(float_checker == 0.0){
if(result_int > 2... | ALGO | 0.986711 | 3.454931 |
0ed5ff0b-669e-498c-a80f-17d96d777960 | tanmoy-OG/striver-a-z-sheet-old-dropped | 1_learnTheBasics/1.5_learnBasicRecursion/7_reverse-an-array_8365444.cpp | //? Time Complexity: O(n)
vector<int> reverseArray(int n, vector<int> &nums)
{
// Write your code here.
reverse(nums.begin(), nums.end());
return nums;
}
| ALGO | 0.999878 | 5.901851 |
9259e3e7-1dd2-4c83-84b1-7fefc783c119 | ArpitaSatsangi/DSA-using-cpp | 009. 2D array/print like a wave.cpp | #include <iostream>
using namespace std;
void printWAVE(int a[3][3],int n,int m)
{
for(int i=0;i<n;i++)//column
{
if(i&1)
{
//odd- bottom to top
for(int j=m-1;j>=0;j--)//row
{
cout<<a[j][i]<<" ";
}
}
else
{... | ALGO | 0.999901 | 3.303723 |
bfae8026-d091-4399-b763-b2daa350f67a | apolloliu/Algorithm-Competition | OpenJudge/2019/D.cpp | // D - Jumping Cows
// http://bailian.openjudge.cn/practice/2181/
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]){
// freopen("input.txt", "r", stdin);
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
std::vector<int> a(n, 0);
for(int i = 0; i ... | ALGO | 0.999983 | 3.635651 |
d1b77f8b-43d7-4359-b8a1-6fcca850ad50 | ttamx/Competitive-Programming | codeforces/1899D.cpp | #include<bits/stdc++.h>
using namespace std;
void runcase(){
int n;
cin >> n;
long long ans=0;
map<pair<int,int>,int> mp;
for(int i=0;i<n;i++){
int a;
cin >> a;
int b=a;
for(;b%2==0;b>>=1)a--;
pair<int,int> res(a,b);
ans+=mp[res]++;
}
cout <<... | ALGO | 0.999592 | 4.548587 |
4bdc2026-0430-4cb4-a3e9-79068f2c4000 | sharmajatin741/Competitve-Programming | Codeforces/126B.cpp | #include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define fi first
#define se second
#define ff first
#define ss second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#def... | ALGO | 0.999943 | 3.408108 |
cac6ebea-919f-4846-bc8c-2567d4a06def | equilaterus-gamestudios/ue4-equilaterus-framework | AI/EQConsiderationEvaluator.cpp | #include "AI/EQConsiderationEvaluator.h"
#include "Core/EQCharacter.h"
#include "Components/EQHealthComponent.h"
#include "AI/EQWhiteBoard.h"
#include "AI/EQAITypes.h"
#include "AI/EQBaseNPCCharacter.h"
#include "GameFramework/Controller.h"
#include "Utility/EQCurveBlueprintLibrary.h"
#include "Utility/EQFunctionBluepr... | ALGO | 0.99457 | 7.071692 |
3db1b6f0-a099-4b69-8990-b9557f239476 | kishan2805/week20 | bitmanupulation.cpp | #include <iostream>
#include <vector>
#include<algorithm>
#include<queue>
using namespace std;
void evenodd(int n){
if(n&1==1) cout<<"even";
else cout<<"odd";
}
void getIthBit(int n,int i) {
int mask = (1 << i);
int ans = n & mask;
if(ans == 0) {
cout << "bit-> 0" << endl;
}
else {
cout << "bit-... | ALGO | 0.999732 | 4.278395 |
1e9e5595-d51f-461c-95fd-d13d9d84e669 | Shanmuga-Priya-D/Data_Structures | dll.cpp | #include<iostream>
using namespace std;
struct node
{
int data;
node* fore;
node* back;
};
struct list
{
int count;
node* head;
node* rear;
};
class dll
{
list *h;
public:
dll()
{
h=new list;
h->count=0;
h->head= NULL;
h->rear=NULL;
}
bool emptyList()
{
if(h->count==0)
return true;
else
r... | ALGO | 0.999787 | 3.492352 |
1c15c4b8-41f6-4cda-b646-f7b0f5f56670 | LWilliams-law67/Academic-programming | CIS252/chap6_prgEx2_LukeWilliams.cpp | /*
Author: Luke Williams
Date: 29 January 2018
Description: Programming Excercise 2, the function smallestIndex takes the parameters of an array and its size then returns
the index of the first occurence of the smallest element in the array.
*/
#include<iostream>
#include<cmath>
#include<iomanip>
#include<ccty... | ALGO | 0.999605 | 4.806234 |
9beaef69-272e-469f-977a-f6f319ee2b0d | Urho-Net/Urho3D | Source/ThirdParty/angle/third_party/SwiftShader/third_party/llvm-7.0/llvm/lib/CodeGen/ExecutionDomainFix.cpp | #include "llvm/CodeGen/ExecutionDomainFix.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
using namespace llvm;
#define DEBUG_TYPE "execution-deps-fix"
iterator_range<SmallVectorImpl<int>::const_iterator>
ExecutionDomainFix::regIndices(unsigned Reg) const {
assert(Reg < A... | ALGO | 0.988595 | 7.935961 |
1b2c882d-fb33-49d2-965f-3ed99050d984 | ericliuu/flux | FLUX/llvm/lib/Support/StringExtras.cpp | #include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/raw_ostream.h"
#include <cctype>
using namespace llvm;
/// StrInStrNoCase - Portable version of strcasestr. Locates the first
/// occurrence of string 's1' in string 's2', ignoring case. Returns
/// the offset of s2 in s1 or... | TOOL | 0.921545 | 6.842466 |
2c11b56d-c137-43fb-b589-b6552a4fef48 | anuragkrgupta/C-programming | array_pass_by_reference.cpp | //array always passed by reference//
#include<iostream>
using namespace std;
void display(int a[],int b)
{
a[0]=a[0]+10;
a[1]=a[1]+20;
a[4]=a[4]+100;
for(int k=0;k<b;k++)
cout<<a[k]<<" ";
}
int main()
{
int x[5]={100,200,300,400,500};
display(x,5); //array passing
cout<<"\n in main ";
... | TOOL | 0.969638 | 3.499918 |
48f02998-a431-4064-bf18-f5eaadc4d307 | VIROOPAKSHC/Competitive-Programming | June/Day-8.cpp | // Author - Chekuri Viroopaksh
// Day 8 - 19th June, 2024
// Striver's A2Z DSA Sheet
#include<bits/stdc++.h>
using namespace std;
vector<int> findLeaders(vector<int> vect){
int n=vect.size();
vector<int> ans;
int curr_max=vect[n-1];
ans.push_back(curr_max);
for(int i=n-2;i>=0;i--){
if(curr_... | ALGO | 0.99998 | 5.103873 |
2c06e0e9-f95c-4b76-a227-ce2a562c5b27 | Neeraj-Koshyari/TLE_CP-31-Sheet | Rating : 1500/E. Data Structures Fan.cpp | // Problem link: https://codeforces.com/problemset/problem/1872/E
// #include<fstream>
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
... | ALGO | 0.999922 | 5.233113 |
03a0176f-3686-49ed-8a8e-d34b409fa59e | hust-szw/algorithm-practice | other/maxSubArray.cpp | /*
53.
һ nums ҳһ͵飨ٰһԪأ͡
еһ֡
*/
#include <stdio.h>
#include <limits.h>
int maxSubArray(int* nums, int numsSize){
int start,len,sum,maxsum=INT_MIN;
for(start=0;start<numsSize;start++){
sum=0;
for(len=0;start+len<numsSize;len++){
sum+=nums[start+len];
if(sum>maxsum){
... | ALGO | 0.998616 | 4.16312 |
8d91b2d6-6da3-4a3f-a880-32ffb7ca1fa1 | saminjay/AoC | 2024/day-03/cpp/part-2.cpp | #include <fstream>
#include <iostream>
#include <regex>
#include <string>
int get_mul(std::string::iterator begin, std::string::iterator end) {
int sum = 0;
std::regex mul("(mul)\\((\\d{1,3}),(\\d{1,3})\\)|(do)\\(\\)|(don't)\\(\\)");
auto match_begin = std::sregex_iterator(begin, end, mul);
auto match... | ALGO | 0.997165 | 5.193482 |
de01ffc0-b474-436f-ab79-0ed963888f12 | TimQuelch/matmult-performance | ocl.cpp | #include <CL/cl.h>
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <string>
// Check opencl error code
// These codes are generated in two ways
// Some functions return the values (clGetPlatformIDs, clEnqueueNDRangeKernel, etc.)
// Some functions accept and address to a cl_int as a parameter (cl... | TOOL | 0.953221 | 5.384693 |
73832599-1ee5-4798-b562-fa2e37da0169 | Divyadarshan007/cppLearnings | cpp lecture-17(2D-Array Exercise)/sumOfTwoarray.cpp | #include <iostream>
using namespace std;
int main()
{
int row, col;
cout << "Enter number of rows : ";
cin >> row;
cout << "Enter number of cols : ";
cin >> col;
int arr[row][col];
int arr2[row][col];
int sum[row][col];
for (int i = 0; i < row; i++)
{
for (int j = 0; j ... | ALGO | 0.99892 | 4.080297 |
edea0881-fbc3-458a-8afa-091b131f0990 | ishandutta2007/codeforces | karuna/normal/1051/D.cpp | #include <bits/stdc++.h>
#define p 998244353
using namespace std;
typedef long long ll;
ll dp[10][1001][2002];
/* 0 : WW 1 : WB 2 : BW 3 : BB */
ll dyp(int i, int n, int k){
if (dp[i][n][k] != 0) return dp[i][n][k];
if (k==0 || k>2*n) return 0;
if (k==1 && (i==0 || i==3))return 1;
if (k==1 ) return 0;
if (i==... | ALGO | 0.999984 | 4.266202 |
0a71f5a1-772f-4eeb-8734-58e2e44f9ea2 | Subhadeeep25/leetcode-solutions | 1806-count-of-matches-in-tournament/count-of-matches-in-tournament.cpp | class Solution {
public:
int numberOfMatches(int n) {
int sum=0;
while(n>1){
sum+=(n/2)+(n%2);
n=n/2;
}
return sum;
}
}; | ALGO | 0.999945 | 5.481671 |
b9c5bb8d-8bd3-4aba-bd0e-afe9e95db9e5 | SA-K1B/Problem-Solving | Codeforces/cf1183a.cpp | #include<bits/stdc++.h>
#define ll long long int
#define db double
#define pb push_back
#define mp make_pair
#define Max 10000000000000000
#define Min -10000000000000000
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * (b / gcd(a, b)))
using namespace std;
ll M=1000000007;
ll mod(ll x){
return ((x%M + M)%M)... | ALGO | 0.999884 | 3.298304 |
5e5198b7-5b29-4c9a-8c19-8cfc50bd6e7b | ishandutta2007/codeforces | wild_hamster/normal/545/E.cpp | #include <omp.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstring>
#include <deque>
#include <time.h>
#include <stack>
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <fstream>
#define mp make_pair
#define pb push_back
#define PI 3.141592653589793... | ALGO | 0.999995 | 3.006598 |
a0db6dda-7aeb-4395-96c9-2d5935329e01 | vijaykumar0710/Leetcode | 1227-number-of-equivalent-domino-pairs/1227-number-of-equivalent-domino-pairs.cpp | class Solution {
public:
int numEquivDominoPairs(vector<vector<int>>& dominoes) {
int n=dominoes.size();
int cnt=0;
for(int i=0;i<n;i++){
int a=dominoes[i][0];
int b=dominoes[i][1];
for(int j=i+1;j<n;j++){
int c=dominoes[j][0];
int d=d... | ALGO | 0.999938 | 6.560443 |
a27f4121-0220-405f-b329-83818198beec | ruchika1806/leetcode_fraz_solutions | First Missing Positive.cpp | // First Missing Positive : LEETCODE-41
//T.C : O(n)
//S.C : O(1)
class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
sort(nums.begin(),nums.end());
int i=0,c1=0;
for(i=0;i<nums.size();i++){
if(nums[i]==1){
c1++;
}
... | ALGO | 0.999937 | 4.315454 |
fccbeedf-a7a6-493e-8a36-7f0a4f83c92b | Abhinav-Chaturvedi-095/Striver_SDE_Sheet_Challenge | Delete Kth node From End.cpp | #include <bits/stdc++.h>
/****************************************************************
Following is the class structure of the LinkedListNode class:
template <typename T>
class LinkedListNode
{
public:
T data;
LinkedListNode<T> *next;
LinkedListNode(T data)
{
... | ALGO | 0.999899 | 5.064531 |
b7c642e8-6f61-4785-af7e-f3e01fd4ae40 | akhilsharmaa/Competitive-Programming | LeetCode/Power of Four/PowerofFour.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Runtime: 6 ms, faster than 6.81% of C++ online submissions for Power of Four.
Memory Usage: 5.9 MB, less than 71.27% of C++ online submissions for Power of Four.
*/
class Solution {
public:
bool isPowerOfFour(int n) {
switch (n) {
case... | ALGO | 0.999592 | 5.716852 |
185aad15-e303-4f3f-ae45-fd2f6fafc0d9 | priyanshu-bajpai/Competitive-Coding- | SPOJ+hackerrank/rev.cpp | # include <iostream>
# include <cstdio>
# include <vector>
using namespace std;
int cnt = -1;
int value;
struct node
{
int data;
struct node *right, *left;
};
typedef struct node node;
node* newNode(int data)
{
cout<<"creating new node with value: "<<data<<endl;
node *temp = (node*)malloc(sizeof(node));
... | ALGO | 0.999946 | 3.774436 |
90b3bdbb-4cde-4b40-8d6b-261b8bf450d8 | Raikyr4/Estudos_C_plusplus | Exercicios Básicos/exercício_4_lista_2_condicional.cpp | //Nome dos integrantes do grupo que participaram da atividade : Raiky Sahb, Vitor Hugo Franco Lopes Azevedo, Guilherme Fernandes Meireles.
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int N,N2; //N=Nmero, N2=Raiz inteira do nmero
float N1; //N1 = Raiz do nmero podendo ter casas decimais
set... | ALGO | 0.999118 | 3.980097 |
7f18cee0-93bc-4fac-9768-76fb1e7ada73 | abhishikat/ADA-LAB-5th-SEM | P8/main.cpp | //
// main.cpp
// A
//
// Created by Abhishikat kumar Soni on 04/12/20.
//
#include<bits/stdc++.h>
using namespace std;
const int Tsize = 200;
class HashNode
{
public:
int k;
int v;
HashNode(int k, int v)
{
this->k= k;
this->v = v;
}
};
class HashMap
{
private:... | ALGO | 0.973597 | 4.538812 |
400f9949-c718-4f49-b5c9-93f065edee01 | keshavrj/Codes | c++/rough(Practice)/mytemp.cpp | #include<bits/stdc++.h>
#include<chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl "\n"
#define int long long int
#define ull unsigned long long int
#define tc long t;cin>>... | ALGO | 0.997468 | 4.819326 |
211e759d-db8b-44aa-bd39-8a8cf6ad19bd | Yashvishnoi/Cpp | abdul81.cpp | #include<iostream>
using namespace std;
int main()
{
int x=10;//constant pointer to integer constant
const int * const ptr=&x;
//++*ptr;//neither you can modify the data
int y=20;
//ptr=&y;//nor you can change the pointer
cout<<*ptr<<" "<<x<<endl;
return 0;
}
| TOOL | 0.958343 | 3.250041 |
57f26c7a-7a54-4147-af33-604cc3a2de41 | showmic96/Online-Judge-Solution | CodeForces/1144F/19062712_AC_171ms_16128kB.cpp | // In the name of Allah the Lord of the Worlds.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int>edges[200005];
int dir[200005] , color[200005];
int vis[200005];
bool check = true;
void dfs(int u , int now = 0)
{
if(vis[u]!=-1){if(vis[u]!=now)check = false;return ;}
vis[u] = now;... | ALGO | 0.999989 | 4.093699 |
8208c042-483c-4983-a942-1480c2a0a6b2 | angelrocha000/Evidencias | 76.cpp | #include<iostream>
using namespace std;
// Angel Josue Rocha Adame
// 24041225
int potencia(int n, int e);
int main(){
int num,exponente;
cout<<"Dame el numero a elevar: ";
cin>>num;
cout<<"Dame la potencia: ";
cin>>exponente;
cout<<num<<" elevado a la "<<exponente<<"="<<potencia(num,exponente);
return 0;
}
... | ALGO | 0.996197 | 4.336239 |
cdad7d00-df1b-43c6-9d98-4b26fc3f3f04 | Xilinx/llvm-aie | libc/src/math/generic/fmaximumf16.cpp | #include "src/math/fmaximumf16.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float16, fmaximumf16, (float16 x, float16 y)) {
return fputil::fmaximum(x, y);
}
} // namespace LIBC_NAME... | ALGO | 0.99393 | 6.324831 |
c568540a-733b-43e9-a725-2c18284c2ee1 | KaisHasan/UVa | UVA_10865_Brownie_Points.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int , int> pi;
typedef pair<double , int > dpi;
typedef pair<long long , long long> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef unsigned long long ull;
#define MP make_pair
#define mem(a , v) mems... | ALGO | 0.999796 | 4.140531 |
d160bf31-1d81-4f46-88e2-f9a1e765b883 | MOHIT-IITP/Leetcode | 1123.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
pair<TreeNode*, int> dfs(TreeNode* root) {
if (!root) {
return {nullptr, 0};
}
auto left = dfs(root->left);
auto right = dfs(root->right);
if (left.second > right.second) {
retur... | ALGO | 0.999933 | 6.233807 |
6a8ab50b-88ab-45f1-aaa3-d80a8ea5c76d | zhufangzhou/leetcode | Ugly Number II.cpp | #include <iostream>
#include <queue>
#include <set>
using namespace std;
/*
class Solution {
public:
int nthUglyNumber(int n) {
priority_queue<long long,vector<long long>,greater<long long> >q;
set<long long> s;
q.push(1);
s.insert(1);
long long m;
for (int i = 0; i < n; i++) {
m = q.top(... | ALGO | 0.999991 | 4.649942 |
8ea6b124-ca64-4732-8b48-e43d5d14688e | jonathanmetzman/botan | src/lib/pubkey/curve25519/curve25519.cpp | #include <botan/curve25519.h>
#include <botan/internal/pk_ops_impl.h>
#include <botan/ber_dec.h>
#include <botan/der_enc.h>
#include <botan/rng.h>
namespace Botan {
void curve25519_basepoint(uint8_t mypublic[32], const uint8_t secret[32])
{
const uint8_t basepoint[32] = { 9 };
curve25519_donna(mypublic, secr... | TOOL | 0.962737 | 7.510605 |
cee63378-b995-4b2b-adc7-62af8a9f1f68 | Apoorva-Kasigavi/code | Quick_Sort.cpp | #include<bits/stdc++.h>
using namespace std;
void Quicksort(int a[],int l,int r);
int partition(int a[],int l,int r);
void fill_random(int arr[],int n)
{
for(int i=0;i<n;i++)
arr[i]=rand()%100;
}
void swap(int *a,int *b)
{
int temp;
temp =*a;
*a=*b;
*b=temp;
}
void print_matrix(int mat[]... | ALGO | 0.999662 | 4.116278 |
233a9e7d-021e-46e6-9c26-4f1ac15d4c1f | bossxu/acm | 比赛/icpc/青岛/i.cpp | #include<bits/stdc++.h>
using namespace std;
#define clr(shu,x) memset(shu,x,sizeof(shu))
#define INF 0x3f3f3f3f
#define pi acos(-1)
#define loge exp(1)
#define ll long long
#define pb push_back
#define ios_close ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
const int mod = 1e9+7;
const double eps = 1e... | ALGO | 0.999934 | 3.960117 |
89074ec6-029a-4f8f-b51d-54376f5488a2 | ishandutta2007/codeforces | wenhao801/normal/1721/E.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cassert>
using namespace std;
inline int read() {
int ret = 0, t = 1;
char c = getchar();
while ((c < '0' || c > '9') && c != '-') c = getchar();
if (c == '-') t = -1, c = getchar();
while (c >= '0' && c <= '9') ret = ret * 1... | ALGO | 0.999978 | 3.829567 |
035b7fbb-237c-4cb3-86bc-8973997847fd | alexkats/Code | Petrozavodsk-choose/2013/Own/07.12.2013/R/R.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <set>
#include <bitset>
#include <map>
#include <cassert>
#include <cctype>
#include <ctime>
#include <stack>
#include <queue>
#include <deque... | ALGO | 0.999945 | 3.206413 |
0d2b01e2-0c82-4b4f-ac3b-2845ee3c442f | P1GGGGGG/Algorithm | list/ac1388.cpp | //#include<bits/stdc++.h>
//
//using namespace std;
//const int N = 110;
//int n;
//int w[N];
//int f[N][N];
//
//
//int main() {
// scanf("%d", &n);
// for (int i = 0; i < n; ++i) {
// scanf("%d", &w[i]);
// }
// for (int len = 1; len <= n; ++len) {
// for (int i = 0; i + len - 1 < n; ++i) {
... | ALGO | 0.999949 | 3.462146 |
acc58403-6df1-4e69-9434-19426a3869cb | myeongjae-kim/mj-library | Euler_Project/prob014/problem14_new.cpp | #include <iostream>
#include <unordered_map>
int getCollatzChainNumber(unordered_map<int, int> &map, const int n);
int main(int argc, const char *argv[])
{
int answer = 0;
int maxCollatzNumber = 0;
unordered_map<int, int> collatzChainMap;
for (int i = 1; i < 1000000; i += 2) {
int collatzNumb... | ALGO | 0.999951 | 5.572676 |
d0cbe55f-6750-45bf-b9fe-eb51d8552faa | vaginessa/Sandboxie-crack-auto-build | Sandboxie/apps/start/menu.cpp | //---------------------------------------------------------------------------
// Start Menu
//---------------------------------------------------------------------------
#include "stdafx.h"
#include "common/defines.h"
#include "common/list.h"
#include "core/dll/sbiedll.h"
#include "msgs/msgs.h"
#include "common/my_ve... | TOOL | 0.862197 | 5.488951 |
89f64207-3e13-4d3f-9899-2acaa27967d0 | Abdalasaber/Some-applications | To_Do_App/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.998763 | 6.76073 |
e15a616c-bc66-41bc-bd74-4385dda57f28 | shaileshnift/btcps | src/wallet/crypter.cpp | #include <wallet/crypter.h>
#include <crypto/aes.h>
#include <crypto/sha512.h>
#include <util/system.h>
#include <vector>
int CCrypter::BytesToKeySHA512AES(const std::vector<unsigned char>& chSalt, const SecureString& strKeyData, int count, unsigned char *key,unsigned char *iv) const
{
// This mimics the behavio... | TOOL | 0.940144 | 7.277121 |
66f997c5-9a96-475f-a822-19ce512276b1 | nacuabessie/capstone_igarchu_ver2 | igarchu_capstone_ver2/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.998853 | 6.785645 |
162b71f5-1c25-437a-85c0-6b1308a60476 | alexalcon/cpp_how_to_program_11ed_deitel_exercises | ch03/exercise_3_27_v1_0_0.cpp | /**
* File: exercise_3_27_v1_0_0.cpp
* Author: Alex Alcón
* GitHub: https://github.com/alexalcon
* -------------------------------------------------------------------------------------------------
* Description: Other Boost Multiprecision Arithmetic Operations) Section 3.14 introduced the Boost
* M... | ALGO | 0.965188 | 4.238358 |
35a2ddd6-7a8f-47cc-ab0b-121b555ec55d | slonichobot/codebook | math/divisors.cpp | #include "../template.cpp"
// Finds all divisors of n
// in O(sqrt(n))
vll divisors(ll n){
vll a,b;
for (int i = 1; i*i <= n; ++i) {
if(n % i == 0){
a.pb(i);
b.pb(n/i);
}
}
if(b.back()==a.back())b.pop_back();
reverse(b.begin(),b.end());
a.insert(a.end(),... | ALGO | 0.999453 | 4.771204 |
09f187eb-794c-4c25-a5b7-2be2f992e32e | sarthaknarain2x/DSA-Practice | LeetCode/jewels and stones.cpp | class Solution {
public:
int numJewelsInStones(string jewels, string stones) {
int c=0;
for(int i=0; i<jewels.length(); i++) {
for(int j=0; j<stones.length(); j++) {
if(jewels[i] == stones[j])
c++;
}
}
return c;
}
};
| ALGO | 0.999438 | 5.802638 |
12deca5d-9f78-4afe-9e91-8070c85abb70 | raincross7/code-similarity | codes/train_code/problem300/problem300_321.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
// int main() {
// int n, m;
// cin >> n >> m;
// vector<int> a(n);
// rep(i,m) {
// int k;
// cin >> k;
// rep(j,k) {
// int ... | ALGO | 0.999945 | 4.370638 |
f1de3514-f620-4ffa-a246-155868b3d9d7 | raincross7/code-similarity | codes/train_code/problem298/problem298_216.cpp | #include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using nam... | ALGO | 0.999748 | 3.741345 |
ff1fb713-c0af-4103-ad5b-dba1819d8b83 | gitHubwhl562916378/opencv4.3 | opencv_contrib-4.3.0/modules/cudaoptflow/src/brox.cpp | #include "precomp.hpp"
using namespace cv;
using namespace cv::cuda;
#if !defined (HAVE_CUDA) || !defined (HAVE_OPENCV_CUDALEGACY) || defined (CUDA_DISABLER)
Ptr<BroxOpticalFlow> cv::cuda::BroxOpticalFlow::create(double, double, double, int, int, int) { throw_no_cuda(); return Ptr<BroxOpticalFlow>(); }
#else
names... | ALGO | 0.979249 | 6.9091 |
3bbdd84b-ce08-4a5a-920e-1053631e8366 | ishandutta2007/codeforces | doped.silicon/normal/1065/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define fr(i,a,b) for (int i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (int i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (int i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (int i = (n) - 1; i >= 0; i--)
#define foreach(it,ar) for ( typeof(ar.beg... | ALGO | 0.999968 | 3.794152 |
a11064fb-0480-4af6-9520-75fe6c96d819 | pradeep891/6Companies30Days | Goldman Sachs/q4 Run Length Encoding .cpp | #include <bits/stdc++.h>
using namespace std;
string encode(string src);
int main() {
int T;
cin>>T;
while(T--)
{
string str;
cin>>str;
cout<<encode(str)<<endl;
}
return 0;
}// } Driver Code Ends
/*You are required to complete this function */
string encode(string src)
{
//Your code her... | ALGO | 0.999971 | 6.000671 |
8f5c325a-fcfe-43e7-932d-6481a365b916 | sahilmadaan048/crispy-chainsaw-ladders | 1300 to 1399 rating/problem 1(A. Arrival of the general)/main.cpp | // https://codeforces.com/problemset/problem/144/A
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> heights(n); // Properly initialize the vector with size n
for(int i = 0 ; i < n ; i++){
cin >> heights[i];
}
// now we have the heights
// l... | ALGO | 0.999958 | 4.831772 |
113c9644-e9ee-4e89-96ad-7ee9cc54b726 | CAPDGroup/CAPD | capdExt/cxsc-2-5-4/CToolbox/Modules/nlfzero.cpp | /* CVS $Id: nlfzero.cpp,v 1.15 2014/01/30 18:13:37 cxsc Exp $ */
using namespace cxsc;
using namespace std;
static int MaxZeroNo; // Maximum number of zeros to be computed
//----------------------------------------------------------------------------
// Error codes used in this module.
//----------------------... | ALGO | 0.999823 | 7.167548 |
5deb21ff-861b-4457-90df-0a61d8f14052 | ishandutta2007/codeforces | kevinwan/normal/1622/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mn=2e5+10;
int a[mn],o[mn],ro[mn];
string s;
void solve(){
int n;
cin>>n;
for(int i=0;i<n;i++)cin>>a[i];
cin>>s;
iota(o,o+n,0);
sort(o,o+n,[](int i,int j){
if(s[i]!=s[j])return s[i]<s[j];
return a[i]<... | ALGO | 0.999947 | 3.999185 |
35206ec0-7fde-4afe-bf58-6443b69b4649 | ldx123000/Tugraph_Tarjan | procedures/algo_cpp/wpagerank_core.cpp | #include "lgraph/olap_base.h"
#include "./algo.h"
using namespace lgraph_api;
using namespace lgraph_api::olap;
void WPageRankCore(OlapBase<double> &graph, int num_iterations, ParallelVector<double>& curr) {
auto all_vertices = graph.AllocVertexSubset();
auto next = graph.AllocVertexArray<double>();
size_... | ALGO | 0.999962 | 4.031118 |
9523a685-9627-4b62-8bfb-c31ceac17046 | Sumit11Rawat/Leetcode_codes | 26-remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int j=0;
int k=0;
int ans=0;
int si=nums.size();
for(int i=0;i<nums.size();i++){
if(i==nums.size()-1){
continue;
}
if(nums[i]==nums[i+1]){
nums.... | ALGO | 0.99992 | 5.987092 |
c7e81162-1810-4b93-9fb2-75def482ad83 | VRMGOrganization/Vismaya | blender-2.68/extern/bullet2/src/BulletSoftBody/btDefaultSoftBodySolver.cpp | #include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
#include "btDefaultSoftBodySolver.h"
#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
#include "BulletSoftBod... | ALGO | 0.927231 | 7.064888 |
415f5011-05d2-4c71-9411-a28fda46b592 | BlossomSeas/ppsspp | Common/Math/math_util.cpp | #include "Common/Math/math_util.h"
#include <stdlib.h>
// QNX can only use RunFast mode and it is already the default.
#if defined(__ARM_ARCH_7A__)
// Enables 'RunFast' VFP mode.
void EnableFZ() {
int x;
asm(
"fmrx %[result],FPSCR \r\n"
"orr %[result],%[result],#16777216 \r\n"
"fmxr FPSCR,%[result]"
:[result... | TOOL | 0.880401 | 5.399535 |
47a514cb-cb4b-4b30-8e31-cdbae21ed666 | ncuoolab/domjudge | submissions/c2.s294.ncu100502008.ProblemB.cpp.0.ch2.cpp | #include <string>
#include <iostream>
using namespace std;
int main() {
//bool correct=true;
string in;
string out="";
string nout="";
string str="";
string temp="0";
bool finish=false;
bool nl=false;
while(getline(cin,temp)){
in+=temp;
}
int count=0,type=0;
... | TOOL | 0.874089 | 3.477557 |
570d9ec1-831a-40f9-989f-496f5897690b | peakPlus/cpp-leetcode | 232. 用栈实现队列.cpp | #include <iostream>
#include <stack>
using namespace std;
class MyQueue {
private:
stack<int> inStack, outStack;
void in2out() {
while (!inStack.empty()) {
outStack.push(inStack.top());
inStack.pop();
}
}
public:
MyQueue() {}
void push(int x) {
in... | ALGO | 0.998934 | 5.422889 |
e1681ac5-c7fc-4bfc-8e53-efaf72015bc2 | mdelorme/gravity_solver_stream | session2/src/particles.cpp | #include "particles.h"
namespace gravity {
double Particle::G = 6.67e-11;
Particle::Particle(std::initializer_list<double> init) {
int i=0;
for (auto v: init) {
switch (i) {
case 0: x = v; break;
case 1: y = v; break;
case 2: z = v; break;
case 3: vx = v; break;
case 4: vy = v; ... | ALGO | 0.99403 | 4.987003 |
d38f2d2c-572a-44bd-93a0-c2b9de24f2d1 | JeffProgrammer/PhysX5-Cmake | physx/source/physxvehicle2/src/physxRoadGeometry/VhPhysXRoadGeometryFunctions.cpp | #include "vehicle2/PxVehicleParams.h"
#include "vehicle2/roadGeometry/PxVehicleRoadGeometryState.h"
#include "vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryFunctions.h"
#include "vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryParams.h"
#include "vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryState.h... | ALGO | 0.952548 | 4.92315 |
82f34976-e4b5-4966-85ca-5dcdae95d897 | AditParekh22/Leetcode-Solutions | 1887-minimum-degree-of-a-connected-trio-in-a-graph/1887-minimum-degree-of-a-connected-trio-in-a-graph.cpp | class Solution {
public:
int minTrioDegree(int n, vector<vector<int>>& edges) {
vector<vector<int> > m(n+1, vector<int>(n+1));
vector<int> d(n+1, 0);
for(auto it: edges){
int u = it[0];
int v = it[1];
m[u][v] = 1;
m[v][u] = 1;
d[... | ALGO | 0.999931 | 5.461335 |
0fec7697-4d6b-4387-a089-bba4b609fde7 | chasseneige109/PS | 백준_단계별/스택, 큐, 덱 2/5977.cpp | #include <iostream>
#include <deque>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, K;
cin >> N >> K;
vector<ll> A(N + 1), psum(N + 1), dp(N + 1);
psum[0] = 0;
for (int i = 1; i <= N; i++) {
... | ALGO | 0.999763 | 3.948459 |
f3f0eea3-126d-4b75-818b-81a12af7ab7a | h-square/Periodic-Frequent-Pattern-Mining | test-optimized.cpp | #include <cassert>
#include <cstdlib>
#include <iostream>
#include <cstdint>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <utility>
#include <fstream>
#include <sstream>
#include <omp.h>
#include <sys/time.h>
#include "fptree.hpp"
using namespace std;
int TDB_SIZE = 0;
double TOTAL_T... | ALGO | 0.999678 | 5.340015 |
3078fc46-1dd6-494a-b241-1fbaffde0853 | Gowthamnaik1234/c-revision | sum of natural numbers for loop.cpp | #include<iostream>
using namespace std;
int main()
{
int n,sum=0;
cout<<"How many numbers do you want to add?";
cin>>n;
int arr[n];
cout<<"\n Enter numbers:";
for(int i=0;i<n;i++)
cin>>arr[i];
for(int i=0;i<n;i++)
sum+=arr[i];
cout<<"\n sum is:"<<sum;
return 0;
}
| ALGO | 0.995616 | 3.243159 |
3235cc8d-f6e6-499a-9bb3-8642b6fd0fdf | mahmoud74-hue/wheather-depi | 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 |
3d55971b-1962-4028-9c0a-3f8fb0a2a705 | DONXUX/algorithm-study | Algorithm/17406 배열 돌리기 4/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
constexpr int INF = 9999999;
struct op {
int r, c, s;
};
int n, m, k;
int map[51][51];
int tmp_map[51][51];
vector<op> ops;
vector<int> order;
void copy_map() {
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
tmp_map[i]... | ALGO | 0.999829 | 4.319314 |
4929226a-02fb-47b4-877c-4d68d62c9f24 | coolyuyuyu/leetcode | algorithm_0000-0999/023-Merge k Sorted Lists/main.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
ListNode* pHead = NULL;
ListNode** ppCur = &pHead;
whi... | ALGO | 0.999897 | 6.011292 |
46a481ab-c19e-48ff-adf6-a8d6a006c10b | iwtbam/leetcode | code/lt0722.cpp | // https://leetcode-cn.com/problems/remove-comments/
// remove comments
class Solution {
public:
vector<string> removeComments(vector<string>& source) {
size_t line_no = source.size();
vector<string> res;
int state = 0, nstate = 0;
unordered_map<char, unordered_map<int, int>> state_... | ALGO | 0.999159 | 5.104601 |
7e70319d-421b-4ce4-8bdd-77f5615c2af5 | fanghao1024/poj | ural1519_3.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int HASH=40001;
ll dp[2][1<<24],ans;
int state[2][1<<24];
int N,M,now,pre,endx,endy;
int total[2];
int Hash[HASH];
int map[15][15];
void init(){
memset(map,0,sizeof(map));
endx=-1;
for(int i=0;i<N;i++){
char c... | ALGO | 0.999792 | 3.020601 |
19933405-8e2e-48a3-a4a0-359fef5077d5 | m09irul/Solutions-of-online-judges | codes/codeforces/C/Dijkstra.cpp | #include <bits/stdc++.h>
using namespace std;
#define infinity 1<<30 //2^30
const int MAXN = 1e5 + 3;
int path[MAXN];
int dijstkra(int n, vector<pair<int,int> > v[], int source){
path[1] = 1;
int distance[n+1];
for(int i=1;i<=n;i++) {
distance[i] = infinity;
}
//cout<<distance[n]<<endl;
... | ALGO | 0.999978 | 3.76278 |
944348bb-1d13-40eb-b7b5-274a263df6ee | sjm150/ps | baekjoon/3460/solution.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
for (int i = 0; n; i++, n /= 2) {
if (n & 1) cout << i << ' ';
}
cout << '\n';
}
} | ALGO | 0.999986 | 4.938501 |
453689eb-2446-4f06-89aa-cc002c906d1e | gsidhard/llvm-crash-analyzer | llvm-15.0.3/libcxx/test/std/containers/sequences/vector.bool/emplace.pass.cpp | // UNSUPPORTED: c++03, c++11
// <vector>
// vector<bool>
// template <class... Args> iterator emplace(const_iterator pos, Args&&... args);
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
TEST_CONSTEXPR_CXX20 bool tests()
{
{
typedef std::vector<bool> C;
C... | TEST | 0.940448 | 5.546942 |
7447478c-0744-4c66-8ad3-acb012c428e6 | mohit-me/Spoj | FAVDICE-6150416-src.cpp | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int cases;
cin>>cases;
while(cases--)
{
float n,t;
cin>>n;
t=n;
float num=1;
while(n-->1)
{
num+=float((t*1/n));
}
printf("%.2f",num);
cout<<endl;
... | ALGO | 0.998507 | 3.013428 |
45b8ca41-2fff-4343-84ac-f99c8e3a3989 | hojonathanho/timb | ext/eigen-3.2.0/unsupported/doc/examples/BVH_Example.cpp | #include <Eigen/StdVector>
#include <unsupported/Eigen/BVH>
#include <iostream>
using namespace Eigen;
typedef AlignedBox<double, 2> Box2d;
namespace Eigen {
namespace internal {
Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point
}
}
struct Poin... | ALGO | 0.999843 | 6.562787 |
cd95d6aa-8e63-4e1a-902c-83b375bfe1d3 | ishandutta2007/codeforces | sevlll777/normal/1406/E.cpp | #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>
#include <cstring>
#include <chrono>
... | ALGO | 0.999983 | 3.196199 |
f1bdff88-fc7e-4997-8cf4-d28118921b75 | gafeol/competitive-programming | ojs/cf/776/D2.cpp |
#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(s... | ALGO | 0.999989 | 3.806324 |
2f8efb86-e42f-47be-b6ce-3b0f86851756 | ishandutta2007/codeforces | matrixcascade_qwq/normal/1188/C.cpp | /*
qwq
*/
//#pragma GCC optimize("Ofast", "unroll-loops")
//#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4", "avx")
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define YES puts("YES")
#define NO puts("NO")
#define Yes puts("Yes")
#define No puts("No")
#define edl puts("")
#de... | ALGO | 0.999937 | 4.066717 |
ed16c839-ec13-438d-9e4a-ab2fa592f4d4 | NCommander/openbsd-src-with-branches | gnu/llvm/llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp | #include "llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <iomanip>
#include <sst... | TOOL | 0.866798 | 7.898589 |
e82d7fc5-719a-493c-8ef5-0c7939d12229 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3447_1.cpp | #include <bits/stdc++.h>
using namespace std;
const int LG = 18;
const int MX_N = 100005;
int n, q;
vector<int> G[MX_N];
struct SegTree {
pair<int, int> seg1[MX_N * 4], seg2[MX_N * 4];
void Merge(int nd, int lft, int rgt) {
seg1[nd] = min(seg1[lft], seg1[rgt]);
seg2[nd] = max(seg2[lft], seg2[rgt]);
}
vo... | ALGO | 0.999964 | 4.344742 |
08511e3f-0d7c-4b1a-8bd0-5df95bd0426a | gtxzsxxk/thulogin | lib/hash-lib/sha1.cpp | #include "sha1.h"
// big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
/// same as reset()
SHA1::SHA1()
{
reset();
}
/// restart
void SHA1::reset()
{
m_numBytes = 0;
m_bufferSize = 0;
// according to RFC 1321
m_hash[0] = 0x67452301;
m_hash[1] = 0xefcdab89;
m_hash[2] = 0x98badcfe;
m_h... | ALGO | 0.930387 | 7.010505 |
a09d9dea-00cf-4eec-926c-d9034d51bf0c | AdarshPatil04/DSA-Notes | Dynamic Programming/0-1-KnapSack-2D DP/spaceOptimization_1.cpp | /**
* Time Complexity: O(N*W), where N is the number of items and W is the maximum weight
* Space Complexity: O(2*maxWeight) for the dp array
* This code solves the 0/1 Knapsack problem using tabulation with space optimization.
* Given a set of items, each with a weight and a value, the goal is to determine the max... | ALGO | 0.999997 | 6.973502 |
244c3e54-01e6-4cb4-81c6-fdaada3d0935 | prakashsingh1609/100-Days-Of-Code | Day 91/Problem 1/SortSentence.cpp | class Solution {
public:
string sortSentence(string s) {
stringstream ss(s);
string word;
vector<string>v(10);
int count=0;
while(ss>>word){
v[word.back()-'0'] = word.substr(0,word.size()-1);
count++;
}
string res="";
for(int ... | ALGO | 0.999955 | 6.513732 |
817d801b-690e-4d81-951e-7fe6cdd64b1a | krymus/AnalysisOfAlgorithms | L2/Zadanie1/RANDG.cpp | #include <iostream>
#include <random>
using namespace std;
random_device rd;
mt19937 gen(rd());
int random(int low, int high)
{
uniform_int_distribution<> dist(low, high);
return dist(gen);
}
int main(int argc, char *argv[])
{
int n;
try {
n = stoi(argv[1]);
} catch(exception e)
{
... | ALGO | 0.983323 | 3.434854 |
16ade546-245e-47cf-9802-22143b24466a | mruegenberg/houdini-transform-matcher | eigen/doc/snippets/MatrixBase_all.cpp | Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones());
Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs();
// let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax:
cout << "Is (" << p0.transpose() << ") inside the box: "
<< ((boxMin.array()<p0.array(... | ALGO | 0.985531 | 3.51303 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.