uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f0e1b0c3-25c9-49a4-97be-80e9a84dbbc6 | meilleur777/Competitive_Programming | BOJ/cpp/1715.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;
void init_code() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", ... | ALGO | 0.999989 | 4.316963 |
3bd61679-90ea-427c-935b-6202d7f0d9f4 | tss0823/openjdk8 | hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp | #include "precompiled.hpp"
#include "gc_implementation/shared/gcUtil.hpp"
// Catch-all file for utility classes
float AdaptiveWeightedAverage::compute_adaptive_average(float new_sample,
float average) {
// We smooth the samples by not using weight() directly u... | ALGO | 0.950589 | 6.600198 |
c214ebe5-53e2-4d44-becd-14abc00fe432 | cxlove/ACM_ICPC | Online_judge/HDU/hdoj_4633.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
using namespace std;
typedef long long LL;
const int MOD = 10007;
int powmod (int a , int b) {
int... | ALGO | 0.999535 | 4.042781 |
22eb649b-2fb1-4abe-b030-ffe73e81bb4d | Lesords/ACM | hdoj/暑假集训/练习/文件系统.cpp | #include<iostream>
#include<string>
using namespace std;
struct fil {
string name;
fil * next;//ͬļ
};
struct dir {
string name;
dir * next;//ͬļ
dir * up;//һļ
dir * dirhead;//ļ
fil * filhead;//ļ
};
dir *head,*nowhead;
dir *searchdir(string name) {
dir *tmp=nowhead->dirhead->next;
while(tmp) {
if(tmp->name... | TOOL | 0.998153 | 3.337318 |
b0497519-1718-4399-863b-789fd32935c0 | ESHUshri202/DSA_C- | 24. SwapAlternate/SP.cpp | #include<bits/stdc++.h>
using namespace std;
void printArray(int arr[], int n){
for(int i = 0 ; i<n ; i++){
cout<<arr[i]<<" ";
}cout<<endl;
return;
}
void swapAlternate(int arr[], int size){
for(int i = 0 ; i, size ; i+=2){
if(i+1 <size){
swap(arr[i],arr[i+1]);
}
... | ALGO | 0.999443 | 4.583383 |
3bc65ed1-1810-4c3c-89b3-b6d88f7addac | erigontech/silkworm | silkworm/db/datastore/snapshots/common/encoding/murmur_hash3.cpp | #include "murmur_hash3.hpp"
#include <cstddef>
namespace silkworm::snapshots::encoding {
// Platform-specific functions and macros
// Microsoft Visual Studio
#if defined(_MSC_VER)
#define FORCE_INLINE __forceinline
#include <stdlib.h>
#define ROTL64(x, y) _rotl64(x, y)
#define BIG_CONSTANT(x) (x)
// Other comp... | ALGO | 0.997139 | 7.55312 |
a7adfbc0-a152-4930-aad4-f409e413ccbb | Kartikgar/ws_stoch3 | src/stoch3_lib/include/stoch3_lib/libTrajectoryGenerator/test/utils/test_polygon.cpp | #include <iostream>
#include <cmath>
#include "utils/polygon2d.h"
/* Call this macro to run the function and declare the results */
#define TEST(func) \
if( func() ){std::cout<<"Test: " << #func << " passed." << std::endl << std::endl;} \
else {std::cout<<"Test: " << #func << " failed." << std::endl << std::endl;... | TEST | 0.852365 | 6.906008 |
f79d4be8-5b06-4a72-9dee-00044dbb1f5b | hpp340/3DScannerSoftware | MainSoftware/header/eigen/doc/snippets/MatrixBase_part.cpp | #ifndef _MSC_VER
#warning deprecated
#endif
/*
Matrix3d m = Matrix3d::Zero();
m.part<Eigen::StrictlyUpperTriangular>().setOnes();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "And let us now compute m*m.adjoint() in a very optimized way" << endl
<< "taking advantage of the symmetry." << endl;
Ma... | ALGO | 0.989665 | 3.189729 |
d840d8d8-b5f4-4d43-a8ee-263eb4fc5223 | Rishit-cloud/Unity-proj | RPG Game ------- i will name it afterwards/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.936019 | 6.947423 |
d598a2d5-3d18-4e1e-b2a8-658571e29750 | rdr2211/6Companies30Days | GoldmanSachs/Question06.cpp | /*
Company :- Goldman Sachs
6. Minimum Consecutive Cards to Pick Up
You are given an integer array cards where cards[i] represents the value of the ith card. A pair of cards are matching if the cards have the same value.
Return the minimum number of consecutive cards you have to pick up to have a pair of matching car... | ALGO | 0.999889 | 5.761762 |
1855ad94-64c6-4a66-bfa3-88f46b2de523 | Rajan1735/cpcodes | codeforces/productofthree.cpp | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define ll long long
int main()
{
ll t;
cin >> t;
while (t--)
{
ll n, i;
ll cnt = 0, ans = 0, sum = 0;
cin >> n;
ll f[3];
for (i = 2; i * i < n and cnt < 2; i++)
if (n % i == 0)
... | ALGO | 0.99946 | 3.716877 |
3d8c32fa-756e-421e-8326-78c8c93421f7 | KumarOjas/Codeforcees-solution-archive. | XeniaAndBidOperations.cpp | #include <cstdio>
#include <vector>
#include <map>
int main (){
long n, m;
scanf("%ld %ld\n", &n, &m);
std::map<long, std::vector<long> > tree;
for(long p = 0; p <= n; p++){
std::vector<long> temp(1L << p , 0);
tree.insert(std::pair<long, std::vector<long> >(n - p, temp));
}
... | ALGO | 0.999985 | 4.931364 |
3914b0b6-07d3-4a4e-91e8-f210db51a485 | Piengo/Congo-Game-AI | minimax.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <ostream>
#include <bits/stdc++.h>
#include <sstream>
#include <cstdio>
#include <fstream>
#include <string.h>
#include <algorithm>
using namespace std;
vector<string> FENStrings;
string sortInAlph(string x){
vector<string>temp;
... | ALGO | 0.998698 | 3.868006 |
a26c9617-7312-428c-8f54-88faf7a3cc65 | duyhieunguyenle1/DSA_ptit | devideAndConquer/BAI16.cpp | // Thuat toan Karatsuba nhan hai so nhi phan
#include <bits/stdc++.h>
using namespace std;
//them so 0 vao dau de co hai xau co do dai nhu nhau
int Equal(string &s1, string &s2) {
int len1 = s1.size(); //lay do dai xu 1
int len2 = s2.size(); //lay do dai xau 2
if (len1 < len2) { //lay do dai xau 2
... | ALGO | 0.999926 | 5.521842 |
abb095a0-f1a7-4ce6-bd00-411934839b3e | Vamanan/DATAMINING | hw5/matplotlib-1.5.0/extern/agg24-svn/src/ctrl/agg_gamma_spline.cpp | #include "ctrl/agg_gamma_spline.h"
namespace agg
{
//------------------------------------------------------------------------
gamma_spline::gamma_spline() :
m_x1(0), m_y1(0), m_x2(10), m_y2(10), m_cur_x(0.0)
{
values(1.0, 1.0, 1.0, 1.0);
}
//--------------------------------------... | TOOL | 0.871163 | 6.320262 |
4d556a34-f6f6-45e3-9ecc-165a7b0591ac | Haraden994/Retrowave-Audio-Reactive-Runner | include/bullet/LinearMath/btPolarDecomposition.cpp | #include "btPolarDecomposition.h"
#include "btMinMax.h"
namespace
{
btScalar abs_column_sum(const btMatrix3x3& a, int i)
{
return btFabs(a[0][i]) + btFabs(a[1][i]) + btFabs(a[2][i]);
}
btScalar abs_row_sum(const btMatrix3x3& a, int i)
{
return btFabs(a[i][0]) + btFabs(a[i][1]) + btFabs(a[i][2]);
}... | ALGO | 0.999747 | 6.751988 |
b0722ea9-3886-4f94-bb80-17d00c474f8c | Hasil-Sharma/leet-code | string-compression-1.cpp | // https://leetcode.com/problems/string-compression/description/
class Solution {
public:
int compress(vector<char>& chars) {
int sidx = 0, count = 0, len = 0, n = chars.size();
for(int i = 0; i <= n; i++){
if (i < n && chars[sidx] == chars[i]) count++;
else {
... | ALGO | 0.999968 | 6.553862 |
525ac14a-9814-4cb3-9331-d59e67cf2ff2 | anandhu720/Leetcode-Solutions | 225-implement-stack-using-queues/225-implement-stack-using-queues.cpp | class MyStack {
public:
queue<int> q;
int peek;
MyStack() {
peek = -1;
}
void push(int x) {
peek = x;
q.push(x);
}
int pop() {
int n = q.size()-1;
while(n--) {
peek = q.front();
q.push(peek);
q.pop();
... | ALGO | 0.998145 | 5.679447 |
3e05a5e6-0525-4826-856b-cb80122534f1 | benny5609/GameProject3 | Server/Src/ServerEngine/AstarFinder.cpp | #include "stdafx.h"
#include "AstarFinder.h"
AstarFinder::AstarFinder()
{
m_pOpenList = NULL;
m_pClosedList = NULL;
m_pCurPath = NULL;
m_pStack = ( STACK* )calloc(1, sizeof( STACK ));
m_pTileMap = NULL;
}
////////////////////////////////////////////////////////////////////////////////
AstarFinder::~Ast... | ALGO | 0.998068 | 3.097875 |
a4c462fa-7528-44b0-9c1f-5ac306fd2967 | ziyuang/pynerv | dredviz-1.0.2/newmat/newmat8.cpp | using namespace std;
//$$ newmat8.cpp Advanced LU transform, scalar functions
#define WANT_MATH
#include "include.h"
#include "newmat.h"
#include "newmatrc.h"
#include "precisio.h"
#ifdef use_namespace
namespace NEWMAT {
#endif
#ifdef DO_REPORT
#define REPORT { static ExeCounter ExeCount(__LINE__,8); ++Exe... | ALGO | 0.999929 | 5.056549 |
1b27d17c-4a09-431f-9512-97270e987aab | shivshankar001/Leetcode-Solutions | 0413-arithmetic-slices/0413-arithmetic-slices.cpp | class Solution {
public:
int rec(int i, vector<int>& nums)
{
//base case
if(i<2)
{
return 0;
}
//compute
int ans = 0;
if(nums[i]+nums[i-2] == 2*nums[i-1])
{
ans = max(ans, 1+rec(i-1, nums));
}
else
{
... | ALGO | 0.999749 | 5.877637 |
c6d6a279-bb43-409d-9450-a34b47e5bc44 | kean0212/learning | restoreIP.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
class Solution {
void helper(string& s, int start, int tokens, string& addr, vector<string>& res) {
if (start > s.length()) return;
if (start == s.length()) {
if (tokens == 4) res.push_back(addr.substr(0, addr... | ALGO | 0.999503 | 4.659947 |
acb311bb-fd9d-4173-a9c4-bef5d1d65a61 | ishandutta2007/codeforces | dragonslayerintraining/normal/911/B.cpp | #include <iostream>
int N,A,B;
int main(){
std::cin>>N>>A>>B;
int X=1;
while(((A/X+B/X)>=N)&&(X<=A)&&(X<=B)){
X++;
}
std::cout<<X-1<<std::endl;
return 0;
} | ALGO | 0.999783 | 3.417183 |
c15cb0ef-1fa0-4ec8-8e54-287f98ec9b78 | wyyrepo/Tianchi2 | tianchi/QRCode/zxing/zxing/multi/ByQuadrantReader.cpp | #include <zxing/multi/ByQuadrantReader.h>
#include <zxing/ReaderException.h>
namespace zxing {
namespace multi {
ByQuadrantReader::ByQuadrantReader(Reader& delegate) : delegate_(delegate) {}
ByQuadrantReader::~ByQuadrantReader(){}
Ref<Result> ByQuadrantReader::decode(Ref<BinaryBitmap> image){
return decode(image,... | ALGO | 0.965471 | 6.39377 |
b859fd32-635c-4a02-b5df-aaa604bf4612 | NguyenVanThanhHust/Data_Structures_and_Algorithms | Leetcode/symmetric_tree/symmetric_tree.cpp | #include <queue>
#include <deque>
#include <vector>
#include <string>
#include <iostream>
#include <filesystem>
#include <sstream>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(n... | ALGO | 0.999261 | 6.460431 |
d2d6a8e1-4b80-4853-8e6f-27622acc896d | gabrielfnayres/codeforces | easy/secret_research.cpp | /**
* @file secret_research.cpp
*
* Created on 2024-08-18 at 17:24:46
* @author GabrielCampelo
*/
#include <bits/stdc++.h>
#include <cstring>
#include <cstdio>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define pb push_back
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef ... | ALGO | 0.999937 | 4.44405 |
01554eb9-5f2e-4b4d-adfe-badee93a8e7a | AndresGarciaEscalante/Path-Planning-Autonomous-Car | CarND-Path-Planning-Project/src/Eigen-3.3/bench/dense_solvers.cpp | #include <iostream>
#include "BenchTimer.h"
#include <Eigen/Dense>
#include <map>
#include <vector>
#include <string>
#include <sstream>
using namespace Eigen;
std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
std::vector<std::string> labels;
std::vector<Array2i> sizes;
template<typename Solver,type... | TOOL | 0.998616 | 6.326138 |
4ee420a7-5a1b-4f64-85af-ac74ad762121 | skraio/gym | CF-800-1200/1917A/solution.cpp | #include <iostream>
int main() {
int t; std::cin >> t;
while (t--) {
int n; std::cin >> n;
int a[n];
int k = -1;
int negCount = 0;
for (int i = 0; i < n; i++) {
std::cin >> a[i];
if (a[i] == 0) {
k = 0;
}
... | ALGO | 0.999542 | 4.192183 |
fcdec5e0-b89c-4186-a95d-f64822efa9b8 | IrinaKotik28/DOM1 | DOM1/DOM1.cpp | #include <iostream>
#include <string>
using namespace std;
string multiplyStrings(string num1, string num2) {
int n = num1.size();
int m = num2.size();
string result(n + m, '0');
for (int i = n - 1; i >= 0; i--) {
for (int j = m - 1; j >= 0; j--) {
int mul = (num1[i] - '0') * (num... | ALGO | 0.999981 | 5.777668 |
f49316ee-9b8c-472b-b22d-d9d4c0cbe9b3 | mehedi132/OS-LAB-CODE | Disk-Arm Scheduling.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
void FCFS(vector <int> a, int h )
{
int temp=h, sum=0;
cout<<"Cylinder Serving Order in FSCS: ";
cout<<temp;
for(int i=0; i<n; i++){
cout<<" -> "<<a[i]<<' ';
sum += abs(a[i]-temp);
temp = a[i];
}
cout<<'\n';
cout<<... | ALGO | 0.99995 | 3.823718 |
1f02f2bd-45c2-4d7b-bd3d-9afd45e2cc61 | kimpro82/MyCodingContest | BaekJoon/Problems/Step/23/1912.cpp | // [BOJ] 단계별로 풀어보기 > 16. 동적 계획법 1
// 1912. 연속합
// 2022.08.26
/* Sample input & output data
10
10 -4 3 1 5 6 -35 12 21 -1
33
10
2 1 -4 3 4 -4 6 5 -5 1
14
5
-1 -2 -3 -4 -5
-1
*/
#include <iostream>
#include <vector>
using namespace std;
#define endl '\n'
int main()
{
int n;
cin >> n;
// Input data
... | ALGO | 0.999975 | 5.262514 |
31068ae2-0957-4bee-8f85-c224dd47212a | saifulsgit/CodeChef-problemSolving-cpp | assignments.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while(t--){
int x;
cin >> x;
if (x+3 <= 10){
cout << "yes" << endl;
} else{
cout << "no" << endl;
}
}
return 0;
} | ALGO | 0.999284 | 4.055591 |
70de1907-6b9a-45e0-8f1c-8a5c497f810e | ishandutta2007/codeforces | vepifanov/normal/161/C.cpp | #include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>
using namespace std;
#define mp make_pair
#define ... | ALGO | 0.999911 | 3.635283 |
ec616f7d-b769-435d-a4dc-abab58d20b34 | manikanta2901/CCC | .history/Day 3/Practice/Answers/TheEliteN_20210306143200.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int power,size,a;
cin >> power >> size ;
a = power;
vector<int>enemies;
for(int i = 0; i < size; i++){
int a;
cin >> a;
enemies.push_back(a);
}
int answer = 0;
for(int i = 0; i < size; i++){
if(power... | ALGO | 0.99999 | 3.695524 |
76cf352d-8e1f-472f-830a-2befa92b90f5 | radiolab81/iRadio | Transmitter/ODR/ODR-AudioEnc/fdk-aac/libAACenc/src/spreading.cpp | /* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
The Fraunhofer FDK AAC Codec Lib... | ALGO | 0.989995 | 5.576003 |
1d441c08-6743-4296-85bb-0c34a796dff2 | sarvex/leetcode-erlang | lcof2/剑指 Offer II 116. 朋友圈/Solution.cpp | class Solution {
public:
vector<vector<int>> isConnected;
vector<bool> vis;
int n;
int findCircleNum(vector<vector<int>>& isConnected) {
n = isConnected.size();
vis.resize(n);
this->isConnected = isConnected;
int ans = 0;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999773 | 6.275669 |
15837657-d51b-4f68-8492-9bafbccf4c51 | HadyAhmed00/MyChallenge | July 2022/day14/Squats.cpp | //
// Created by Hady Ahmed on 7/12/2022.
//
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <cmath>
#include <queue>
#define improve ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0);
#define all(v) v.begin(), v.end()
#define ... | ALGO | 0.999971 | 3.684118 |
29db0fc2-1d2c-451a-a749-9256734fab6c | CoderBOCHENG/C- | c++hardercode/0330_uva12157.cpp | #include <bits/stdc++.h>
using namespace std;
/*
-------------------
analysis
-------------------
For Mile:
time : 1 2 .. 29 30 31 ... 59 60 61 .. 89 90
cost : |--10-----|--20--------|--30-------|--31 ...
==>
algo : cost = (time / 30 + 1) * 10
For Juice:
time : 1 2 .. 59 60 61 ... 119 120 121 .. 179 180
cos... | ALGO | 0.997677 | 4.406448 |
c2f503cd-6c0a-4217-8c1e-c2f59ac611f2 | cqszhuangyang/unity_pcm2amr | Android/AMR/amrlib/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d_plsf_5.cpp | /*
------------------------------------------------------------------------------
Filename: d_plsf_5.cpp
------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
; INCLUDES
---------------------------------------... | ALGO | 0.999278 | 6.579201 |
6b7ea427-9a9b-482e-ba21-780d5f3ac85b | klap50/Marlin-skr2-ABL-RevoH2 | Marlin/src/feature/meatpack.cpp | /**
* MeatPack G-code Compression
*
* Algorithm & Implementation: Scott Mudge - <EMAIL>
* Date: Dec. 2020
*
* Character Frequencies from ~30 MB of comment-stripped gcode:
* '1' -> 4451136 '4' -> 1353273 '\n' -> 1087683 '-' -> 90242
* '0' -> 4253577 '9' -> 1352147 'G' -> 1075806 'Z' -> 341... | TOOL | 0.945408 | 5.833905 |
5d547ccc-cfb6-496a-b43f-37febaef55a8 | himanshudubey7/Programming | ques/A_Division.cpp | //author: Ghostyy :D
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+10;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int t;
cin>>t;
while(t--){
long long n;
cin>>n;
if(n<=1399){
cout<<"Division 4"<<endl;
}
else if(n<=... | ALGO | 0.998856 | 3.740055 |
85e0e49a-0cc5-4155-9352-535c8a092cfc | yashwani78/DSA | PP/M2/4.Recursion/4.Print_1_to_N/recursive_approach.cpp | #include <iostream>
using namespace std;
int y = 1;
void printNums(int &x){
if(y > x)
return;
cout << y << " " ;
y++;
printNums(x);
}
int main(){
int n;
cin >> n;
printNums(n);
cout << endl;
return 0;
} | ALGO | 0.999491 | 3.912069 |
d329eae8-2d38-4759-b667-ec11a72d534a | DhaneswarBhakat/LeetCode_Daily_Problems | 05-01-2024.cpp | class Solution {
public:
int f(int index, int prev_ind, vector<int>&nums, int n,vector<vector<int>>&dp ){
if(index==n)return 0;
if(dp[index][prev_ind+1] != -1)return dp[index][prev_ind+1];
int len = 0 + f(index+1, prev_ind, nums, n,dp);
if(prev_ind == -1 || nums[index] > nums[prev_... | ALGO | 0.999997 | 6.007637 |
f1cbc361-ad21-4aac-a0e8-1ea47e2d4901 | Ritikkumar992/Specialist-Sheet | Specialist_01/qs.cpp | //Codeforce handle : ritik151112
#include<bits/stdc++.h>
#define int long long int
using namespace std;
void solve()
{
// Qs1.gcd and lcm.
// int a,b;cin>>a>>b;
// cout<<__gcd(a,b)<<endl;
// cout<<a*b/__gcd(a,b)<<endl;
//Qs2.Check a no is Prime or not.
// int n; cin>>n;
// for(in... | ALGO | 0.999571 | 3.39257 |
072f5328-1dd6-4ae6-a961-c8d834e53693 | leoses/MARP_20_21 | Ejercicios/MARP_Ej_54/MARP_Ej_54/3.CasosIlimitados.cpp |
/*@ <answer>
*
* Nombre y Apellidos:
*
*@ </answer> */
#include <iostream>
#include <fstream>
#include <queue>
using namespace std;
/*@ <answer>
Escribe aquí un comentario general sobre la solución, explicando cómo
se resuelve el problema y cuál es el coste de la solución, en función
del tamaño del proble... | ALGO | 0.99817 | 4.675644 |
482e7b9c-8105-43cd-a7b1-ca6773ab0055 | CrazyFrog05/Functions | Functions/Main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
//
//
void say_hello() {
std::cout << " Hello world! \n";
std::cout << " Bye world! \n";
}
// 2
//
void print_sum(int num1, int num2) {
std::cout << num1 << " + " << num2 << " = " << num1 + num2 << '\n';
}
// 2
//
int sum(int num1,... | TOOL | 0.930444 | 3.85435 |
6df0fb59-b7c5-4905-ae66-f93b5ec34c09 | TLBlur-SGX/llvm-project | libcxx/test/std/numerics/rand/rand.dist/rand.dist.norm/rand.dist.norm.chisq/eval_param.pass.cpp | // <random>
// template<class RealType = double>
// class chi_squared_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <cassert>
#include <vector>
#include <numeric>
#include <cstddef>
#include "test_macros.h"
template <class T>
inline
T
sqr... | TEST | 0.911026 | 4.701449 |
b4b353f3-1738-4360-b3d7-3b95f2b0d49c | DeepDasg/gem5_cache_replacement | src/systemc/tests/systemc/misc/unit/data/datawidth_signed/lost_carry/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.980908 | 5.296924 |
de7dd7c3-8221-4ccc-a69f-dd5c3574398c | qkrwlgus5832/ps | boj/수영장 만들기/수영장 만들기.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
int N, M;
int graph[51][51];
int answer[51][51];
bool check[51][51];
int dir[4][2] = { {-1,0}, {1,0}, {0,-1}, {0,1} };
void checkCommitted(vector <pair <int ,int>> &tmp, int h) {
for (int i = 0; i < tmp.size(); i++) {
if (check[tmp[i]... | ALGO | 0.999902 | 3.760637 |
aee7ba83-59b2-4234-9650-c70057c075e1 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12352_10.cpp | #include <bits/stdc++.h>
using namespace std;
long long int inf = pow(10, 14), inf2 = pow(10, 12);
long long int n;
long long int arr[100005], diff[100005];
map<long long int, long long int> maxima, minima;
struct node {
long long int max1, min1;
};
node tr[7 * 100005];
node findSum(long long int qs, long long int qe... | ALGO | 0.999928 | 4.256524 |
8d61aca3-ad11-4f42-9d33-0903eda45213 | EBailey67/RPGEngine | RPGEngine/Source/Systems/collisionsystem.cpp | #include "collisionsystem.hpp"
#include "../core.hpp"
#include "playerinputsystem.hpp"
#include "../game_scene.hpp"
#include "../sdlgui/widget.h"
std::pair<Vector2Df, Vector2Df> AABBW(const SDL_FRect &lhs, const SDL_FRect &rhs)
{
if (!((lhs.x > rhs.x + rhs.w) || (lhs.x + lhs.w < rhs.x) || (lhs.y > rhs.y + rhs.h) ... | ALGO | 0.868187 | 6.897735 |
7962b7c5-30ff-4fd9-9cc1-03bf95c1f0c0 | gabrielrcp/Treino-Maratona | Treinos2009/0811/2737.cpp | // TLE, olhar a solucao com sort do Joel
#include <cstdio>
#include <map>
#include <algorithm>
#define MAX 1010
using namespace std;
struct frac{
int num, den;
bool operator<(const frac &outro) const{
return (num*outro.den < outro.num*den);
}
};
int n;
pair<int, int> pontos[MAX];
map<frac, int> M;
int r... | ALGO | 0.998846 | 4.109515 |
c7ef6ee2-b0d7-4e05-8965-f16ddd309f2f | subhj/leetcode-GFG-questions-solutions | Is Subsequence.cpp | class Solution {
public:
bool isSubsequence(string s, string t) {
int k=0;
for(int i=0; i<s.size() , i<t.size(); i++){
if(t[i] == s[k]){
k++;
}
}
if(k == s.size())
return true;
else
return false;
}
};
| ALGO | 0.999942 | 6.004426 |
12d935a6-dd3d-4298-b684-db434c18c2e4 | YashRangucha/Portfolio-page | 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.998784 | 6.761023 |
63c2fd59-b550-4fee-aa0d-8f42a7a82541 | ishandutta2007/codeforces | tinsane/normal/634/B.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <vector>
#include <map>
#include <string>
#include <cstring>
#include <utility>
#include <stack>
#include <set>
#include <algorithm>
#include <bitset>
#include <functional>
#include <cti... | ALGO | 0.999926 | 4.152507 |
42ccfd54-66d3-4bd0-be6b-79b8ec37524a | liuminghao0830/leetcode | 756_Pyramid_Transition_Matrix.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
private:
bool helper(string bottom, unordered_map<string, string>& m, string next, int p){
if (bottom.length() == 1) return true;
if (p >= bottom.length() - 1) return helper(next, m, "", 0);
string str = bottom.substr(p, 2);
... | ALGO | 0.999948 | 5.363511 |
397cd0b0-5f8a-49c6-85c4-dd8d2ba91f6b | Shafiul-006/DSA_Shafiul | leetcode7.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<int>v;
int n;
cin>>n;
if(n==0){
cout<<1<<endl;
return 0;
}
while(n){
int bit=n&1;
v.push_back(bit^1);
n=n>>1;
}
// reverse(v.begin(), v.end());
int res=0;
int j=0;
for(auto... | ALGO | 0.999998 | 4.457066 |
bb08b814-5274-4225-b7ad-3f3ef9fdc6b8 | ComplicatedPhenomenon/C_training | LeetCode/string/makeAStringBePalindromic.cpp | /**
* source: https://leetcode.com/problems/shortest-palindrome/
*
* Given a string s, you are allowed to convert it to a palindrome by
* adding characters in front of it. Find and return the shortest palindrome
* you can find by performing this transformation.
*
* Input: "abcd"
* Output: "dcbabcd"
*
* !... | ALGO | 0.998745 | 5.257764 |
bc94c5de-3ed7-490d-8bb2-815e70228674 | kmjp/procon | atcoder/arc101-150/arc126/e.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.999562 | 3.751716 |
739bd1d5-9a3b-4e1a-8d0f-e112c1bbb9ee | FraunhoferIOSB/GreasePad | src/uncertain.cpp | #include "uncertain.h"
#include "qlogging.h"
#include "upoint.h"
#include "usegment.h"
#include "ustraightline.h"
#include <QDebug>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <utility>
namespace Uncertain {
static const double T_ZERO = 1e-7;
//! Nullspace of row vector
Matrix<double,3,2> BasicEn... | ALGO | 0.949866 | 6.64191 |
923d47a5-8814-4a51-8ad7-6778edbca146 | ishandutta2007/codeforces | 12tqian/normal/1486/C2.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <iomanip>
#inc... | ALGO | 0.999981 | 4.169261 |
198bee0b-c222-4d21-a497-52e6cfdca833 | HardLee123/cal | Calcul/cal.cpp | //
// Created by Eason Lee on 9/29/2015.
//
#include"Parser.h"
#include <iostream>
int main(){
std::string line;
getline(cin,line);
Parser* p=new Parser(line);
expr* e=p->gothrough();
std::cout<<e->calcul()<<endl;
}
| ALGO | 0.876609 | 3.911945 |
bad6eabe-c85b-435e-a3b1-abbddd89c080 | sischei/OSE2019 | day1/SparseGridCode/pyipopt_midway/Ipopt-3.12.5/Ipopt/examples/ScalableProblems/MittelmannDistCntrlNeumA.cpp | #include "MittelmannDistCntrlNeumA.hpp"
#ifdef HAVE_CASSERT
# include <cassert>
#else
# ifdef HAVE_ASSERT_H
# include <assert.h>
# else
# error "don't have header file for assert"
# endif
#endif
using namespace Ipopt;
/* Constructor. */
MittelmannDistCntrlNeumABase::MittelmannDistCntrlNeumABase()
:
y_d_(NU... | ALGO | 0.999709 | 6.061642 |
0d12f3c9-9aa7-4f7b-b55f-47f4bc7b67d2 | hssnyounus/c-loops | coding/6.cpp | #include<iostream>
using namespace std;
int main()
{
int x,a,r,sum = 0;
cout<<"enter the number";
cin>>x;
a = x;
while(x!=0)
{
r = x %10;
if(r ==0)
{
sum = sum+x;
}
else{
sum = sum+r;
x = x /10;
}
cout<<"the sum of digits of"<<a<<"="<<sum;
}
}
| ALGO | 0.99977 | 4.013228 |
fecbbf34-6faf-40ad-b76e-f586c940a866 | cybergis/cybergis-toolkit | taudem/src/DinfDistUpmn.cpp | /* DinfDistUpmn main program to compute distance to ridge in DEM
based on D-infinity flow direction model.
David Tarboton, Teklu K Tesfa
Utah State University
May 23, 2010
*/
// This software is distributed from http://hydrology.usu.edu/taudem/
#include <time.h>
#include <string.h>
#include <... | ALGO | 0.999434 | 5.036761 |
169489f2-214a-4427-bb79-70bbd21ed6b4 | Yasmine-Gharsallah/vendini_final | 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.998799 | 6.776823 |
8f348d37-a7aa-4038-8afb-105e6e26b777 | Piyusha1210/DSA-Learning | 14 Dynamic Programming/3 DP on Subsequences/4_NumberOfSubsets.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int N = 1000000007;
int memoisation(int arr[], int idx, int sum, vector<vector<int>> &dp)
{
if (idx == 0)
{
if (sum == 0)
{
if (arr[0] == 0)
return 2;
... | ALGO | 0.999877 | 4.950395 |
da864061-f974-449d-8fb9-b59a078b20fe | lechenyu/Arbalest-Vec | libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp | // <vector>
// void resize(size_type sz);
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
#include "MoveOnly.h"
#include "min_allocator.h"
#include "asan_testing.h"
TEST_CONSTEXPR_CXX20 bool tests() {
{
std::vector<int> v(100);
v.resize(50);
asse... | TEST | 0.874144 | 7.256029 |
b49e1696-afd0-4ea2-9eb5-8906450f69bf | ishandutta2007/codeforces | sooke/normal/884/A.cpp | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
int n, m;
int main() {
std::cin >> n >> m;
for (int i = 1; i <= n; i++) {
int t; std::cin >> t; m -= 86400 - t;
if ... | ALGO | 0.999957 | 3.151886 |
5f7f7296-2fbb-4e6d-8440-3ce7daf74581 | atanu203/Accenture-coding-questions | Sub-array_sort.cpp | #include<bits/stdc++.h>
using namespace std;
string subArraySort(vector<int> Arr, int n) {
vector<int> temp(n);
for(int i=0; i<n; i++){
temp[i] = Arr[i];
}
sort(temp.begin(), temp.end());
int start;
for(start=0; start<n; start++){
if(temp[start] != Arr[start]) break;
}
... | ALGO | 0.999992 | 3.903168 |
e2b284e8-71a7-409f-8348-477cd4dfe470 | micio-san/pointers | pointersLessonTwo.cpp | #include <iostream>
using namespace std;
//one of the most common uses of pointes is with arrays
void pointersInArray(){
int nums[5] = { 1,5,3,8,4 };
cout << "This is the adress of the first element of the array: " << nums << "\n";
//therefore the nums variable beahaves like a pointer, and the [] are behaving as a ... | ALGO | 0.974115 | 3.778329 |
50768056-4274-4660-b8aa-520d5aad8676 | Kaneko773/Othello | CPU.cpp | #include "CPU.h"
struct NextMoveCandi
{
int putPos;//uꏊ
double winRate;//
};
CPU::CPU(bool turn, Name name, int level) {
m_name = name;
m_turn = turn;
m_endPutGudge = false;
m_arrowMoving = false;
m_moveStartTime = 0;
m_putPos = { 0, 0 };
m_level = level;
}
CPU::~CPU() {
//Ȃ
}
Action CPU::Update(Vector2* ... | ALGO | 0.995049 | 3.577678 |
1fe56fad-6c02-4a6a-8fc6-d4cd60463900 | ThanhPhammmm/DSA_PTIT | 1.CON1_/CON1_14.cpp | #include <bits/stdc++.h>
using namespace std;
bool next_combination(vector<int> &comb, int N, int K){
int i = K - 1;
while(i >=0 && comb[i] == (N - K + i + 1)){
i--;
}
// Đã là tổ hợp cuối cùng
if(i < 0){
return false;
}
comb[i]++;
for(int j = i + 1;j < K;j++){
... | ALGO | 0.99997 | 4.34355 |
f129d32a-3f44-4671-955c-3bf2e2550be1 | Mariam-maghraby/LeetCode-Problems-Solutions | 0448-find-all-numbers-disappeared-in-an-array/0448-find-all-numbers-disappeared-in-an-array.cpp | class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
vector<int> solution;
for(int i=0; i<nums.size(); i++){
if(nums[abs(nums[i])-1] >0) {
nums[abs(nums[i]) - 1] = -nums[abs(nums[i]) - 1];
}
}
for(int i=0; i<nums.size();... | ALGO | 0.999872 | 5.715417 |
5015595f-3379-4b6c-ac23-31c26e6d3292 | automenta/crittergod1.5 | physics/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp | #include "btMinkowskiPenetrationDepthSolver.h"
#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
#include "BulletCollision/CollisionShapes/btConvexShape.h"
... | ALGO | 0.999431 | 6.095329 |
1842abed-c8f5-4440-b471-14c4c23abe44 | hmittal657/coding | spoj/crds.cpp | #include <bits/stdc++.h>
using namespace std;
// https://www.spoj.com/problems/CRDS/
#define ll long long
int main() {
std::ios::sync_with_stdio(false);
int t;
cin>>t;
ll MOD = 1000007;
int count = 0;
while(count < t) {
ll n;
cin>>n;
ll ans = n;
ans *= ((3 * n) + 1);
ans = ans/2;
ans = an... | ALGO | 0.999868 | 4.43469 |
23931e85-b4a8-408b-a505-e35e387d993e | denis-gubar/Leetcode | Enumeration/2844. Minimum Operations to Make a Special Number.cpp | class Solution {
public:
int minimumOperations(string num) {
int N = num.size();
int result = N;
int zeroCount = 0, nonZeroCount = 0;
for (int i = N - 1; i >= 0; --i)
if (num[i] == '0')
{
if (++zeroCount == 2)
break;
... | ALGO | 0.99953 | 6.301301 |
8af7a02d-815c-4718-98a2-d1c6fab52241 | Lotuses-robot/Codes | Codeforces/Contest/1891/f/f.cpp | template<typename T>
void read(T &r) { r = 0; static char ch, last; ch = getchar(), last = 'z'; while (ch < '0' || ch > '9') last = ch, ch = getchar(); while (ch >= '0' && ch <= '9') r = (r << 1) + (r << 3) + (ch ^ 48), ch = getchar(); r = (last == '-') ? -r : r; }
template<typename T, typename...Ts>
void read(T &arg, ... | ALGO | 0.999382 | 4.150484 |
202be198-d7af-4c3c-9868-0fb19fe302db | PavanYalavarthi/leetcode | 206 ReverseLinkedList.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
* Time complexity : O(n)
* Space complexity : O(1)
... | ALGO | 0.999918 | 5.711586 |
90f3b253-68eb-403f-bce6-4b975e11ebe9 | ishandutta2007/codeforces | alpha_q/normal/678/C.cpp | /*
|\ | `|` |``\ ```|` | | /```\ |``\
| \ | | |__/ | |___| | | |__/
| \ | | | \ | | | | | | \
_| \| _|_ | \ \__) | | \___/ | \
*/
#include <bits/stdc++.h>
using namespace std;
int main (int argc, char const *argv[]) {
long long n, a, b, p... | ALGO | 0.999872 | 4.120321 |
a6c52abf-2fba-423f-8c76-698b60188453 | vmos-dev/external | eigen/doc/examples/DenseBase_template_int_middleRows.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(1..3,:) =\n" << A.middleRows<3>(1) << endl;
return 0;
}
| ALGO | 0.968479 | 3.245548 |
b4b67ef3-caca-41e8-9cfe-df296b7ef1cc | pandaboi1/senior_project | src/core/utility/math/plane.cpp | #include "plane.h"
#include "ray3.h"
namespace argos {
/****************************************/
/****************************************/
void CPlane::SetFromThreePoints(const CVector3& c_point_1,
const CVector3& c_point_2,
const CVect... | ALGO | 0.935925 | 6.524788 |
f4f2a98b-2c48-4b04-8ed4-7e729a97897f | Lovekush20s/DSA_in_Cpp | DSA-C++/Assignment1/3CalculateTheSum.cpp | //Calculate The Sum
#include <iostream>
#include <vector>
using namespace std;
//const int MOD = 1e9 + 7;
int main() {
int N;
cin >> N;
vector<int> arr(N);
for (int i = 0; i < N; i++) {
cin >> arr[i];
}
int Q;
cin >> Q;
while (Q--) {
int X;
cin >> X;
... | ALGO | 0.999977 | 4.833368 |
4b8ad517-9e78-476b-9ec2-4199ca7776c4 | Ivancaminal72/MTH | rtabmap/rtabmap-release/corelib/src/OdometryORBSLAM2.cpp | #include "rtabmap/core/OdometryORBSLAM2.h"
#include "rtabmap/core/OdometryInfo.h"
#include "rtabmap/core/util2d.h"
#include "rtabmap/core/util3d_transforms.h"
#include "rtabmap/utilite/ULogger.h"
#include "rtabmap/utilite/UTimer.h"
#include "rtabmap/utilite/UStl.h"
#include "rtabmap/utilite/UDirectory.h"
#ifdef RTABMA... | TOOL | 0.922904 | 6.541814 |
0daaa757-96a1-4731-b39c-460d99a9a4d2 | real013228/Algorithms-and-data-structures | Lab5/6B.cpp | #include <iostream>
#include <cstdlib>
#define SIZE 100001
template<typename T>
class List {
struct Node {
T key;
T value;
Node *prev;
Node *next;
bool flag;
Node() {
flag = true;
prev = nullptr;
next = nullptr;
}
};
... | ALGO | 0.998912 | 4.934365 |
072ffd42-cbba-4362-a116-2f8521f8dabd | PranitRohokale/6Companies30Days | Intuit/8 Number of Boomerangs.cpp | class Solution {
int getDist(vector<int>&p,vector<int>&q)
{
int dx = p[0]-q[0];
int dy = p[1]-q[1];
return (dx*dx+dy*dy);
}
public:
int numberOfBoomerangs(vector<vector<int>>& points) {
int n = points.size();
int count = 0 ;
for(int i=0;i<n;i++)
... | ALGO | 0.999835 | 6.072278 |
90532856-219e-4fe6-a6c5-903f747e5e16 | pravathapa940/DS-lab-work | Ds lab3/ds lab3q1.cpp | #include <iostream>
using namespace std;
bool implies(bool A, bool B) { return !A || B; }
bool biconditional(bool A, bool B) { return A == B; }
void print(bool val) { cout << (val ? "T" : "F") << "\t"; }
int main() {
cout << "1a. (p ? q ? r) ? (p ? r)\n";
cout << "p\tq\tr\tq\tp\t(p?q)\t(p?q?r)\t(p?r)\t?\n";
... | ALGO | 0.99901 | 3.849367 |
01e57c32-8325-4468-a014-0aa5e182c627 | Ri-Nai/LeetCode | 25.reverse-nodes-in-k-group.cpp | /*
* @lc app=leetcode.cn id=25 lang=cpp
* @lcpr version=30122
*
* [25] K 个一组翻转链表
*/
// @lcpr-template-start
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#... | ALGO | 0.999998 | 6.424644 |
aaff7246-19ac-4248-9be3-d572029f3148 | mun9769/CodingTest | Softeer/플레이페어 암호.cpp | #include<bits/stdc++.h>
#include <string>
using namespace std;
using ii = pair<int, int>;
string msg, key;
char board[5][5];
bool vis[26];
pair<int, int> pos[26];
vector<string> v;
int main(int argc, char** argv)
{
cin >> msg;
cin >> key;
vis['J'-'A'] = true;
int cur = 0;
for(auto c: key) {
... | ALGO | 0.999976 | 3.890814 |
02ef05c9-1c3f-4208-9f39-18d13bcb2a1f | wzshare/Leetcode | medium/102_Binary_Tree_Level_Order_Traversal.cpp | #include "../libstruct.h"
using namespace std;
/*
* NO.102
* Given a binary tree, return the level order traversal of its
* nodes' values. (ie, from left to right, level by level).
*/
class Solution {
public:
vector<vector<int> > levelOrder(TreeNode *root) {
buildVector(root, 0);
return ret;... | ALGO | 0.999746 | 5.651431 |
34f03f0a-dd53-49ad-9373-e517355c4421 | Pritha18/CPPCoding | Pritha/14.Function/14.11.cpp | //14.11. Write a function that gets radius of a circle and returns area
#include <iostream>
using namespace std;
void findArea(double radius)
{
double area = 3.14159 * radius * radius;
cout << "The area is: " << area << endl;
}
int main(int argc, char const *argv[])
{
double r;
cout << "Enter the radius of the ... | ALGO | 0.996685 | 4.584922 |
ad5ffc87-82c9-44d1-9e76-24e80464629c | ishandutta2007/codeforces | zhouyuyang/normal/1043/F.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint ungigned
#define db double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define vi vector<int>
#define vpi vector<pii >
#define IT iterator
#define PB push_back
#define MK make_pair
#define LB lower_bound
#... | ALGO | 0.999971 | 3.31762 |
aaf6148f-93e4-4fd8-944e-ffb73b5a8a40 | Xelane/CF-Solutions | 116a.cpp | #include <iostream>
using namespace std;
int main()
{
int n, a, b;
cin >> n;
int min = 0;
int curr = 0;
for(int i=0;i<n;i++)
{
cin >> a >> b;
curr -= a;
curr += b;
}
return 0;
} | ALGO | 0.999832 | 3.005254 |
a881faba-804f-458d-ae9a-b3e101e36b34 | raihan02/UVA-online-judge | UVA 11730 - Number Transformation.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int, int> ii;
int prime[3000000], nPrime;
int mark[10000002];
int factor[300];
int ck;
map <int, bool> mp;
void sieve(int n)
{
int i, j, limit = sqrt(n * 1.) + 2;
mark[1] = 1;
for(int i = 4; i <= n; i += 2)
mark[i]... | ALGO | 0.99995 | 4.207644 |
53b53392-b205-4ce4-8f4b-73defd2ed0b3 | nataraj2/MovingEB_CNSAMReX | CNS_EBoft_ICE/Source/main.cpp |
#include <AMReX.H>
#include <AMReX_ParmParse.H>
#include <AMReX_ParallelDescriptor.H>
#include <AMReX_Amr.H>
#include <AMReX_EB2.H>
#include <CNS.H>
using namespace amrex;
void initialize_EB2 (const Geometry& geom, const int required_level, const int max_level, Real time);
void finalize_EB2();
int main (int argc, ... | ALGO | 0.987117 | 4.530276 |
e5755fa2-d225-4d5c-ba73-9961b0e6abda | rishabh-pandey-393/algoo | maximum-nesting-depth-of-the-parentheses/maximum-nesting-depth-of-the-parentheses.cpp | class Solution {
public:
int maxDepth(string s) {
int ans=0,n=s.size(),ct=0;
for(int i=0;i<n;i++){
if(s[i]=='(') ct++;
else if(s[i]==')') ct--;
ans=max(ans,ct);
}
return ans;
}
}; | ALGO | 0.999496 | 5.771954 |
1ac1f30c-b550-4a82-806d-bb4db9fbc2a1 | CatalinFrancu/nerdvana | problems/kilonova/graba/pn-v4.cpp | // Complexitate O(N * P) cu liste înlănțuite + intrare și ieșire rapidă.
//
// Autor Cătălin Frâncu
#include <ctype.h>
#include <queue>
#include <stdio.h>
#include <string.h>
struct fast_input {
static const int BUF_SIZE = 4098;
char buf[BUF_SIZE + 1];
int pos = BUF_SIZE;
FILE* f;
fast_input(const char* fil... | ALGO | 0.997866 | 3.468723 |
50fdf873-5504-45ea-a3e1-edf746c2e94a | ishandutta2007/codeforces | jdurie/normal/463/A.cpp | #pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll n, s, mx = 0;
cin >> n >> s;
bo... | ALGO | 0.994822 | 3.469099 |
48e44172-21f1-47a7-a5de-96a9954340f6 | ishandutta2007/codeforces | tempura0224/normal/1118/D1.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for... | ALGO | 0.999994 | 3.481648 |
b25d8a65-f3e3-4699-98c9-3e383e564184 | sion-k/Algorithm | baekjoon/23326/main.cpp | #include <bits/stdc++.h>
#define FAST() cin.tie(0)->sync_with_stdio(0)
#define OPEN(t) freopen("data.txt", (t), (t == "r" ? stdin : stdout))
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) (int)((x).size())
#define deb(x) cout << #x << " : " << (x) << "\n"
#define deb_pair(x, y) cout << "(" << #x << ", " << #y ... | ALGO | 0.999592 | 3.993666 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.