uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9fe4b813-4725-4692-81b2-7d10b811face | neverac/2020summer | 个人赛13/codes/B/26988287_YidaWang_B.cpp | #include<bits/stdc++.h>
using namespace std;
int N;
int mn;
int main(){
scanf("%d",&N);
mn = 3* 1000*1000;
for (int i=1; i<=N; i++){
int x,y,z; scanf("%d%d%d",&x,&y,&z);
mn = min(mn, x*x+y*y+z*z);
}
printf("%.3lf\n",(double)sqrt(1.0*mn));
return 0;
} | ALGO | 0.999535 | 3.785364 |
bd6aa730-005e-4f32-ad81-7f149a11b953 | Koyama-Tsubasa/LeetCode | Problems/No.1689_Partitioning_Into_Minimum_Number_Of_Deci-Binary_Numbers/partitioning_into_minimum_number_of_deci-binary_numbers.cpp | class Solution {
public:
int minPartitions(string n) {
// parameter
int max_deci = 0;
// start computing
for (auto d: n) max_deci = std::max(max_deci, d-'0');
return max_deci;
}
};
| ALGO | 0.999799 | 6.003326 |
034e408a-9ec4-4e56-a979-0ac8267c1ca8 | meilleur777/Competitive_Programming | AtCoder/old/others/AISing Programming Contest 2019/a.cpp | #include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> intp;
const int mod=1e9+7;
const int INF=0x3F3F3F3F;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
int n, h, w;
cin >> n >> h >> w;
cout << (... | ALGO | 0.999403 | 3.807122 |
82c38a7e-0bc2-4b07-95b7-6153c846d034 | sohagcse07/My-competitive-journey | Number_theory/Harmonic_serice/counting_divisor-cses_ch1.cpp | //In the name of ALLAH
// Insallah one day success will be your
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
ty... | ALGO | 0.999302 | 3.776071 |
929a6050-1fb4-4619-9fe4-1b908e306bed | om-mapari/ML_DAA | tempdir/DAA/Trivalling/gfg.cpp | // C++ program to solve Traveling Salesman Problem
// using Branch and Bound.
#include <bits/stdc++.h>
using namespace std;
const int N = 4;
// final_path[] stores the final solution ie, the
// path of the salesman.
int final_path[N + 1];
// visited[] keeps track of the already visited nodes
// in a particular path
b... | ALGO | 0.999994 | 6.165955 |
5a65348f-fe04-47b9-8796-1dbd292afedb | chris1129/Leetcode | 127. Word Ladder/127. Word Ladder/main.cpp | class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
unordered_set<string>wordset;
for(auto w:wordList)wordset.insert(w);
queue<pair<string,int>>q;
q.push({beginWord,1});
int ret=INT_MAX;
while(!q.empty()){
... | ALGO | 0.999986 | 5.402304 |
cfa087e2-480d-4307-8cd2-1405e5f04dd6 | rddl-network/tasmota-firmware | lib/libesp32_audio/mp3_shine_esp32/src/l3subband.cpp | /* L3SubBand */
#include "types.h"
#include "tables.h"
#include "l3subband.h"
/*
* shine_subband_initialise:
* ----------------------
* Calculates the analysis filterbank coefficients and rounds to the
* 9th decimal place accuracy of the filterbank tables in the ISO
* document. The coefficients are stored in #f... | ALGO | 0.998273 | 5.145163 |
d9e2e90e-7a72-44f5-88f1-8e7ece3c93dc | HitarthThakkar/LeetCode-Submissions | 0199-binary-tree-right-side-view/0199-binary-tree-right-side-view.cpp | class Solution
{
private:
void recur(TreeNode* node, int Depth, vector<int> &res)
{
if(node == NULL) return;
if(res.size() == Depth) res.push_back(node->val);
recur(node->right, Depth + 1, res);
recur(node->left, Depth + 1, res);
}
public:
vector<int> rightSideView(TreeNo... | ALGO | 0.999931 | 6.276116 |
f0ee0297-2c69-4c0e-8fad-312e66675e7d | kmjp/procon | 2022/CodeTon/round1/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999671 | 3.85734 |
e56c20d7-6c74-4e03-90fc-d615e9f85d61 | SwordFish-MK2/Raven | RavenCore/src/material/matte.cpp | #include<Raven/material/matte.h>
namespace Raven {
void MatteMaterial::computeScarttingFunctions(
SurfaceInteraction& its,
bool allowMultipleLobes)const {
if (bump != nullptr)
Bump(this->bump, its);
its.bsdf = std::make_shared <BSDF>(its);
//calculate values of textures
double sigValue = sigma->eval... | ALGO | 0.985685 | 3.903842 |
6a8a1d2e-de7f-417d-8214-b10c099f9548 | keisuke90/AtCoder | abc/abc343/a.cpp | #include <bits/stdc++.h>
#define rep(i, start, end) for(int i = start; i < end; i++)
using namespace std;
int main(){
int a, b;
cin >> a >> b;
rep(i, 0, 9) {
if(a+b != i) {
cout << i << endl;
return 0;
}
}
return 0;
} | ALGO | 0.999223 | 3.523639 |
efb0e42e-4e36-48c4-9bfb-d394c8e4fd14 | Shinao/JustAGame | test/b2Separator.cpp | //
// b2Separator.cpp
// Thermite
//
// Created by Jarad Delorenzo on 1/7/13.
//
//
#include "b2Separator.hh"
#define MAX_VALUE 2147483647
void b2Separator::Separate(b2Body* pBody, b2FixtureDef* pFixtureDef, vector<b2Vec2>* pVerticesVec, int scale) {
int i, n=pVerticesVec->size(), j, m;
vector<b2Vec2> vec;... | ALGO | 0.985419 | 5.392899 |
25c84359-5202-4063-aed3-2338f9080e5d | firiexp/contest_log | atcoder/ABC/062B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
static const int INF = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;
int main() {
u32 h, w;
cin >> h >> w;
vector<vector<char> > v(h+2, vector<char> (w+2, '#'));
... | ALGO | 0.999624 | 3.490739 |
af1ba5db-aeeb-4d81-b49c-f08a7d6baabc | praveen0075/book-buddy | 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 |
b722a0a9-b5d6-4b30-b39c-2a03465d4a4c | GuilhermCstr/text_read_challenge | 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.998756 | 6.772262 |
b334d3e2-c1e5-4316-bf3a-f2a2cb95f367 | abhishekdwibedy-2002/DSA-Workspace | WEEK1/DAY1/removeduplicate.cpp |
// https://leetcode.com/problems/find-the-duplicate-number/
class Solution {
public:
int findDuplicate(vector<int>& nums) {
set<int> v;
for(int i=0;i<nums.size();i++){
if(v.count(nums[i])){
return nums[i];
break;
}
v.insert(nums[... | ALGO | 0.999942 | 5.971961 |
4f292510-86c0-4d68-b6f6-bea8cf35a3b7 | Rainboylvx/pcs | loj/10084/1.cpp | /*-----------------
* author: Rainboy
* email: <EMAIL>
* time: 2020年 05月 15日 星期五 18:13:25 CST
* problem: loj-10084
*----------------*/
#include <bits/stdc++.h>
#define For(i,start,end) for(i = start ;i <= end; ++i)
#define Rof(i,start,end) for(i = start ;i >= end; --i)
#define F_MAX(u,t) (u = std::max(u,t))
#define F_... | ALGO | 0.999961 | 4.098422 |
dfb22832-f4f7-436a-b306-9c4735c14439 | esbanarango/Competitive-Programming | ·Documentation/Strings/suffixArray.cpp | #include<cstdio>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<cmath>
#include<string>
#include<cstring>
#include<cctype>
#include<algorithm>
#include<vector>
#include<bitset>
#include<queue>
#include<stack>
#include<utility>
#include<list>
#include<set>
#include<map>
using namespace std;
#define MAXN... | ALGO | 0.9985 | 3.091038 |
fe0c3923-e51f-4fc5-a33d-50c64411dfc9 | wjyaxxx/Algorithm-exercise-code | atcoder/369/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define read_fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int main()
{
read_fast
int a,b;
cin>>a>>b;
set<int> s;
s.insert(2*a-b);
s.insert(2*b-a);
if(((a+b)&1)==0)
s.insert((a+b)/2);
cout<<s.size()<<"\n";
return 0;
} | ALGO | 0.999476 | 3.703319 |
6d9d8c28-165e-42f0-9985-b189b5e3fcb2 | beshubh/InterviewPrep | competitive_programming/cf/DIV2C/flying_saucer_segments.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pi;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<ll, ll>> vpl;
typedef vector<pair<double, double>> vpd;
#define maxvec(vec) *max_element(vec.begin(), vec.end())
#define ... | ALGO | 0.999992 | 3.983174 |
8cee63be-0cc5-4dec-8922-f6e32bc4c487 | abrarCSE29/Codeforces | 1760C..cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long t,n;
cin>>t;
while(t--)
{
cin>>n;
long long ar[n+5],max1=-1,max2=0,res;
cin>>ar[0];
max1=ar[0];
max2=ar[0];
int f=1;
for(int i=1;i<n;i++)
{
cin>>ar[i];
... | ALGO | 0.999845 | 3.54354 |
1c716e2a-d95a-430c-9054-5b6ef0deeafe | GeneYu1998/leetcode | 056/merge-intervals.cpp | #include "../utils.cpp"
class Solution {
public:
vector<vector<int>> out;
static inline bool sort_begin(const vector<int> inv_1, const vector<int> inv_2){return inv_1[0] < inv_2[0];}
vector<vector<int>> merge(vector<vector<int>>& intervals) {
out.clear();
int n = intervals.size();
if(!n) retur... | ALGO | 0.999996 | 5.808801 |
6be3671b-0649-47d0-853c-a7c0c81a8e3b | vikram-rathore1/competitive_programming | codechef/MAY17/GPD/GPD_2_1.cpp | #include<bits/stdc++.h>
using namespace std;
string toBinary(int x) {
string s, s_n;
s = s_n = "";
for (int i = 0; i < 31; i++) {
s = (x % 2) ? s + '1' : s + '0';
x /= 2;
}
for (int i = 0; i < s.length(); i++) s_n += s[s.length() - 1 - i];
return s_n;
}
int toDecimal(string s) {
int val = 0, m = 1;
for (i... | ALGO | 0.999993 | 4.725779 |
8eddc7ce-4e46-43cc-9ae0-a30803d17a3a | liam-haas/CLPS0950_FinalProject | Rxn Functions/virtual environment1/lib/python3.11/site-packages/rdkit/Contrib/PBF/PBFRDKit.cpp | // Plane of Best Fit: A Novel Method to Characterize the Three-Dimensionality
// of Molecules, Nicholas C. Firth, Nathan Brown, and Julian Blagg, Journal of
// Chemical Information and Modeling 2012 52 (10), 2516-2525
//
//
// Created by Nicholas Firth, November 2011
// Modified by Greg Landrum for inclusion in the... | ALGO | 0.998876 | 5.632668 |
02f90eca-b1b9-477a-924c-fb5f73610405 | hohaidang/CPP_Basic2Advance | Learning/ReferenceWithStructureCPP/src/ReferenceWithStructureCPP.cpp | #include <iostream>
using namespace std;
struct free_throws
{
string name;
int made;
int attempts;
float percent;
};
void display(const free_throws & ft)
{
cout << "Name: " << ft.name << endl;
cout << "Made: " << ft.made << endl;
cout << "attempts: " << ft.attempts << endl;
cout << "Percent: " << ft.percent <... | ALGO | 0.883047 | 4.338006 |
07879137-88f6-478a-82b0-30a450fcc076 | PritomDutta89/30days-code-challenge | 0014-longest-common-prefix/0014-longest-common-prefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& s) {
int i,j;
bool x = false;
string p = "";
for(i=0;i<s[0].length();i++)
{
for(j=0;j<s.size();j++)
{
if(s[j][i] == s[0][i])
continue;
el... | ALGO | 0.999672 | 5.246694 |
b0b64665-e3e6-4758-a3eb-dd089cecdcca | ChaimaeBougattaya/ListToDeque | Q1EXO1/Q1EXO1.cpp | // Q1EXO1.cpp : Ce fichier contient la fonction 'main'. L'exécution du programme commence et se termine à cet endroit.
//
#include <iostream>
#include<list>
#include<deque>
using namespace std;
int main()
{
deque<string> deque_Mot;
list<string> List_Mot;
string mot;
for (int i = 0; i < 4; i++)
{
cout << "\nEntr... | ALGO | 0.995406 | 5.018054 |
36e765c0-e6b0-45d1-a462-38035fb8e817 | MuhammadSaadSiddique/Codding-Problems | 62-unique-paths/62-unique-paths.cpp | class Solution {
vector<vector<int> > arr;
public:
int solve(int m, int n, int i, int j){
if(i==m-1 && j==n-1) return 1;
if(i>m-1 || j>n-1) return 0;
if(arr[i][j]!=-1) return arr[i][j];
return arr[i][j] = solve(m, n, i+1, j) + solve(m, n, i, j+1);
}
int unique... | ALGO | 0.999957 | 5.906402 |
7059eb72-5bcc-4b31-b4f0-6aef133ac902 | alex-narrator/xp-dev_xray | 3rd party/MagicSoftware/FreeMagic/Source/Intersection2D/MgcIntr2DLinLin.cpp | #include "MgcIntr2DLinLin.h"
using namespace Mgc;
//----------------------------------------------------------------------------
static bool Find (const Vector2& rkP0, const Vector2& rkD0,
const Vector2& rkP1, const Vector2& rkD1, Vector2& rkDiff,
Real& rfD0SqrLen, int& riQuantity, Real afT[2])
{
// Inters... | ALGO | 0.999425 | 6.039571 |
b0c9ab54-990c-4101-a1e7-d17a90d90be4 | bploeckelman/cs559-project2 | source/Curve.cpp | /*
* Curve.cpp
*/
#include "Curve.h"
#include <Windows.h>
#define WIN32_LEAN_AND_MEAN
#include <GL/GL.h>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <cassert>
#include <vector>
using std::stringstream;
using std::vector;
using std::cout;
using std::endl;
/********************************... | TOOL | 0.942656 | 6.628588 |
8339e497-5b94-470f-8316-e2c9fcb493cb | jigjnasu/codility | exercises/chapter_11/sieve.cpp | /*
https://app.codility.com/programmers
Chapter 11 Sieve of Eratosthenes
Solution by Rakesh Kumar, cpp.rakesh(at)gmail.com
Date: 25/03/2018
*/
#include <bits/stdc++.h>
using namespace std;
vector<int> sieve(int n) {
vector<bool> p(n + 1, true);
for (size_t i = 2; i < p.size(); ++i)
if (p[i])... | ALGO | 0.999698 | 5.183455 |
4b0838ae-ac6b-4a96-bb97-fd5ebbb30746 | yonghaekim/AOS-llvm | polly/lib/Transform/MaximalStaticExpansion.cpp | #include "polly/DependenceInfo.h"
#include "polly/LinkAllPasses.h"
#include "polly/ScopInfo.h"
#include "polly/ScopPass.h"
#include "polly/Support/GICHelper.h"
#include "polly/Support/ISLTools.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#incl... | ALGO | 0.96492 | 7.872789 |
0bc5728d-98cd-4cb4-bafd-745122d29f89 | alphastar-avi/CPP | Strings/beautyOfSubstring.cpp | #include <iostream>
#include <string>
#include <climits>
#include <algorithm>
using namespace std;
int main() {
string s;
cout << "Enter a string: ";
cin >> s;
int res=0;
for( int i=0; i<s.size() ; i++){
int arr[26]={0};
for( int j=i; j<s.size() ; j++){
arr[s[j]-'a']++;
... | ALGO | 0.999935 | 4.054295 |
2b45a96c-96eb-4cdd-b714-7d98c20942f3 | Squareless-XD/2023Spring-UCAS-DataStructure-oj | hw/6/6-34.cpp | // Description
// 假定用两个一维数组L[n+1]和R[n+1]作为有n个节点的二叉树的存储结构,L[i]和R[i]分别指示节点i(i=1,2,...,n)的左孩子和右孩子,0表示空。然后由L和R建立一维数组T[n+1],使T中第i(i=1,2,...,n)个分量指示节点i的双亲,试写一个算法判别节点u是否为节点v的子孙。
// 例如,给定数组
// T= 0 0 1 1 2 2
// L= 0 2 4 0 0 0
// R=0 3 5 0 0 0
// 数组表示的二叉树的示意图如下:
// 注意:依据题目T,L,R的数组长度均为n+1,则它们数组的第一个元素均存为0。
// Input
// 第一行,第二行与第三... | ALGO | 0.999896 | 4.914607 |
ff42814e-440d-45de-9fca-dc17d506e899 | jvmcpheron/CS2_Lab4 | main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
class Paragraph {
private:
vector<string> words;
public:
void addWord(const string& word) {
words.push_back(word);
}
vector<string> getWords() const {
return words;
}... | TOOL | 0.971217 | 6.699707 |
16030452-d7e4-4b2c-9349-ddfdbdfeda29 | ishandutta2007/codeforces | pranjal.ssh/normal/978/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define FOR(i,a,b) for (auto i = (a); i <= (b); ++i)
#define NFOR(i,a,b) for(auto i = (a); i >= (b); --i)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
typedef long long ll; typedef pair <int, int> ii; typedef vector <in... | ALGO | 0.999989 | 3.853852 |
6b556174-8c09-4e05-97ba-474b70e8f5c2 | SLIIT-FacultyOfComputing/tutorial-03b-janinduu | exercise01.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float marks[] = {78.4, 90.6, 45.9, 72.2, 54.4};
char names[][20] = {"Ajith", "Wimal", "Kanthi", "Suranji", "Kushmitha"};
cout<<setw(5) << "No" << setw(15) << "Name" << setw(10) << "Marks" <<"" <<endl;
for (int r = 0; r < 5; r++)
{
... | TOOL | 0.85662 | 3.566445 |
9af19c26-bca2-4c4d-95f0-4526d21d2793 | ishandutta2007/codeforces | neal/normal/1065/C.cpp | #include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, K;
scanf("%d %d", &N, &K);
vector<int> H(N);
for (int &h : H)
scanf("%d", &h);
sort(H.rbegin(), H.rend());
int goal = H.back();
int index = 0, count = 0, slices =... | ALGO | 0.999956 | 4.569349 |
69f2032d-8b04-466e-9add-cb0718804d4b | ethanrublee/catkin-opencv | modules/legacy/src/decomppoly.cpp | #include "precomp.hpp"
#if 0
#include <malloc.h>
//#include "decomppoly.h"
#define ZERO_CLOSE 0.00001f
#define ONE_CLOSE 0.99999f
#define CHECK_COLLINEARITY(vec1_x,vec1_y,vec2_x,vec2_y) \
if( vec1_x == 0 ) { \
if( vec1_y * vec2_y > 0 ) { \
... | ALGO | 0.999733 | 3.731771 |
83693c2d-bf4b-4932-b335-abd8b4da23d5 | boy672820/ps-day | boj/io_18108/goldenbeeee/18108.cpp | #include <iostream>
using namespace std;
int main(){
int year;
cin >> year;
cout << year - 543;
return 0;
} | ALGO | 0.999314 | 3.309356 |
d57c5000-0c1e-45a4-9579-55ec50bbfc10 | starkindustries/boost-test | boost_1_62_0/libs/compute/perf/perf_stl_rotate_copy.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | ALGO | 0.974261 | 5.564855 |
c5b1d854-bff0-4366-a111-1f510949435d | Kaileshwaran13/CodeChef | 500 - 1000 difficulty rating/Finding Square Roots.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int tt, num;
cin >> tt;
while(tt--){
cin >>num;
cout << floor(sqrt(num)) <<'\n';
}
}
| ALGO | 0.999736 | 4.628109 |
48ce7511-fe72-4f65-bd26-53d5671b77d6 | abraunfels/EJUDGE | Knapsack.cpp | #include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
using namespace std;
class Knapsack
{
private:
vector<pair<size_t, size_t>> _data;
size_t _W;
vector<vector<size_t>> _mtrx;
vector<size_t> _answer;
void _ans(int, int);
public:
Knapsack(size_t size) : _W(size... | ALGO | 0.999947 | 4.05606 |
dbfacf96-4b7b-4805-b677-6f38f6610cac | Prad-R/SRFP_2024_Project | Resources/SPARTA/sparta-4Sep2024/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTeamShiftLeft.cpp | #include <TestStdAlgorithmsCommon.hpp>
namespace Test {
namespace stdalgos {
namespace TeamShiftLeft {
namespace KE = Kokkos::Experimental;
template <class ViewType, class DistancesViewType, class IntraTeamSentinelView>
struct TestFunctorA {
ViewType m_view;
DistancesViewType m_distancesView;
IntraTeamSentinel... | TEST | 0.94361 | 7.103846 |
a6d3a9b0-c2ff-4d84-9dfb-ecf0fdc2af35 | an4s/bitcoin_tx_analyzer_v0.20.1 | src/support/lockedpool.cpp | #include <support/lockedpool.h>
#include <support/cleanse.h>
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#else
#include <sys/mman.h> // for mmap
#include <sys/resource.h> // for getrlimit
... | TOOL | 0.862302 | 7.502837 |
09563a85-d602-48dd-9672-333ee8bdfc34 | eshohag/leetcode | solution/2300-2399/2361.Minimum Costs Using the Train Line/Solution2.cpp | class Solution {
public:
vector<long long> minimumCosts(vector<int>& regular, vector<int>& express, int expressCost) {
int n = regular.size();
long long f = 0;
long long g = 1 << 30;
vector<long long> cost(n);
for (int i = 0; i < n; ++i) {
int a = regular[i];
... | ALGO | 0.999623 | 4.765363 |
6de0a9a6-a97e-4802-be3f-046498628f36 | OsrHu/algorithm | pat/图/1142_Maximal_Clique.cpp | #include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 210;
int n, m, q;
int g[N][N];
bool st[N];
int vers[N];
bool isClique(int k)
{
for(int i = 0; i < k; i ++)
{
for(int j = i + 1; j < k; j ++)
{
if(!g[vers[i]][vers[j]]) return false;
... | ALGO | 0.999853 | 4.514872 |
6ddc360f-9e4c-428b-ae96-1aebc374e1a1 | Sanjida-afrin/Junior-Training-Sheet | 294A Shaass and Oskols.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long int n, i, t;
cin >> t;
long long int a[t + 1];
for (i = 1; i <= t; i++)
{
cin >> a[i];
}
cin >> n;
long long int x[n + 1], y[n + 1];
for (i = 1; i <= n; i++)
{
cin >> x[i] >> y[i];
a[x[i]... | ALGO | 0.999736 | 3.055838 |
4938ba22-0959-42a9-96b7-515f9717a14b | ChavaVennela/Competitive_Programming | Codeforces/Multiplication Table.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int n, p, i, j, count = 0;
cin>>n>>p;
for(i=1; i<=n; i++){
for(j=1; j<=n; j++){
if(i*j == p){
count = count + 1;
}
}
}
cout<<count<<endl;
return 0;
}
| ALGO | 0.999415 | 4.024806 |
2cb810bc-9225-4672-9773-3724a07ab630 | EslamSameh2003/CodeForces | 791A.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <fstream>
#include <algorithm>
using namespace std;
int main()
{
int m, b,c=0;
cin >> m >> b;
if (m > b )
{
c = 0;
}
else
{
while (m <= b)
{
m = m * 3;
b = b * 2;
c++;
}
}
cout << c << endl;
return 0;
}
| ALGO | 0.999799 | 3.857748 |
5c3e857b-9182-48bf-8553-b77eb579b554 | sahitya008/codeBlock | LL1.cpp | //print elements of linked list
#include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
};
void printList(Node* head){
while(head->next!=NULL){
cout<<head->data<<endl;
head=head->next;
}
cout<<head->data;
}
int main(){
Node* head= new Node();
Node* second= new Node();
int first=0, ... | ALGO | 0.998872 | 3.380027 |
5c17c02c-0508-4232-bb1e-392166dc54e5 | rshubham24/coding | basic codes/Linked_list_defining.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* next;
};
void print(Node* head){
while(head != NULL){
cout << head->data << " ";
head = head->next;
}
}
int main() {
Node* head = new Node();
Node* first = new Node();
Node* second = new Node();
Node* third = new Node();
... | ALGO | 0.994194 | 3.927897 |
6121ea1a-e069-46c1-89c8-923246dcb78e | Vanaub22/LeetCode-2024 | 0076-minimum-window-substring/0076-minimum-window-substring.cpp | class Solution {
public:
bool check(auto& s_freq, auto& t_freq){
for(auto it:t_freq) if(s_freq[it.first]<it.second) return false;
return true;
}
string minWindow(string s, string t) {
int m=s.length(),n=t.length();
if(m<n) return "";
if(s==t) return s;
string ... | ALGO | 0.999987 | 6.316312 |
9be95143-f690-480e-b555-03693a60da8f | DraSoGo/Competitive_Programming | Other/0217_Highest_Stack.cpp | #include <iostream>
using namespace std;
int main()
{
long long n,sum = 0,i = 1;
cin >> n;
while (n >= 0)
{
n = n - i;
i++;
//cout << n << "\n";
sum++;
}
cout << sum-1;
} | ALGO | 0.999864 | 3.295349 |
9cef8dac-d74a-4871-a167-1d1a4e24f5e3 | llvm-git-prototype/llvm | llvm/lib/Analysis/IntervalPartition.cpp | #include "llvm/Analysis/IntervalPartition.h"
#include "llvm/Analysis/Interval.h"
#include "llvm/Analysis/IntervalIterator.h"
#include "llvm/Pass.h"
#include <cassert>
#include <utility>
using namespace llvm;
char IntervalPartition::ID = 0;
INITIALIZE_PASS(IntervalPartition, "intervals",
"Interval Par... | ALGO | 0.986373 | 7.577348 |
2563142f-10b5-4959-b29a-2205604b37ae | lizhuomao/Llxy_AlgorithmDesign_programming_test | YangZeBin/1015.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
struct student{
int ID;
int character;
int talent;
int totalscore;
int type;
};
int cmp(student *a, student *b){
if(a->type == b->type){
if(a->totalscore == b->totalscore){
if(a->character == b->character){
return a->ID < b->I... | ALGO | 0.999124 | 3.415643 |
355c22f5-dcca-4d19-aac9-66af0323f579 | Naveen13s/Test | Linked-List/Fundamentals (Single LL)/DeletionofthetailofLL.cpp | //Deletion of the tail of LL
/*Given the head of a singly linked list, delete the tail of the linked list and return the head of the modified list.
The tail is the last node of the linked list.
Examples:
Input: head -> 1 -> 2 -> 3
Output: head -> 1 -> 2
Explanation: The last node was removed.
Input: head -> 1
Output:... | ALGO | 0.99953 | 5.378416 |
7a7affa1-63ab-4341-a315-b81ceca6ff43 | baibaixue/acm | 2.cpp | #include<stdio.h>////2018
#define max 100020
int main(){
int t;
scanf("%d",&t);
while(t--){
int n,m;
scanf("%d%d",&n,&m);
long long int x[max];
scanf("%d",&x[0]);
for(int i=1;i<n;i++){
scanf("%lld",&x[i]);
x[i]=x[i]+x[i-1];
}
long long int c;
while(m--){
scanf("%lld",&c);
if(x[n-1]<c){
... | ALGO | 0.99996 | 3.495214 |
7e274e84-d05a-4295-9ee6-7171dbee6f12 | wantouw/LeetCode | 2689-rearranging-fruits/2689-rearranging-fruits.cpp | class Solution {
public:
long long minCost(vector<int>& basket1, vector<int>& basket2) {
unordered_map<int, int> count;
for(auto num: basket1){
count[num]++;
}
for(auto num: basket2){
count[num]--;
}
int minValue = INT_MAX;
vector<int> ... | ALGO | 0.999946 | 5.20766 |
ec063f59-1566-4805-ba23-5bc40467b449 | keke2014/JianzhiOffer | C++/31题目1372:最大子向量和(连续子数组的最大和).cpp |
#include <stdio.h>
int main()
{
int n;
while (scanf("%d", &n) != EOF)
{
if (n == 0) break;
int maxSum, maxStart, maxEnd;
// always init maxSum to be the first value,
// may be negative (still work)
scanf("%d", &maxSum);
maxStart = maxEnd = 0;
int curSum = maxSum, curStart = 0;
if (curSum < 0)
{... | ALGO | 0.99975 | 3.267087 |
c5ede73b-9765-432d-9dfa-9e7286570061 | ciwomuli/NOIP2017exercise | 2019-3-30/A.cpp | //by ciwomuli
//AK JSOI 2019
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#define LL long long
using namespace std;
template <typename T>
inline void read(T &t)
{
... | ALGO | 0.999956 | 3.843724 |
e3c9c638-32c5-41b7-ae7f-724e8390f62b | joshualass/CP | Solutions/Contests/CodeForces/CF2001/C2001.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const ll MOD = 998244353;
int ask(int a, int b) {
cout << "? " << a + 1 << " " << b + 1 << endl;
int x; cin >> x;
return x - 1;
}
void solve() {
int n; cin >> n;
vector<int> res;
for(int i = 1; i < n; i... | ALGO | 0.999953 | 4.310535 |
70ad56c8-61b0-4f6b-8522-a00d6d0ce969 | LeBrav/SalesManProblem | Greedy.cpp | #include "pch.h"
#include "Graph.h"
// SalesmanTrackGreedy =========================================================
CTrack CTrack::CamiOptim(CGraph& graph, CVertex* pActual, CVertex* pDesti)
{
CVertex* aux_3 = pDesti;
CVertex* next = pDesti;
double min_dist = numeric_limits<double>::max();
CTrack cami_aux(&graph... | ALGO | 0.999878 | 4.647377 |
c87c17a4-70b7-43fc-903a-07bf5af52acd | ProtyayMnd50/LeetHUB | 1502-construct-k-palindrome-strings/1502-construct-k-palindrome-strings.cpp | class Solution {
public:
bool canConstruct(string s, int k) {
if(s.size()==k)return true;
if(s.size()<k)return false;
unordered_map<char,int>mp;
for(auto &x:s)
mp[x]++;
int odf=0;//odd frequencies
for(auto &x:mp){
if(x.second&1)odf++;
}
... | ALGO | 0.999992 | 6.018063 |
88e9dfce-66a4-4d8d-b344-6b038cb77724 | PhamGiau2004/Cau-truc-du-lieu | Biendoisotunhien.cpp | #include<iostream>
#include<math.h>
#include<queue>
#include<utility>
using namespace std;
int n;
void Try(){
queue<pair<int,int>> q;
q.push({n,0});
while(1){
pair<int,int> top = q.front();
q.pop();
if(top.first == 1){
cout << top.second << endl;
return;
}
q.push({top.first-1, top.second+1});
for(i... | ALGO | 0.999813 | 4.103868 |
07524baa-36b2-4ed2-9770-404c84281450 | ishandutta2007/codeforces | physics0523/normal/1607/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while(t>0){
t--;
long long x,n;
cin >> x >> n;
for(long long i=(n/4)*4+1;i<=n;i++){
if(x%2){x+=i;}
else{x-=i;}
}
cout << x << '\n';
}
return 0;
} | ALGO | 0.999965 | 3.626197 |
083f9ebf-6dab-4872-adb8-f68caf442e1f | WiseCow/algorithm | BOJ/줄세우기ㄹㄹㄹ.cpp | #include<cstdio>
int arr[201], D[201];
int main()
{
int N;
scanf("%d", &N);
for (int i = 1; i <= N; i++)
scanf("%d", &arr[i]);
int end = 1;
D[1] = arr[1];
for (int i = 2; i <= N; i++)
{
int j;
for (j = end; j > 0; j--)
{
if (D[j] < arr[i])
break;
}
j++;
D[j] = arr[i];
if (j > end)
en... | ALGO | 0.99989 | 3.427602 |
d91084c2-eec5-4a84-9dbe-2c49643b6c88 | EdwardMoseley/HackerRank | Cpp/INTRO basic for loops.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main(){
int a,b;
scanf("%d %d", &a, &b);
string sDict[10] = {"one\n", "two\n", "three\n", "four\n", "five\n", "six\n", "seven\n", "eight\n", "nine\n"};
for (int i = a; i <= b; i++){
if (i < 10){
cout << sDict[... | ALGO | 0.999426 | 3.35013 |
5d9811d1-820d-4311-9e58-36dbd38b0061 | cold-su/cold-su | code/2024/11/20/P1035 [NOIP2002 普及组] 级数求和.cpp | #include <bits/stdc++.h>
#define deb(...) puts(std::format(__VA_ARGS__).c_str())
#define int long long int
const bool HAVE_MULTIPLE_TESTCASES = false;
void solve() {
int k;
std::cin >> k;
if (k == 0) {
std::cout << 0;
return;
}
double m = 0;
int n = 1;
while (m <= k) {
m += (double) 1 / n;
n++;
}
... | ALGO | 0.999629 | 4.678443 |
f9961b60-8650-479e-a36e-153418f544e5 | matthewReff/Kattis-Problems | code/icpcawards.cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <ctype.h>
#include <unordered_set>
using namespace std;
int main(){
vector<string> schools;
vector<string> teams;
string school;
string team;
int data;
cin >> data... | ALGO | 0.9988 | 3.692137 |
485d7016-7f75-427b-bb7e-5fc446f97359 | snikolov3/DEMSI_newLAMMPS | LAMMPS/src/MOLECULE/angle_cosine_periodic.cpp | /* ----------------------------------------------------------------------
Contributing author: Tod A Pascal (Caltech)
------------------------------------------------------------------------- */
#include "angle_cosine_periodic.h"
#include <mpi.h>
#include <cmath>
#include "atom.h"
#include "neighbor.h"
#include "do... | ALGO | 0.997875 | 5.791607 |
b4711d0d-aaf4-4d4a-b411-5278c470b339 | intfloat/AlgoSolutions | codeforces/CF346/B.cpp | #include <bits/stdc++.h>
#define FOR(i, n) for (int i = 0; i < (int)n; ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int main() {
int n, m, region, score;
scanf("%d %d", &n, &m);
vector<vector<pair<int, string> > > arr(m);
char name[20];
FOR(i, n) {
scanf(" %s %... | ALGO | 0.999983 | 3.587281 |
a2e267c1-da0d-484f-b581-a9f41f6f0bc4 | SIC1740/Ki_thuat_lap_trinh | UOCSO002.cpp | #include<bits/stdc++.h>
//#include<iostream>
using namespace std ;
#define int long long
const int maxn = 1e7 + 7;
const int mod = 1e9 + 7;
void implement(){
int n;
cin >> n;
int cnt = 0 ;
for(int i = 2 ; i <=sqrt(n); ++ i){
if(n % i == 0) ++ cnt ;
while(n % i == 0){
n/= i ... | ALGO | 0.998986 | 4.825918 |
e75791fe-80c7-4333-89fe-94e88e4f9be4 | kova-css/leetcode | (905) Sort Array By Parity/905.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> sortArrayByParity(vector<int>& nums) {
int scanner = 0;
for (int i = 0; i < nums.size(); i++) {
if (nums[i] % 2 == 0) {
int temp = nums[i];
for (int j = i; j > scanner; j--) {
nums[j] = nums[j-1];
... | ALGO | 0.999983 | 5.365809 |
e87005d0-a441-460d-9f87-4baca4ae29d4 | zhiz-m/Competitive-Programming | not_equal_segment.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define fi first
#define se second
#define SZ(x) (int)(x).size()
#define rep(i,a,b) for (int i=a;i<b;i++)
#define per(i,a,b) for (int i=b-1;i>=a;i--)
#define each(a,x) for(auto&a:(x))
#define DEB... | ALGO | 0.999965 | 3.997335 |
4382530b-b2fe-47d7-b5c0-6f10b08f753e | FacundoCG/Competitive-Programming | CSES/Sliding Window/slidingWindowMex.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
const ll UNDEFINED = -1;
const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;
const ll zero = 0;
const ld EPSILO... | ALGO | 0.999995 | 3.882932 |
68142241-fb21-4f14-b103-3b542f2c3355 | sudipto0315/MyPrograms | LeetcodeSolutions/1903.cpp | #include <iostream>
using namespace std;
class Solution {
public:
string largestOddNumber(string num) {
int n = num.length();
int i = n - 1; // i is the index of the last digit
while(i >= 0){
if((num[i] - '0') % 2 == 1){
break;
}
i--;
... | ALGO | 0.999804 | 5.728776 |
aa0bcaad-da39-4d4b-9050-47a95999888c | mostafa-talat72/leetcode-solutions | 2720-minimize-the-maximum-difference-of-pairs/2720-minimize-the-maximum-difference-of-pairs.cpp | class Solution {
public:
int minimizeMax(vector<int>& nums, int p) {
if (p == 0) return 0;
sort(nums.begin(), nums.end());
int n = nums.size(), left = 0, right = nums[n - 1] - nums[0];
while (left < right) {
int mid = left + (right - left) / 2, pairs = 0;
for... | ALGO | 0.999971 | 5.733667 |
dbc0ea9a-0233-4028-873a-cab363ac9ed4 | eosspark/eos-sidechain | SideChain/externals/binaryen/test/emscripten/tests/box2d/Box2D/Collision/b2DynamicTree.cpp | #include <Box2D/Collision/b2DynamicTree.h>
#include <cstring>
#include <cfloat>
using namespace std;
b2DynamicTree::b2DynamicTree()
{
m_root = b2_nullNode;
m_nodeCapacity = 16;
m_nodeCount = 0;
m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode));
memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeN... | ALGO | 0.99823 | 7.72393 |
7fd881f7-ab75-45ba-bcaa-ede91dd94517 | 0x01111/leetcode-local-test | maximal-rectangle/test.cpp |
#include "../my_include.h"
#include "../my_util.h"
class Solution {
public:
int maximalRectangle(vector<vector<char>>& matrix) {
int row = matrix.size();
int col = matrix[0].size();
vector<vector<int>> dp(row, vector<int>(col, 0));
for (int i = 0; i < row; ++i) {
if (ma... | ALGO | 0.999897 | 5.710428 |
522a8abf-2a0d-495e-aa8d-d6774c6d4b17 | 24Pranav/Leetcode_practice | leetcode-main/leetcode-main/15-3sum/15-3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> ans;
sort(nums.begin(),nums.end());
int n=nums.size();
for(int i=0;i<n;i++)
{
int s=i+1;
int e=n-1;
int t=-nums[i]; //a+b+c=0 b+c=-a
... | ALGO | 0.999947 | 5.67258 |
07cc32ed-f97e-4a72-b760-74f3d272f898 | efaarif/c-programes | simple array operation.cpp | #include <stdio.h>
int main() {
int n, i;
float sum = 0.0, average;
int max, min;
// Input the number of elements
printf("Enter the number of elements in the array: ");
scanf("%d", &n);
if (n <= 0) {
printf("The number of elements must be positive.\n");
return 1; // Exit w... | ALGO | 0.995252 | 4.337471 |
63ec33cd-9028-47b5-943c-4b5d1b83bcea | SaketSingh1012/week1-Dp1-CipherSchools | trapping_rain_water.cpp | #include <bits/stdc++.h>
using namespace std;
int trap(vector<int> &nums)
{
int n = nums.size();
int a[n];
int b[n];
a[0] = nums[0];
b[n - 1] = nums[n - 1];
// left
for (int i = 1; i < n; i++)
{
a[i] = max(a[i - 1], nums[i]);
}
// right
for (int i = (n - 2); i >= 0... | ALGO | 0.999969 | 5.830613 |
fd2123f6-8f0e-4ec2-8244-731533515e26 | omazapa/root-old | interpreter/llvm/src/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp | #include "clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/StmtCXX.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
#include "llvm/ADT/DenseMap.h"
#i... | ALGO | 0.999045 | 7.813581 |
ba5d1443-8533-4b4b-bade-0046dee20a3b | tanisharattan/leetcode | 123-best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii.cpp | class Solution {
int find( vector<vector<vector<int>>> &dp , vector<int> &prices, int ind , int buy, int capacity ){
int n = prices.size();
if( ind==n|| capacity==0){
return 0;
}
if(dp[ind][buy][capacity]!=-1){
return dp[ind][buy][capacity];
}
if(buy... | ALGO | 0.999966 | 5.916329 |
9b9c41cd-94ae-4f9f-8f60-247008fe9e54 | Aryosetowmn/algorithm_cplusplus_tubesAKA | main.cpp | #include "Tree.h"
#include <iostream>
using namespace std;
bool isEmpty(adrNode root) {
return root == NULL;
}
int main() {
adrNode root = NULL;
int values[] = {8, 6, 15, 4, 7, 12, 17, 9, 13};
for (int value : values) {
adrNode p = newNode_103022300114(value);
insertNode_103022300114(... | ALGO | 0.998662 | 4.285611 |
a75aada4-c444-4a33-a6e5-7f215375b028 | ajmat6/DSA | L_Vertical_Order_Traversal_of_a_Binary_Tree.cpp | // class Solution {
// public:
// vector<vector<int>> verticalTraversal(TreeNode* root) {
// queue<pair<TreeNode*, int>> q;
// q.push({root, 0});
// map<int, vector<int>> mp;
// while(!q.empty()) {
// int size = q.size();
// unordered_map<int, multiset<int>> ... | ALGO | 0.999994 | 6.127265 |
38f16f96-a15d-49fd-bf42-132aedc016c9 | tung23102000/contests-CTDLGT | contest 4 CTDL>/Bai10_So_Fibonacci_Thu_N_SdNhan_Ma_Tran.cpp | #include<bits/stdc++.h>
using namespace std;
const long long mod=1e9+7;
int t;
struct Matran{
long long c[2][2];
Matran(){
c[0][0]=0; // 0 1
c[0][1]=c[1][0]=c[1][1]=1; // 1 1
}
};
Matran operator *(Matran a, Matran b){
Matran res;
for(int i=0;i<2;i++){
for(int j=0;j<2;j++){
res.c... | ALGO | 0.999925 | 3.882173 |
bf73bd59-bce8-4ccd-999e-3d24c76e776b | jvmafra/AA | bfsDists.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <string.h>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int dist[51];
vector<int> adj[51];
int INF = 100;
void zeraDists(int n){
for (int i=1; i <= n; i++){
dist[i] = INF;
}
}
int BFS(in... | ALGO | 0.996021 | 4.175763 |
bc3dbdfe-f93a-47fd-b908-2dd97a50448c | Avhad-Shashwat/Standard-Problems | Basic_Mathematics/Number of Digits in a Number (LOGARITHMIC Soln).cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cout<<"Enter Number: ";
cin>>n;
cout<<"Number of Digits: "<<(int)log10(abs(n))+1;
}
//Not valid for negative number therefore use abs(n)
| ALGO | 0.993158 | 4.273429 |
82a744ec-a74e-4851-9821-c4621fd6ebad | cbiello/twoloop_ppbbhLC | ampbbggH/ysubsgg2Lnf1ppnp/Ygg2Lnf1ppnp11.cpp | #include <iostream>
#include "listYgg2Lnf1ppnp.h"
#include <complex>
#include <qd/qd_real.h>
std::complex<dd_real> Ygg2Lnf1ppnp11(ExVariables ex){
std::complex<dd_real> ex1=ex.ex1;
std::complex<dd_real> ex2=ex.ex2;
std::complex<dd_real> ex3=ex.ex3;
std::complex<dd_real> ex4=ex.ex4;
std::complex<dd_real> ex5=ex.ex5;
st... | ALGO | 0.932432 | 3.040576 |
9ac175d8-0bc1-4c49-b632-8d6e552940a2 | muhammadlutfy/AlgoPro_Praktikum | Faktorial v1.0(No_Input).cpp | #include <iostream>
using namespace std;
//prototype
int faktorial (int n);
//Program Utama
int main () {
cout << "Faktorial dari 10 adalah ";
cout << faktorial(10);
return 0;
}
//
int faktorial (int n) {
int hasil=1;
for (int a=n;a!=0;a--) {
cout << a;
hasil=hasil*a; //perhitungan perkalian
if (a... | ALGO | 0.999553 | 4.222465 |
6e57c8e1-6427-4462-b4a0-a2e942465124 | ArchitKumar1/LeetCode-Submissions | minimum-cost-to-connect-two-groups-of-points/Wrong Answer/3-27-2021, 9:40:34 AM/Solution.cpp | // https://leetcode.com/problems/minimum-cost-to-connect-two-groups-of-points
class Solution {
public:
int connectTwoGroups(vector<vector<int>>& cost) {
int n = cost.size();
int m = cost[0].size();
int N = 1 << n, M = 1 << m;
vector<vector<int>> dp(n+1,vector<int>(... | ALGO | 0.999979 | 6.00627 |
cd501c01-bc57-4aba-b24f-d0704e8e5591 | godsonsphilip/Leetcode | 15-3sum/3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
int n = nums.size();
vector<vector<int>> result;
sort(nums.begin(), nums.end());
int i = 0;
while(i<n){
if(i!=0 and nums[i]==nums[i-1]){
i++;
continue;
... | ALGO | 0.999961 | 5.960006 |
1fabad92-d02b-475a-8577-7385765e10b3 | EdgarSCC/Tarea-ejercicios- | Tareaejercicio4_Serrano Cruz Edgar.cpp | #include <stdio.h>
#include <stdlib.h>
main(void)
{
int n, m, o;
printf("Insertar 3 numeros: ");
scanf("%d", &n);
scanf("%d", &m);
scanf("%d", &o);
if (n>m, n>o)
printf("El mayor de todos los numeros es: %d", n);
else
if (m>n, m>o)
printf("El mayor de todos los numeros es: %d", m);
else
if (o>n, o>m)
prin... | ALGO | 0.999223 | 3.489732 |
4c4cd0c2-e6c7-4071-a986-e6f7c4337c77 | dcabezas98/IG | trabajo/src/malla-revol.cpp | // *********************************************************************
// **
// ** Informática Gráfica, curso 2019-20
// ** Implementación de la clase 'MallaRevol'
// **
// *********************************************************************
#include "ig-aux.h"
#include "tuplasg.h"
#include "lector-ply.h"
#include ... | TOOL | 0.925712 | 4.064749 |
39aefcca-3c51-432d-b46e-74c32fce0302 | AteneaPallares/VampireCurse | Library/PackageCache/com.unity.ide.visualstudio@2.0.11/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.959305 | 6.955914 |
078276b8-2ca2-4385-a2d3-5cfc18fda126 | Godhuli11/My-LeetCode-questions | 0402-remove-k-digits/0402-remove-k-digits.cpp | class Solution {
public:
string removeKdigits(string num, int k) {
int n = num.size();
if(k == n) {
return "0";
}
stack<int> st;
// Keep your original for loop
for(int i = 0; i < n; i++) {
while(!st.empty() && st.top(... | ALGO | 0.999988 | 6.951042 |
feb612ac-9fa1-48c6-a123-cd4da78cae70 | dawidjanas/C-programs | II Euklides/main.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b, r;
cout << "Wpisz a: " << "\n";
cin >> a;
cout << "Wpisz b: " << "\n";
cin >> b;
r = a % b;
cout << "NWD: " << r << "\n";
}
| ALGO | 0.990726 | 4.12463 |
f9ce1c33-8845-4bfe-a024-ac4a1afa4336 | qwer312132/competive-programing | geometry/Convexhull3D.cpp | struct Pt{
Pt cross(const Pt &p) const
{ return Pt(y * p.z - z * p.y, z * p.x - x * p.z, x * p.y - y * p.x); }
} info[N];
int mark[N][N],n, cnt;;
double mix(const Pt &a, const Pt &b, const Pt &c)
{ return a * (b ^ c); }
double area(int a, int b, int c)
{ return norm((info[b] - info[a]) ^ (info[c] - info[a])); }
do... | ALGO | 0.999717 | 3.880859 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.