uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d11f09f9-1a96-43e4-930e-71cf205b8018 | yasm/yasm-nextgen | lib/yasmx/Support/MD5.cpp | /* Note regarding cvs_* namespace: this avoids potential conflicts
with libraries such as some versions of Kerberos. No particular
need to worry about whether the system supplies an MD5 library, as
this file is only about 3k of object code. */
#include "yasmx/Support/MD5.h"
#include <cstring>
using namesp... | ALGO | 0.995355 | 6.79208 |
cda5583a-ef81-49a5-84a5-f014689f01fe | harshaithireddy/GeeksForGeeks-Codes | Easy/Armstrong Numbers/armstrong-numbers.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:
string armstrongNumber(int n){
// code here
int temp = n;
int sum = 0;
while(temp > 0) {
in... | ALGO | 0.999847 | 6.205137 |
67d126b6-f5c6-45c8-8407-fa932a5ee0e3 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_1182_3.cpp | #include <bits/stdc++.h>
using namespace std;
namespace fastIO1 {
inline char read() {
static const int IN_LEN = 1000000;
static char buf[IN_LEN], *s, *t;
return (s == t ? t = (s = buf) + fread(buf, 1, IN_LEN, stdin),
(s == t ? -1 : *s++) : *s++);
}
template <class T>
inline void read(T &x... | ALGO | 0.999949 | 3.479304 |
568cc64e-95bd-4a96-bc1b-d5628c72e0d5 | Aspetto33/leetcode | c++/1049.最后一块石头的重量II/1049-最后一块石头的重量II.cpp | class Solution {
public:
int lastStoneWeightII(vector<int>& stones) {
vector<int> dp(1501,0); //ʼdp
int sum = 0; //¼stonesԪܺ
for(int i = 0;i<stones.size();i++) sum+=stones[i];
int target = sum/2; //ȡ
for(int i = 0;i<stones.size();i++){
for(int j = target;j>=s... | ALGO | 0.999557 | 5.355341 |
e125bf3d-4403-4015-9855-7e68d11ca040 | Tongyuang/EdgeTile | EdgeTileServer/libs/opencv/modules/video/src/bgfg_KNN.cpp | //#include <math.h>
#include "precomp.hpp"
#include "opencl_kernels_video.hpp"
namespace cv
{
/*!
The class implements the following algorithm:
"Efficient Adaptive Density Estimation per Image Pixel for the Task of Background Subtraction"
Z.Zivkovic, F. van der Heijden
Pattern Recognition Letters, vol. 27, no. 7... | ALGO | 0.995716 | 6.886083 |
947d9997-05e5-4554-bd0a-b6603d96fcb1 | krishauser/KrisLibrary | utils/CoverSet.cpp | #include <KrisLibrary/Logger.h>
#include "CoverSet.h"
#include <iostream>
#include <algorithm>
#include <set>
#include <list>
#include <errors.h>
/*
//returns true if it spills over the max value
template <class T>
bool increment(vector<T>& counter,const T& max,const T inc=1)
{
T carry=inc;
for(int k=(int)counter.... | ALGO | 0.99472 | 6.531278 |
897978c6-fb3c-4c87-8c20-7b947162e20d | zuirez/AIUB_BIN | C++/EXAM QUESTIONS/Quiz2.cpp | #include<iostream>
using namespace std;
int main()
{
int a=1, b=0;
float arr22[6], arr23[6];
float counter=0, counter2=0;
cout<<"Enter bills of 2022 :";
do
{
for(int i=0; i<6; i++)
{
cin>>arr22[i];
counter=counter+arr22[i];
}
}
while (b>... | ALGO | 0.994742 | 3.24104 |
6991a5a0-355b-43d9-8f34-116603bd1da3 | ishandutta2007/codeforces | thienu/normal/1360/E.cpp | #include <bits/stdc++.h>
#define u_map unordered_map
#define u_set unordered_set
using ll = long long;
using namespace std;
void solve(){
int n;
cin >> n;
vector<vector<int>> matrix(n+1, vector<int>(n+1, 1));
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
char c;
... | ALGO | 0.999789 | 5.477143 |
1a23a893-b545-494d-abf9-9e8b81f0909f | laineywatlington/cs130a_pa1 | BloomFilter.cpp | #include "IntegerHashes.h"
#include "StringHashes.h"
#include "BloomFilter.h"
using namespace std;
BloomFilter::BloomFilter(int k, int m, std::string strfn, std::string intfn){
this->k = k;
this->m = m;
this -> bits = new uint64_t[m]();
intfns = new IntegerHash*[k];
if(strfn == "jenkins"){
this -> s... | ALGO | 0.959678 | 5.502362 |
93aae73f-cb4b-4daa-914f-8cce4ffbddd1 | Chan531/BaekJoon_Online_Judge | 팩토리얼.cpp | #include <iostream>
using namespace std;
int multi(int i)
{
if (i == 0)
return 1;
return i * multi(i - 1);
}
int main(void)
{
int n = 0;
cin >> n;
cout << multi(n);
} | ALGO | 0.999985 | 5.1366 |
1b10baf3-74c2-46d3-b372-91b270ec62ba | Anbuhp/DSA-Practical | Linear sort.cpp | Program
#include<iostream>
using namespace std;
int main()
{
int a[10],i,f=0,value;
cout<<"enter the elements: \n";
for(i=1;i<=10;i++)
{
cin>>a[i];
}
cout<<"enter the element to serach: \n";
cin>>value;
for(i=1;i<=10;i++)
{
if(a[i]==value)
{
cout<<"location:"<<i;
f=1;
break;
}
}
if(f==0)
{
cout<<"element not found";
}
... | ALGO | 0.999054 | 3.231519 |
bef0b2fa-20e9-42da-aef1-e6e247c99585 | Nero-TheThrill/UE4_ShortTest | UnrealEngine-4.25/Engine/Plugins/Experimental/ProxyLODPlugin/Source/ThirdParty/UVAtlasCode/UVAtlas/isochart/vertiter.cpp | #include "pch.h"
#include "vertiter.h"
#include "isochartmesh.h"
using namespace Isochart;
CVertIter::CVertIter(const uint32_t* rgdwAdjacency)
:m_rgdwAdjacency(rgdwAdjacency),
m_dwCurrentFaceID(0),
m_dwCurrentVertIdx(0),
m_dwPrevFaceID(0),
m_dwPrevVertIdx(0),
m_dwBeginFaceID(0),
m_dwBeginV... | TOOL | 0.890268 | 5.206645 |
cee4ea93-a4f9-4d49-ae92-af4fd8d2e375 | Vick7Coder/NhapMonLapTrinhHCMUTE | LEVEL4/BAI7.cpp | #include<stdio.h>
void InPut(int &n);
int ChecChan(int n);
void OutPut(int n);
int main()
{
int n;
InPut(n);
OutPut(n);
return 0;
}
void InPut(int &n)
{
printf("vui long nhap n: ");
scanf("%d",&n);
}
int ChecChan(int n)
{
int check = 1;
for(int i=n;n!=0;n/=10)
{
if((n % 10) % 2 == 1)
{
... | ALGO | 0.999753 | 3.386121 |
809c33cb-3f9c-4639-832e-b921f0512ffc | hitonanode/cplib-cpp | utilities/test/kth_power_sum.yuki665.test.cpp | #define PROBLEM "https://yukicoder.me/problems/no/665"
#include "../kth_power_sum.hpp"
#include "../../modint.hpp"
#include <iostream>
using namespace std;
int main() {
long long n;
int k;
cin >> n >> k;
kth_power_sum<ModInt<1000000007>> kps;
cout << kps.prefix_sum(k, n) << '\n';
}
| ALGO | 0.999888 | 4.72023 |
1a066b69-79c2-4995-a980-42c84f496bce | twinkite/ALGORITHM | BOJ/14675.cpp | #include <iostream>
#include <vector>
using namespace std;
int N, q;
vector<int> indegree;
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
cin>>N;
indegree=vector<int> (N+1);
int a, b;
for(int i=0;i<N-1;i++){
cin>>a>>b;
indegree[a]++;
indegree[b]++;
}
... | ALGO | 0.999955 | 4.239765 |
5aa1965e-2c6b-432d-bc7a-efd93021f7c4 | Deep-023/LeetCode-questions | 0044-wildcard-matching/0044-wildcard-matching.cpp | class Solution {
public:
vector<vector<int>>dp;
bool solve(string& s, string& p, int i, int j){
if (i<0 && j<0)
return true;
else if (i>=0 && j<0)
return false;
else if (i<0 && j>=0){
for(int k=j;k>=0;k--)
if(p[k]!='*')
... | ALGO | 0.999989 | 5.041297 |
ea73605a-4d59-4aa5-9b79-91bd4dd78d8e | Metrological/cobalt | src/third_party/skia/src/pathops/SkPathOpsWinding.cpp | // given a prospective edge, compute its initial winding by projecting a ray
// if the ray hits another edge
// if the edge doesn't have a winding yet, hop up to that edge and start over
// concern : check for hops forming a loop
// if the edge is unsortable, or
// the intersection is nearly at the ... | ALGO | 0.999923 | 6.661753 |
04a237d4-60d3-41a2-a302-4ad1696c2f98 | HuynhCongLap/StageSupportContact | release/src/ode-0.16/ode/demo/demo_jointPR.cpp | /*
This file try to demonstrate how the PR joint is working.
The axisP is draw in red and the axisR is in green
*/
#include <ode/ode.h>
#include <drawstuff/drawstuff.h>
#include <iostream>
#include <math.h>
#include "texturepath.h"
#ifdef _MSC_VER
#pragma warning(disable:4244 4305) // for VC++, no precision loss ... | ALGO | 0.926163 | 5.850632 |
a800cd4a-a60d-4410-b537-8017d4a4685b | deepansha-singh/CodeChef-Problems | C++/PSHOT-Penalty_Shoot-Out_II.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#in... | ALGO | 0.999929 | 4.644445 |
eb8182d8-ecef-4723-a929-f6d27aa02781 | PixelOS-Fourteen/frameworks_av | media/module/codecs/mp3dec/src/pvmp3_stereo_proc.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_stereo_proc.cpp
Functions:
pvmp3_st_mid_side
pvmp3_st_intensity
pvmp3_stereo_proc
-------------------------------------------------------------------------... | ALGO | 0.996654 | 6.369782 |
8546331b-3c69-4666-8d6c-8524554463a0 | RichieDatalyst/Semester-Work | PF/PF2/L07_Q2.cpp | #include<iostream>
using namespace std;
void Set_Intersection(int arr1[],int arr2[],int n1,int n2){
int i=0,j=0;
while(i<n1&&j<n2){
if(arr1[i]<arr2[j]){
i++;
}
else if(arr1[i]>arr2[j]){
j++;
}
else{
cout<<"Intersection Is : "<<arr1[i++]<<" ";
j++;
}
}
}
int main(){
int n1;
cout<<"Enter The Siz... | ALGO | 0.99968 | 3.661679 |
7f7434dc-ca05-4a2b-a4a9-816d21e2cc11 | capnmav77/Core-Programming | STL/DSA/Arrays/2-D Array/Spiral Matrix II.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=HXdCemhtrNA
Company Tags : Paytm, Zoho, Morgan Stanley, Accolite, Amazon, Microsoft, Snapdeal, D-E-Shaw, MakeMyTrip, Oracle, MAQ Software, nearbuy, Nagarro, BrowserStack
Frequency : 64%
Leetcode Qn Link ... | ALGO | 0.99991 | 6.584619 |
06bec049-b4c9-4032-98a8-d05c377c08b9 | shriharshpatil23/Data-Structures-and-Algorithms | Flattening a Linked List - GFG/flattening-a-linked-list.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
struct Node{
int data;
struct Node * next;
struct Node * bottom;
Node(int x){
data = x;
next = NULL;
bottom = NULL;
}
};
using namespace std;
void printList(Node *Node)
{
while (Node != NULL)
{
printf("%d ", Node->data);
... | ALGO | 0.9996 | 4.718823 |
fa49e720-4668-4361-8e03-311cb07c844b | rkq/cxxexp | third-party/src/boost_1_56_0/libs/geometry/test/algorithms/disjoint.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Unit Test
#include <algorithms/test_disjoint.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/strategies/strategies.hpp>
#include <test_common/test_point.hpp>
#include <algorit... | TEST | 0.889933 | 7.788253 |
06c4e7b4-983c-4972-85bd-1f4c7c113f97 | alvarohenriquecz/Algorithms_C-Plus-Plus_Part2 | Algorithms_C-Plus-Plus_Part2.1/greedy_algorithms/huffman.cpp | //C++ program for Huffman Coding
#include <iostream>
#include <queue>
using namespace std;
// A Huffman tree node
struct MinHeapNode
{
// One of the input characters
char data;
// Frenquency of the character
unsigned freq;
// Left and right child
MinHeapNode *left, *right;
MinHeapNode(c... | ALGO | 0.999993 | 5.443933 |
b3297e2b-27fd-4e0a-a401-7a6c2ce0cc13 | exent3x/c-_mipt_dafe | matrix.cpp | #include <iostream>
double matrix_determinant(double matrix[],unsigned int n)
{
double kef,det;
det = 1;
for (int i = 0; i < n*n; i+=n)
{
for (int j=i+1;j<n;j+=1)
{
kef = -1*matrix[j*n] / matrix[i*n];
for (int k = 0; k <n;k++)
{
... | ALGO | 0.999976 | 4.002565 |
8ea716e4-e434-48d0-8a47-f1faaab5b736 | tfg1434/cp | USACO/barnTree.cpp | #include <bits/stdc++.h>
using namespace std;
using pll = pair<long long, long long>;
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define eb emplace_back
#define f first
#define s second
template<typename A, typename B> ostream& operator<<(ost... | ALGO | 0.999879 | 4.383745 |
ed5cbd3f-2653-45d6-94e8-70ca7a097487 | rupertl/euler | 001/brute_force.cpp | #include "EulerRegistry.hpp"
// PROBLEM
// If we list all the natural numbers below 10 that are multiples of 3
// or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
// Find the sum of all the multiples of 3 or 5 below 1000.
// SOLUTION
// Count up to 1000 and sum all numbers with mod 3 / mod 5 = 0
EulerIn... | ALGO | 0.998617 | 5.591254 |
9498d62d-8a36-461f-8d9c-42f4425f57cf | MOkASiH/Labs_PSTU_2023 | Sem_2/Labs/3/Fibonacci/Fibonacci.cpp | #include <iostream>
using namespace std;
int fib(int f) {
if (f < 1) {
return 0;
}
else if (f == 1) {
return 1;
}
return fib(f - 1) + fib(f - 2);
}
int main() {
int n = 10;
for (int i = 0; i < n; i++) {
cout << fib(i) << " ";
}
return 0;
} | ALGO | 0.999843 | 4.419896 |
09d0ad2e-0895-4b68-8453-f0e72cf5ba73 | theoden42/code-store | codeforces/Codeforces Round 752 (Div. 1)/brute.cpp |
/* author: (g)theoden42 */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define all(a) a.begin(), a.end()
#ifdef ON_PC
#include <debug.h>
#else
#define debug(x...)
#endif
template<typename T>
using o... | ALGO | 0.994936 | 3.900461 |
da6c7d35-caea-4f86-99e9-406a89b153f1 | kaufmann-a/ETH_AlgoLab | 12_iron_islands/src/algorithm.cpp | #include <limits>
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <fstream>
int findLongestWay(std::vector<int> &curArray, int k){
int rightPos = 0;
int leftPos = 0;
int curSum = 0;
int curLongest = 0;
while (rightPos < curArray.size()){
... | ALGO | 0.999884 | 4.039293 |
58e30a73-69b3-4c8c-964e-1e64c41b678d | Harshsngh07/DataStructures_and_Algorithms | GeeksForGeeks/Recursion/LuckyNo.cpp | bool isLucky(int n, int &counter)
{
int nxtPos = n;
if (counter > n)
return 1;
if (nxtPos % counter == 0)
return 0;
nxtPos -= nxtPos / counter;
counter++;
return isLucky(nxtPos, counter);
} | ALGO | 0.999925 | 3.731839 |
dc59e254-5981-4d28-af5f-fe0205b173f0 | kamrul17/Dsa_LoveBabbar_solution | lecture-10 sort012/autokeyword.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int num[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
// cout << n;
for (auto el : num)
{
cout << el << endl;
}
} | ALGO | 0.960199 | 3.549196 |
54af6eb7-60a5-4403-ba58-755552f97f58 | SkaRkaL/Bootcamp_1337 | Day01/A.cpp | // A - Static Range Sum Queries
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int n, q;
cin >> n >> q;
vector<int> x(n);
for (int i = 0; i < n; i++)
{
cin >> x[i];
}
vector<long long> pref (n+1);
for (int i = 1; i <= n; i... | ALGO | 0.999901 | 4.840224 |
b5989987-ceee-454f-9459-d4fdbc75c95f | Sheldd/h | One_NonLenier_Equation/Method_Chord/Method_Chord/main.cpp | #include <QCoreApplication>
#include<cmath>
#include<iostream>
#include<functional>
using namespace std;
double our_func(double& x);
double root(double C_minus,double C_plus,double (*func)(double&),double& eps);
int main()
{
double *C_minus=new double[2];
double *C_plus=new double[2];
//производная п... | ALGO | 0.999974 | 4.070594 |
88c11377-1ab1-4300-bcce-b2d13e23212a | Melkonyan-Anahit/CHP | lab4.cpp | #include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
void caesarCipher() {
string text;
int shift;
cout << "Enter the text for Caesar Cipher: ";
cin.ignore();
getline(cin, text);
cout << "Enter shift value: ";
cin >> shift;
for (char &... | ALGO | 0.992206 | 4.074861 |
58311392-2915-47aa-94d7-6da76274de22 | saishushma/Data-Structure-Course-work | Assignment-2/Q3.cpp | #include<iostream>
using namespace std;
template <class t>
class dq
{
public:
int b,f,size1,s;
t *a;
//////initilization///////////////
dq()
{
size1=5;
s=0;
b=-1;
f=-1;
a=new t[size1];
}
dq(int n,t x)
{
b=-1;
f=-1;
size1=n;
a=new t[n];
for(int i=0;i<n;i++)
a[i]=x;
}
///////////////////////
void resize1(int x,t d)
{
t *... | ALGO | 0.999271 | 3.786139 |
a38ed947-0d1f-43bd-a8b0-229f817fb8cd | Mwako/deps | boost/libs/multi_index/example/composite_keys.cpp | #if !defined(NDEBUG)
#define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING
#define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
#endif
#include <boost/call_traits.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/composite_key.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/order... | TOOL | 0.957348 | 6.654578 |
e83b7321-870c-43e5-84db-9646d7014533 | Xiste/beecrowd | 1002.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
double pi = 3.14159;
double area,raio;
scanf("%lf",&raio);
area = pi*(raio*raio);
printf("A=%.4lf\n",area);
return 0;
}
| ALGO | 0.99809 | 4.215864 |
f63e933e-41a1-41a7-851f-87333f754fd1 | tr1ten/DNA | excercise/powerset.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
void rec(string initial,const string &target,int i,vector<string> &powerset)
{
if(i>=target.size())
{
powerset.push_back(initial);
return;
}
rec(initial,target,i+1,powerset);
initial.push_back(target[i]);
... | ALGO | 0.995609 | 3.298013 |
02aacb58-1b19-40f7-ac79-c5607137406f | 1m188/algorithm | leetcode/102.二叉树的层序遍历.cpp | /*
* @lc app=leetcode.cn id=102 lang=cpp
*
* [102] 二叉树的层序遍历
*
* https://leetcode-cn.com/problems/binary-tree-level-order-traversal/description/
*
* algorithms
* Medium (63.17%)
* Likes: 606
* Dislikes: 0
* Total Accepted: 180.7K
* Total Submissions: 285.9K
* Testcase Example: '[3,9,20,null,null,15,7... | ALGO | 0.999836 | 6.624241 |
ce4cad20-cb9f-4762-8b18-29c9794229ee | st0rm-kr/code-Musings | src/List/206.cpp | #include "ListNode.h"
namespace l206 {
class Solution {
public:
ListNode* reverseList(ListNode* head) {
ListNode* dummy = new ListNode;
ListNode* p = head;
while (p) {
auto t = p->next;
p->next = dummy->next;
dummy->next = p;
p = t;
}
auto res = dummy->next;
delete d... | ALGO | 0.998869 | 6.032357 |
d56bc72e-4d4d-4b96-bb10-1c0db32d86b4 | ARTSAT/ground_station | common/libs/TGS/src/physics/despatch_tracker/eigen-eigen-6b38706d90a9/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp | MatrixXd X = MatrixXd::Random(5,5);
MatrixXd A = X + X.transpose();
cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl;
SelfAdjointEigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << ... | ALGO | 0.999315 | 3.056724 |
1a622a56-0e2e-4ba9-8401-e122621c76c8 | v0dnyy/Polynominals | Polynominals/Source.cpp | #include <stdio.h>
#include "Header.h"
#include <Windows.h>
#include <iostream>
#include <conio.h>
#include <complex>
int GetKey() noexcept {
int key = _getch();
if ((key == 0) || (key == 224)) key = _getch();
return key;
}
int Ent() noexcept {
while (true) {
int key = GetKey();
if (key == 13) return key;
}
... | TOOL | 0.895004 | 3.229206 |
41260462-bc14-41a6-a5f2-42106955d356 | lemonforest-io/sscap | common/cryptopp562/ida.cpp | // ida.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "ida.h"
#include "algebra.h"
#include "gf2_32.h"
#include "polynomi.h"
#include <functional>
#include "polynomi.cpp"
ANONYMOUS_NAMESPACE_BEGIN
static const CryptoPP::GF2_32 field;
NAMESPACE_END
using namespace std;
NAMESPACE... | ALGO | 0.938761 | 5.69041 |
e3f91f63-044b-417c-9692-0bbeb45b2ae9 | dev02chandan/CPP-dsa | Windows codes/matrixmultiplication.cpp | #include<iostream>
using namespace std;
int main(){
int n1, n2, n3;
cin>>n1>>n2>>n3;
int m1[n1][n2];
int m2[n2][n3];
//Input for the matrices
for (int i = 0; i<n1 ; i++){
for(int j=0 ; j<n2 ; j++)
cin>>m1[i][j];
}
for (int i = 0; i<n2 ; i++){
for(int j=... | ALGO | 0.999935 | 3.043608 |
0f61dfa0-7244-4827-9d7c-422084081cdb | GOR-OM/DSA-Problem-for-placement | Binary Search/Kth Missing Positive Number.cpp | #include<bits/stdc++.h>
using namespace std ;
// O(n)
int missingK(vector < int > vec, int n, int k) {
if(vec[0]>k)return k ;
int ans=k;
for(int i=0;i<vec.size();i++){
if(vec[i]<ans){
ans++;
}
else return ans ;
}
return -1 ;
}
// O(log(n))
int missingK(vector <... | ALGO | 0.999939 | 4.561996 |
b785d805-b974-4a98-b9fb-817c399c5550 | Lapa202122/homedemon | main23.cpp | #include <iostream>
#include <string.h>
void fill(int array[], int size);
int main()
{
int SIZE1 = 13;
int SIZE2 = 27;
int array1 [SIZE1] = {};
int array2 [SIZE2] = {};
fill(array1, SIZE1);
fill(array2, SIZE2);
return 0;
}
void fill(int array[], int size)
{
for (int i = 0; i < size; i++)
{
array[i] =... | TOOL | 0.985905 | 3.767537 |
5da15df2-0587-4e03-b80e-989dae8e5694 | nrl-ai/daisykit | third_party/zxing-cpp/src/pdf417/PDFModulusPoly.cpp | #include "PDFModulusPoly.h"
#include "PDFModulusGF.h"
#include <algorithm>
#include <stdexcept>
namespace ZXing {
namespace Pdf417 {
ModulusPoly::ModulusPoly(const ModulusGF& field, const std::vector<int>& coefficients) :
_field(&field)
{
size_t coefficientsLength = coefficients.size();
if (coefficientsLength > 1... | ALGO | 0.98023 | 5.288205 |
a2acc2b2-2e27-4128-9978-0464651a245e | minhlam2102002/competitive-programming | CSES/2. Sorting and Searching/Missing Coin Sum.cpp | /*
author: Minh Lam
version: 1.0.1
*/
#include<bits/stdc++.h>
using namespace std;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << (x) << endl;
#define deb... | ALGO | 0.99997 | 4.716419 |
ddbc7080-25be-4934-913f-e26e0c01598d | necoarcreator/step_in_chislaki | waveEq/step6.cpp | #include<stdio.h>
#include<fstream>
#include<math.h>
#include<omp.h>
#include <vector>
#include<iostream>
using namespace std;
double u0(double x, double t) { //analit
return 3 / 2 * pow(x, 2) + exp(-t) * acos(x / 2);
//2 * sin(x + t);
}
double f(double x, double t) { //neodnor
return -3 + x * exp(-t) / pow((4 ... | ALGO | 0.999955 | 3.070221 |
1ba93b98-b8ed-457a-b3e9-5a82aa260bbc | ishandutta2007/codeforces | cephian/normal/630/J.cpp | #include <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
cout << n/2520 << "\n";
return 0;
} | ALGO | 0.999882 | 3.79971 |
dc49246c-4161-419c-99c6-156803218310 | DevelopingHCP/structural-pipeline | ThirdParty/eigen-eigen-67e894c6cd8f/unsupported/test/BVH.cpp | #include "main.h"
#include <Eigen/StdVector>
#include <Eigen/Geometry>
#include <unsupported/Eigen/BVH>
namespace Eigen {
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
}
template<int Dim>
struct Ball
{
EIGEN_MAKE_ALIGN... | TEST | 0.991608 | 6.317623 |
b720e551-eb79-4ab7-9371-4dbf5a99d1a5 | Divyasinhaa/c-coding | .dist/cpp programming/arrayfuntions.cpp | #include<iostream>
using namespace std;
void array(int arr[],int size){
for(int i=0;i<size;i++){
cout<< arr[i] << " " <<endl;
}
}
int main(){
int number[5]={1,2,3,4,5};
cout<< "Value at 4th postion" << number[4] <<endl;
int numbersize=sizeof(number)/sizeof(int);
cout<< "size of array is"... | TOOL | 0.956534 | 3.461097 |
1e053726-8740-4648-8709-9523cb7cc474 | adam-neeley/data-structures | lab/09/ArrayQueue.cpp | // CS 211 Fall 2024 - Week 09 Lab
// <NAMES HERE>
//---------------------------------------------------------------
// File: ArrayQueue.cpp
// Purpose: Implementation file for a queue
//---------------------------------------------------------------
#include <cstdlib>
#include <iostream>
#include <string>
#include <c... | ALGO | 0.914731 | 5.313407 |
e327ace4-697e-4c95-88e6-556077fd6c1b | sxs-collaboration/spectre | src/PointwiseFunctions/GeneralRelativity/Surfaces/RadialDistance.cpp | #include "PointwiseFunctions/GeneralRelativity/Surfaces/RadialDistance.hpp"
#include "DataStructures/Tensor/Tensor.hpp"
#include "NumericalAlgorithms/SphericalHarmonics/Strahlkorper.hpp"
#include "NumericalAlgorithms/SphericalHarmonics/StrahlkorperFunctions.hpp"
#include "Utilities/ErrorHandling/Error.hpp"
#include "U... | ALGO | 0.995448 | 6.367012 |
8eb478ba-b320-4013-9d98-0d00ad7b0add | dukkar2017/codeninja | primitive/reversedigits.cpp | // 5.10: Reverse Digits
#include <stdio.h>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <inttypes.h>
#include <assert.h>
#include <errno.h>
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
if (argc != 2)
{
cerr << "Usage: " << argv[0] << ... | ALGO | 0.999038 | 4.943062 |
f0f88ea6-74f9-4075-bad2-6b92cc663e38 | raincross7/code-similarity | codes/train_code/problem226/problem226_428.cpp | #include<bits/stdc++.h>
using namespace std;
#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979
typedef long long i64;
typedef pair<i64,i64> P;
inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
t... | ALGO | 0.999248 | 4.006158 |
752f7059-5a7f-4cf1-9a5d-6f17e204dad0 | raincross7/code-similarity | codes/train_code/problem472/problem472_409.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
const int mod = 1e5;
const long long INF = 1LL<<60;
//using ll = long long;
//using P = pair<int,int>;
int main(){
int n;
while(cin >> n){
if (n == 0) break;
vector<long long> imos(10101... | ALGO | 0.999498 | 4.461155 |
357a2922-7279-48dc-ba1b-7a9e11a37c8a | Mingda-tech/MingDa_OrcaSlicer | src/libigl/igl/cat.cpp | #include <cstdio>
// Bug in unsupported/Eigen/SparseExtra needs iostream first
#include <iostream>
#include <unsupported/Eigen/SparseExtra>
// Sparse matrices need to be handled carefully. Because C++ does not
// Template:
// Scalar sparse matrix scalar type, e.g. double
template <typename Scalar>
IGL_INLINE void... | ALGO | 0.855636 | 5.480333 |
ec178265-5384-48e3-bef6-7d4c6dd1dc07 | gamdwk/Powerlyra | toolkits/graph_analytics/partitioning.cpp | #include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <graphlab.hpp>
//remove assigned options from arguments
std::string get_arg_str_without(int argc, char** argv,
std::vector<std::string> remove_opts) {
... | ALGO | 0.997078 | 5.03703 |
c8c99f08-1e2a-44e5-906c-0f55654aedf8 | ronnniedev/CursosEjercicios | CursoUdemi/C++/calculoConEnteros/Source.cpp | #include <iostream>
#include <string>
int main() {
int largo;
int ancho;
int perimetro;
int area;
std::cout << "Dame largo del rectangulo: " << std::endl;
std::cin >> largo;
std::cout << "Dame el ancho del rectangulo: " << std::endl;
std::cin >> ancho;
perimetro = largo * 2 + ancho * 2;
area = largo * anch... | TOOL | 0.910589 | 3.579866 |
ea6d1563-d4cc-401d-bc54-465bec6f416f | edge555/Online-Judge-Solves | Toph/Mr. Tom and Relief Goods.cpp | #include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL)
#define pf printf
#define sf(num) scanf("%d",&num)
#define sff(num1,num2) scanf("%d %d",&num1,&num2)
#define cspf(kk) printf("Case %d: %d\n",tc++,kk)
#define rep(i,n) for(i=1;i<=n;i++)
#define rep0(i,n) for(i=0;i<n;i++)
#define reps(... | ALGO | 0.999868 | 3.486078 |
7c6aa3a2-d1fa-42d4-9166-7bbed999bd37 | ishandutta2007/codeforces | origenes/normal/348/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#de... | ALGO | 0.999786 | 3.77371 |
c06ba319-e6bd-4662-8aa3-f6e1e544a790 | mohammedjasam/Technical-Interview-Guide | LeetCode/leetcode_car-fleet.cpp | /*
*
* Tag: stack
* Time: O(nlgn)
* Space: O(n)
*/
class Solution {
public:
int carFleet(int target, vector<int>& position, vector<int>& speed) {
if(target == 0 || position.size() == 0){
return position.size();
}
vector<pair<int,int>> cars(position.size());
for(i... | ALGO | 0.999676 | 5.974691 |
a19f1017-92d5-46ac-80fd-1fe71bb34e50 | akshitagupta03/Competitive-Programming | codeforces/round 871 (div-4)/qD.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
#define vi vector<ll>
#define py cout << "YES" << endl
#define pn cout << "NO" << endl
#define p(x) cout << x << endl
#define parr(arr) rep(i, 0, arr.size()) cout << arr[i] << " "; cout << end... | ALGO | 0.999812 | 4.099546 |
49e91090-6c90-4579-ae42-735a097c99d1 | NikBomb/NeuralNet | ext/eigen-3.3.7/bench/benchmark-blocking-sizes.cpp | #include <iostream>
#include <cstdint>
#include <cstdlib>
#include <vector>
#include <fstream>
#include <memory>
#include <cstdio>
bool eigen_use_specific_block_size;
int eigen_block_size_k, eigen_block_size_m, eigen_block_size_n;
#define EIGEN_TEST_SPECIFIC_BLOCKING_SIZES eigen_use_specific_block_size
#define EIGEN_T... | TOOL | 0.869947 | 5.95051 |
99412e58-bff2-4041-9677-a646070236b2 | roudramondal/Dequeue-in-c- | Dequeue2.cpp | #include <bits/stdc++.h>
using namespace std;
int main ()
{
deque<int> dq = {10, 15, 30, 5, 12};
auto it = dq.begin();
it++;
dq.insert(it, 20);
dq.pop_front();
dq.pop_back();
cout << dq.size();
return 0;
} | ALGO | 0.932976 | 4.730586 |
ec763766-c4e8-4a1c-9242-b1c15fbcda45 | slinderman/eigenglm | eigenglm/deps/Eigen3/test/sparseLM.cpp | #include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template <typename Scalar>
struct sparseGaussianTest : SparseFunctor<Scalar, int>
{
typedef Matrix<Scalar,Dynamic,1> VectorType;
typedef SparseFunctor<Scalar,int> Base;
typedef typename Base::JacobianType JacobianT... | TEST | 0.993264 | 6.130261 |
879afad3-4acc-4167-8447-353a4f48f701 | KnightChan/LeetCode-cpp | Source/p206 Reverse Linked List.cpp | #include "leetcode.h"
/**
Reverse a singly linked list.
click to show more hints.
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* reverseList(ListNode* head) {
... | ALGO | 0.999796 | 5.585181 |
1449df31-f609-4f44-9cb7-9696dffe172a | tnakai11/Atcoder-practice | ABC/ABC195/b.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x) REP(i,(n)){ (a)[i]=(x)... | ALGO | 0.999861 | 5.659606 |
862b4062-6d62-4a08-8594-86f76244eaa4 | Akhileshramks/LeetCode_Solution | 0081-search-in-rotated-sorted-array-ii/0081-search-in-rotated-sorted-array-ii.cpp | class Solution {
public:
bool search(vector<int>& nums, int target) {
int n = nums.size();
int low = 0,high = n-1;
while(low <= high){
int mid = low + (high - low)/2;
if(nums[mid] == target) return true;
else if(nums[low] == nums[mid] && nums[mid] == nums[... | ALGO | 0.999981 | 6.091459 |
c7bacc57-011a-458e-a5ae-65426f89f346 | fwhxyer/PAT | 1045.cpp | #include<iostream>
using namespace std;
int x[10010];
int y[210];
int f[10010][210];
int main(){
int nc;
int n,m;
cin>>nc>>m;
for (int i=1;i<=m;i++)
cin>>y[i];
cin>>n;
for (int i=1;i<=n;i++)
cin>>x[i];
f[0][0]=0;
f[0][1]=0;
for (int i=1;i<=n;i++)
for (int j... | ALGO | 0.999963 | 3.159828 |
ff630e44-8f6d-44ec-90d8-f510ce659874 | ishandutta2007/codeforces | ttklwxx/normal/1743/D.cpp | #include<iostream>
#include<cstdio>
#define int long long
using namespace std;
inline int read()
{
int n=0,f=1,ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')f=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9')
{
n=n*10+ch-'0';
ch=getchar();
}
return n*f;
}
char s[1000005];
char s1[1000005];
int len;
signed... | ALGO | 0.999998 | 3.26156 |
c6278a81-3af9-4ae6-9b15-30718d0f2385 | ishandutta2007/codeforces | bench0310/normal/1436/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=100005;
vector<int> tree(4*N,0);
void update(int idx,int l,int r,int pos,int val)
{
if(l==r) tree[idx]=val;
else
{
int m=(l+r)/2;
if(pos<=m) update(2*idx,l,m,pos,val);
else update(2*idx+1,m+1,r,pos,val... | ALGO | 0.999933 | 4.079843 |
cfd9a72d-535c-45a6-baa0-12887c3d41eb | Ikram-Akbar/Phitron | Basic Data Structures/Week_03 Doubly Linked List/Module_9 Dubly Linked List/dubly_linked_list.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node* next;
Node* pre;
Node(int val)
{
this->val = val;
this->next = NULL;
this->pre = NULL;
}
};
void print_normal(Node* head)
{
Node* temp = head;
while (temp !... | ALGO | 0.999763 | 4.382549 |
84db252b-0d65-45cc-9d22-22a980ccd19f | radwanCS/CPlusPlusHowToProgram11e-Solutions | chapter6/ex20.cpp | #include <iostream>
#include <ranges>
#include <vector>
int main()
{
auto showValues{
[](auto &values, const std::string &message)
{
std::cout << message << ": ";
for (const auto &value : values)
{
std::cout << value << " ";
}
... | TOOL | 0.863652 | 6.259427 |
87c185d7-cdcf-4547-bb92-96fcfd82d650 | xchmwang/algorithm | pat/pat_A_1069/pat_A_1069/main.cpp | #include <iostream>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 5;
bool cmp_incre(char ch1, char ch2) { return ch1 < ch2; }
bool cmp_decre(char ch1, char ch2) { return ch1 > ch2; }
void to_str(int n, char *str)
{
int len = 0;
while (n)
{
str[len++] = n%10 + '... | ALGO | 0.99732 | 3.357209 |
c21d094f-76a0-4ff9-b309-385eb26f6c46 | periclesrennan10/buscaDeDados | atividade_BuscaDeDados/busca_sequencial/main.cpp | #include <iostream>
using namespace std;
int* buscaSequencial(int vetor[], int tamanho, int valorBuscado, int& tamanhoResultado) {
int* posicoesEncontradas = 0;
tamanhoResultado = 0;
for (int i = 0; i < tamanho; ++i) {
if (vetor[i] == valorBuscado) {
int* novoTR = new int[tamanhoResul... | ALGO | 0.999899 | 5.729239 |
0056342d-e45f-4c5f-ae73-1668fadb2ccd | Aayush-Sood101/CODEFORCES | 800+900/Bit++.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
bool check(string str){
if(str == "X++" || str == "++X")
return true;
else
return false;
}
int main(){
int n;
cin>>n;
int x = 0;
for(int i = 0 ;i<n ; i++){
string str;
cin>>str;
if(check(str)... | ALGO | 0.999681 | 3.78606 |
393d1878-09a6-4620-b164-f2af2dc01267 | ishandutta2007/codeforces | mangooste/normal/1583/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define rall(a) rbegin(a), rend(a)
#define len(a) ((int)((a).size()))
int main() {
ios::sync_with_stdio(false), cin.tie(nullptr);
int n;
cin >> n;
vector<int> nxt(n, -1);
... | ALGO | 0.999988 | 3.401809 |
9d8cbf24-47a6-4079-b015-ade4a5e2afa1 | DeterministicChoco232/cppcp | othercompleted/upsanddowns.cpp | #include <iostream>
#include <set>
using namespace std;
void rearrange(int arr[], int n) {
multiset<int> s;
for (int i = 0; i < n; i++) {
s.insert(arr[i]);
}
auto it = s.begin();
for (int i = 0; i < n; i++) {
if (i % 2 == 0) {
cout << *it << " ";
it++;
... | ALGO | 0.999915 | 4.930247 |
89bfcf5c-fd53-4549-86dc-04a8af1d03e0 | AryamannNingombam/competitive-programming-practice | ary_amann/striver_79/sol/consecutiveOnesCpp.cpp | class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int cnt = 0;
int maxi = 0;
for(int i = 0;i<nums.size();i++) {
if(nums[i] == 1) {
cnt++;
}
else {
cnt = 0;
}
maxi... | ALGO | 0.999871 | 6.202758 |
7db29418-56a9-44e3-8a66-3b70f9a8cfba | Abhinavpatel00/bgfx-sys | bimg/3rdparty/nvtt/bc7/avpcl_mode6.cpp | // Thanks to Jacob Munkberg (<EMAIL>) for the shortcut of using SVD to do the equivalent of principal components analysis
// x1000000 7777.1x2 4bi
#include "bits.h"
#include "tile.h"
#include "avpcl.h"
#include "nvcore/debug.h"
#include "nvmath/vector.inl"
#include "nvmath/matrix.inl"
#include "nvmath/fitting.h"
#inc... | ALGO | 0.988875 | 4.590501 |
1f5f8f37-c88f-472d-bb30-e270cbab1f7f | Mohamad-Alhamwi/SAST_With_SRE | CVEs/CVE-2017-17760_OpenCV/OpenCV/modules/imgproc/src/undistort.cpp | #include "precomp.hpp"
#include "opencv2/imgproc/detail/distortion_model.hpp"
#include "undistort.hpp"
cv::Mat cv::getDefaultNewCameraMatrix( InputArray _cameraMatrix, Size imgsize,
bool centerPrincipalPoint )
{
Mat cameraMatrix = _cameraMatrix.getMat();
if( !centerPrincipalPoint... | ALGO | 0.964105 | 6.786203 |
e03717ec-f80b-4245-b83e-7e7d0c7a73bd | mailtoharutyunyan/LeetCode-Solutions | solutions/2392. Build a Matrix With Conditions/2392.cpp | class Solution {
public:
vector<vector<int>> buildMatrix(int k, vector<vector<int>>& rowConditions,
vector<vector<int>>& colConditions) {
const vector<int> rowOrder = topologicalSort(rowConditions, k);
if (rowOrder.empty())
return {};
const vector<int> colOrder = ... | ALGO | 0.999945 | 6.597993 |
8a1e8920-57b2-43cb-bf70-e060fa80a01a | NazrulIslamSajib/Dynamic_programming | class2.cpp | /*
link : https://atcoder.jp/contests/dp/tasks/dp_c
*/
#include<bits/stdc++.h>
using namespace std;
int const mx=1e5+10;
int dp[mx][4];
int arr[mx][4],n;
int solve(int i,int f)
{
if(i>n)
{
return 0; /// ekhane n er beshi hole zero hoye jabe as usual .
}
if(dp[i][f]!=-1)
{
return ... | ALGO | 0.999889 | 4.120965 |
bea1c2ff-45ff-4213-9a9d-202cdfce09e9 | sam19980301/MyLeetcode | 707.design-linked-list.cpp | /*
* @lc app=leetcode id=707 lang=cpp
*
* [707] Design Linked List
*/
// @lc code=start
#include <bits/stdc++.h>
using namespace std;
class MyLinkedList {
private:
struct ListNode
{
int value;
ListNode* next;
ListNode* prev;
ListNode(int v = 0, ListNode *n = nullptr, ListNod... | ALGO | 0.999826 | 6.05398 |
ac40c402-bdfc-4ade-8c43-676e8dfd20a2 | dtc2025ag/MOAI | include/source/bootstrapping/common/func.cpp | #include "func.h"
RR fracpart(RR x) {
return x - round(x);
}
RR sqrtfracpart(RR x, RR a) {
ZZ roundx;
roundx = RoundToZZ(x);
if (roundx % 2 == 0)
return sqrt(x - round(x) + a);
else
return (-1) * sqrt(x - round(x) + a);
}
RR fraccos(RR x, long scale) {
RR sc_fac = RR(1 << scale);
return cos(2 *... | ALGO | 0.999055 | 3.339495 |
59b31a8f-c34d-43c0-97d7-2095b56bce14 | quirinoflavio/competitive-programming | beecrowd/1936-fatorial.cpp | #include <bits/stdc++.h>
using namespace std;
int l[] = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880};
int main() {
int n, i, res = 0;
scanf("%d", &n);
while (n > 0) {
i = 0;
while (n >= l[i])
i++;
n -= l[i-1];
res++;
}
printf("%d\n", res);
... | ALGO | 0.999954 | 4.245552 |
5d6de578-8d3e-4032-9b22-9a48ffebf11d | VipulChauhan89/CodeChef-Practice-Problems | Beginner/Chef and Candies-CHEFCAND/candy.cpp | /*
There are N children and Chef wants to give them 1 candy each. Chef already has X candies with him. To buy the rest, he visits a candy shop.
In the shop, packets containing exactly 4 candies are available.
Determine the minimum number of candy packets Chef must buy so that he is able to give 1 candy to each o... | ALGO | 0.999804 | 4.018678 |
85e851ce-3598-46bd-9b6f-e6bd9c79ad2d | Trevorchenmsu/LeetCode-Solutions | leetcode/editor/en/[938]Range Sum of BST.cpp | //Given the root node of a binary search tree, return the sum of values of all n
//odes with a value in the range [low, high].
//
//
// Example 1:
//
//
//Input: root = [10,5,15,3,7,null,18], low = 7, high = 15
//Output: 32
//
//
// Example 2:
//
//
//Input: root = [10,5,15,3,7,13,18,1,null,6], low = 6, high = 1... | ALGO | 0.999987 | 7.063368 |
6e0c1658-f610-45ff-9fd7-ae8c570028fe | dmkz/competitive-programming | mirea/contests/2023-05-14 MIREA Goodbye Стипендия 2023/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// ускорение ввода-вывода
ios::sync_with_stdio(false);
cin.tie(0);
// читаем запросы и отвечаем на них:
int tt; cin >> tt;
while (tt --> 0) {
// оптимальнее всего по объёму делать куб, то есть стороны брать L / 3
// но L ... | ALGO | 0.999912 | 3.878896 |
873e520a-bf76-4354-a8f1-49509893f815 | yulingtianxia/LeetCode | LeetCode/LeetCode/60 Permutation Sequence.cpp | #include "commonheader.h"
class Solution {
public:
vector<int> stack;
int size=0;
vector<int> select;
string getPermutation(int n, int k) {
size=n;
for (int i=1; i<=n; i++) {
select.push_back(i);
}
track(k);
string result;
for (int i=0; i<stack... | ALGO | 0.999987 | 6.001064 |
02e88bbf-3bf5-44e3-a1f3-4aaa989a9317 | jsh5879/datastructure_chapter04 | genList.cpp | //Gen List
//Devise a function that produces a gen list from the input l = (a,(b,c))
/*
ҽڵ ǽ
1. copyϿ copy
2. 2 gen list ==
3. depth
4. reference count Ͽ getnode, retnode , gen list ȯ ڵ Ʈ
*/
#include <iostream>
using namespace std;
int GetData();
class GenList; // forward declaration
class GenListNode
{
fr... | TOOL | 0.990868 | 4.366229 |
e0dc7c9f-9344-4a42-951a-149f1d4ffaf1 | north-h/Match_code | 2024/Codeforces_-_Codeforces_Round_946_(Div_3)/D_Ingenuity-2.cpp | /*
* ==================================================================================
* Author: north_h
* Time: 2024-05-20 22:44:41
*
* Problem: D. Ingenuity-2
* Contest: Codeforces - Codeforces Round 946 (Div. 3)
* URL: https://codeforces.com/contest/1974/problem/D
* MemoryL: 256 MB
* TimeL: 2000 ... | ALGO | 0.999991 | 5.686901 |
7f5c215a-2560-4590-aae8-e0da8fbb45aa | Ayamohamedkhalil/IEEE-CS-25 | rookies/Task-1/Lucky division.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int listofluckynumbers[14]={4,7,44,77,47,74,444,447,474,477,777,774,744,747};
int num;
cin>>num;
int flag = false;
for(int i=0;i<14;i++){
if(num % listofluckynumbers[i] == 0){
flag = true;
break;
}
}
if(flag ){
cout<<"YES"<<endl;
} else {
c... | ALGO | 0.999817 | 4.271002 |
b467bf5e-846f-4821-bdb6-6246bf697f3f | Cutepiler/Cutepiler-Sysy2020 | src/optimizer/lowlevel/inst_sched.cpp | #include "../../tac/tac.h"
#include "../../flowgraph/flowgraph.h"
#include "str_reduction.h"
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <iostream>
using std::cerr;
using std::endl;
using std::set;
using std::pair;
using std::map;
using std::vector;
using std::queue;
... | ALGO | 0.999771 | 5.209808 |
de045433-16bb-408f-ae13-641e1990bfb1 | Bo-rrr/Exercises | 搜索旋转排序数组.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int n = (int)nums.size();
if (!n) {
return -1;
}
if (n == 1) {
return nums[0] == target ? 0 : -1;
}
int l = 0, r = n - 1;
while (l <= r) {
int mid = (l + r... | ALGO | 0.999969 | 6.192097 |
3ad9917d-7f8e-482a-bcde-d591127eb2a9 | sirdyf/ENEV_2_261 | SHIPS/ai_m_defObj.cpp | #include "ai_m_defObj.h"
#include "tsolution1.h"
#include "tsolution4.h"
ai_m_defObj::ai_m_defObj(void){}
ai_m_defObj::~ai_m_defObj(void){}
void ai_m_defObj::Processing(){
std::list<boost::intrusive_ptr<tShipCommand> >::const_iterator iSC,end;
if (_base->workStruct.enemy){
if (solution)
if (solution->GetID()=... | TOOL | 0.979189 | 3.949715 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.