uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f5b8ed74-6088-459b-8d14-8da15b8288ff | ishandutta2007/codeforces | i_love_tanya_romanova/normal/577/A.cpp | /*
Beauty is what eyes behold
And you burn brighter than most
I chased you through the midnight streets
To be where I could speak freely
I didn't care what tomorrow held
I felt the world turning only for us
Only bliss now for you and me
Rise up let life's kiss send us reeling
And unlike the times before
From yesterda... | ALGO | 0.999945 | 3.399991 |
0c0e3f05-8a3d-44bb-8736-c4203371fc22 | donghankim/Highway-Simulation | src/Eigen-3.3/unsupported/doc/examples/BVH_Example.cpp | #include <Eigen/StdVector>
#include <unsupported/Eigen/BVH>
#include <iostream>
using namespace Eigen;
typedef AlignedBox<double, 2> Box2d;
namespace Eigen {
Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point
}
struct PointPointMinimizer //how to compute squa... | ALGO | 0.999785 | 6.518754 |
cf63a689-06a9-41fe-bd15-daff787246a2 | VivekHero/SE-SEM_4-DSAL | modified/DP_A8.cpp | /* Source - Sahil Sharma (GitHub Link -- https://github.com/SharmaSahil2003)
*/
#include <iostream>
#include <climits>
#define MAX 10
using namespace std;
class TreeNode{
int val;
TreeNode *left;
TreeNode *right;
public:
TreeNode(){
val = 0;
left = right = NULL;
}
friend ... | ALGO | 0.999921 | 4.122243 |
38b8f9a5-96dc-4946-9b7c-7ce2c580543a | avigautam-329/Interview-Preparation | BinaryTree/TakeInputAndPrintRecursively.cpp | #include<iostream>
using namespace std;
template <typename T>
class binaryTreeNode{
public:
T data;
binaryTreeNode<T>* left;
binaryTreeNode<T>* right;
binaryTreeNode(T val){
this->data = val;
this->left = NULL;
this->right = NULL;
}
~binaryTreeNode(){
delete left;
delete right;
}
};... | ALGO | 0.999342 | 4.687693 |
b938c426-827c-468c-8d5a-a6292d0942e8 | sieb/biblepay-evolution-tester | src/arith_uint256.cpp | #include "arith_uint256.h"
#include "uint256.h"
#include "utilstrencodings.h"
#include "crypto/common.h"
#include <stdio.h>
#include <string.h>
template <unsigned int BITS>
base_uint<BITS>::base_uint(const std::string& str)
{
SetHex(str);
}
template <unsigned int BITS>
base_uint<BITS>& base_uint<BITS>::operator... | ALGO | 0.957673 | 6.599471 |
3fb501b1-3b42-4cf3-b4bd-e37aada3207c | kawhing/Programming-road | learning/cpp/STL/container/deque/sort.cpp | #include <iostream>
#include <deque>
#include <algorithm>
using namespace std;
// deque容器的数据存取
void printDeque(const deque<int> d){
for(deque<int>::const_iterator it = d.begin(); it < d.end(); ++it)
cout << *it << " ";
cout << endl;
}
void test01(){
deque<int> d1;
d1.push_back(10);
d1.push_... | ALGO | 0.996481 | 4.689631 |
f392c9f0-965b-4712-bc42-e62a8d1fc63b | Vipul1407/DSA--Leetcode-Ques.. | 3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i/minimum-operations-to-make-binary-array-elements-equal-to-one-i.cpp | class Solution {
public:
int minOperations(vector<int>& nums)
{
int n= nums.size();
int cnt=0;
for(int i=0;i<=n-3;i++)
{
if(nums[i]==0)
{
cnt++;
//xor with 1 to get flipped number..
nums[i]= nums[i]^1;
... | ALGO | 0.999978 | 5.930529 |
5110b821-1510-4c30-991d-7baaec08c9b5 | remyvnkhiemtruong/Programming-Contests | data-structures/heavy-light decomposition.cpp | // The glory is for GOD
// Solution to TIMUS 1553: Caves and tunnels
#include <bits/stdc++.h>
#define DB(a) cerr << __LINE__ << ": " << #a << " = " << (a) << endl;
using namespace std;
const int MAXN = 1e5 + 5;
int n, q, u, v, timer, tin[MAXN], tout[MAXN], buf[2 * MAXN], paths, *tree[MAXN], root[MAXN], num, size[M... | ALGO | 0.999875 | 4.71946 |
283d27d3-4f3b-4275-aff8-dc0bce899b64 | zilixie/Ray-Tracer | libigl/include/igl/find_cross_field_singularities.cpp | #include "find_cross_field_singularities.h"
#include <vector>
#include <igl/cross_field_missmatch.h>
#include <igl/is_border_vertex.h>
#include <igl/vertex_triangle_adjacency.h>
#include <igl/is_border_vertex.h>
#include <igl/cross_field_missmatch.h>
template <typename DerivedV, typename DerivedF, typename DerivedM, ... | ALGO | 0.985756 | 5.703022 |
66e62c9d-2f8d-4884-bc95-6ddae3464a35 | Student-FastDev/Problems | InstaKolko/Taśma.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long long maxSubarraySum(const vector<long long>& tape) {
long long maxSum = 0;
long long currentSum = 0;
for (long long num : tape) {
currentSum = max(num, currentSum + num);
maxSum = max(maxSum, currentSum);
... | ALGO | 0.999939 | 5.88407 |
48a301f2-be98-4a6f-b520-8d0331b5b388 | Didarulisalmdidar/CP_Number_Theory | Number Theory/SPOJ - ODDDIV.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxx=10000000;
bool mark[maxx+5];
vector<long long>v;
vector<long long>vec[10002];
void sieve()
{
for(long long i=2;i*i<=maxx;i++)
{
if(!mark[i])
{
for(long long j=i*i;j<=maxx;j+=i)
mark[j]=true;
}
}
... | ALGO | 0.999936 | 3.813245 |
c292fde3-523d-4c73-9cc2-15a3f3819871 | Whaleer/Bobs_CppPrimer_Solves | ch05/5_6.cpp | //
// Created by Bingxi L on 2024/2/20.
//
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
const vector<string> scores = {"F", "D", "C", "B", "A", "A++"};
int grade = 0;
while(cin >> grade){
string letterGrade = grade < 60 ? scores[0] : scores[(grade - 5... | TOOL | 0.987268 | 4.675798 |
e37ae0b8-0128-478a-9268-46aa8c5fa90c | vbonnici/grafe-sim | analysis/data/p02272/s704124412.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int n, count;
int *S;
inline void merge(int left, int mid, int right) {
// printf("[merge] left = %d, mid = %d, right = %d\n",
// left, mid, right);
int n1 = mid - left, n2 = right - mid;
int *L = ne... | ALGO | 0.99982 | 3.452646 |
3479e7aa-9904-49d9-ae01-355654195381 | zhangw/boost_1_59_0 | libs/geometry/doc/src/examples/strategies/buffer_distance_symmetric.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[buffer_distance_symmetric
//` Shows how the distance_symmetric strategy can be used as a DistanceStrategy to create symmetric buffers
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/g... | TOOL | 0.851661 | 6.695322 |
6c078887-b02a-48f2-974c-90875933f961 | nico0129/Quantlib | ql/experimental/basismodels/tenoroptionletvts.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*! \file tenoroptionletvts.cpp
\brief caplet volatility term structure based on volatility transformation
*/
#include <ql/experimental/basismodels/tenoroptionletvts.hpp>
#include <ql/exercise.hpp>
#include <ql/indexes/iborindex.hpp>
... | TOOL | 0.962852 | 7.328837 |
69f9400a-682d-4b18-8d32-4f3cd052b7f9 | arnoliudaxia/workInUniversity | CS110(计组)/hw3/hw3.cpp | //#include <stdio.h>
//#include <string.h>
//
//int max(int a, int b)
//{
// return a > b ? a : b;
//}
//int min(int a, int b)
//{
// return a > b ? b : a;
//}
//const char* str1 = "1000001";
//const char* str2 = "1010011110011110110011001011111101011010111000000";
//int m = 5, n = 4;
//
//// 现在已经找到两个字符串在某个位置有一样的... | ALGO | 0.999744 | 3.498721 |
9f3d5a9f-e6e8-42f6-8d80-c94b8a33d789 | raincross7/code-similarity | codes/train_code/problem384/problem384_30.cpp | #include<cstdio>
#include<vector>
using namespace std;
int main(){
unsigned N, K;
scanf("%u %u\n", &N, &K);
bool left_is_upsidedown = false;
unsigned consecutive = 0;
vector<unsigned> A;
A.push_back(0);
for (unsigned i = 0; i < N; ++i){
char tmp;
scanf("%c", &tmp);
bool this_is_upsidedown = tmp == '1';
... | ALGO | 0.999971 | 3.678758 |
202cc610-925c-442b-8a70-5d46e3b18e0a | atuthala/learncpp | ch18/ch18_01/main.cpp | /*
https://www.learncpp.com/cpp-tutorial/sorting-an-array-using-selection-sort/
18.1 — Sorting an array using selection sort
*/
#ifdef ss // Selection sort
#include <iostream>
#include <utility>
int main()
{
int x{2};
int y{4};
std::cout << "Before swap: x = " << x << ", y = " << y << '\n';
std::swap(x, y); // sw... | ALGO | 0.999574 | 5.881346 |
aa310e45-ad94-4b3e-9720-ae22cc5a3469 | AlexGoico/Academic-Tools | NumberConversions/dec2bin.cpp | #include <exception>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cctype>
#include <cstdlib>
using std::cout;
char digit_to_char(const int d)
{
char digits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
return digits[0] + d;
}
int main(int argc, char* argv[])
try
{
/* ... | ALGO | 0.927019 | 6.53655 |
d4c49ce0-d3bd-4ac8-b4f8-84d57daa8bcf | raincross7/code-similarity | codes/train_code/problem076/problem076_49.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using lli = long long int;
using ll = long long;
lli n, m, h, a, b;
std::vector<lli> vec;
std::vector<lli> viewpoints;
int main() {
std::cin >> n >> m;
vec.assign(n+1, 0);
viewpoints.assign(n+1, -1);
for (int i = 1; i <= n; i++) {
st... | ALGO | 0.999988 | 4.380465 |
fa48ace2-b7db-4370-92e1-246b428b8176 | RanjanKiran707/petparent | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
43dc8f90-1cc2-44e3-9957-17462197615e | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6478_13.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<int> a(n), b(n);
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n; i++) cin >> b[i];
int c = 0, c2 = 0, c3 = 0;
for (int i = 0; i < n; i++... | ALGO | 0.999967 | 3.52878 |
99785240-68c6-4da3-832d-59ec3bf58231 | silkroading/opencv | samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp | /**
* @function cornerSubPix_Demo.cpp
* @brief Demo code for refining corner locations
* @author OpenCV team
*/
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
/// Global variables
Mat src, src_gray;
int maxCorners = 10;
int maxTrackbar ... | ALGO | 0.99934 | 7.014394 |
14a6cd39-83b3-4b6a-aea9-d66f8367dc11 | wylited/solutions | codeforces/1800..1899/1899A.cpp | #include <bits/stdc++.h>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int t, n;
std::cin >> t;
while (t--) {
std::cin >> n;
if (n % 3 == 0) {
std::cout << "Second" << std::endl;
} else {
std::cout << "First" << std::endl;
}
}
return 0;
}
| ALGO | 0.999703 | 4.523141 |
1aada456-061f-4370-8dc8-0af81aabad97 | mabarrera4/UVa-Online-Judge-Solutions | 13021.cpp | /*
* 13021. Game of Cards
* TOPIC: sprague-grundy, nim, nimbers, xor
* status: Accepted
*/
#include <assert.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <set>
#define MAXK 11
#define M 0x80
#define N 0x400
#define oo (1<<29)
using ... | ALGO | 0.999898 | 3.86318 |
65db1e4b-7cde-49f7-b992-331c849c8207 | hansonw/fuzzy-native | src/MatcherBase.cpp | #include "MatcherBase.h"
#include "score_match.h"
#include <algorithm>
#include <queue>
#include <thread>
using namespace std;
typedef priority_queue<MatchResult> ResultHeap;
inline int letter_bitmask(const char *str) {
int result = 0;
for (int i = 0; str[i]; i++) {
if (str[i] >= 'a' && str[i] <= 'z') {
... | ALGO | 0.994202 | 6.672524 |
f8c950da-b1ba-4004-8bb4-edf9f10449a5 | towmiess/DSA_PTIT | web_DSA/07027ptulonhonbenfaiDAUTIEN.cpp | #include<bits/stdc++.h>
using namespace std;
void check(int a[], int n) {
int R[n];
stack<int> st;
for (int i = n - 1; i >= 0; i--) {
while (!st.empty() && st.top() <= a[i]) {
st.pop();
}
if (st.empty())
R[i] = -1;
else
R[i] = st.top();
... | ALGO | 0.999965 | 5.287545 |
2779f5eb-c4ff-4bd0-b8c6-0e46adf312d1 | gajgeospatial/Geos-3.11.1 | src/index/quadtree/Node.cpp | #include <geos/index/quadtree/Node.h>
#include <geos/index/quadtree/Key.h>
#include <geos/geom/Envelope.h>
#include <string>
#include <sstream>
#include <cassert>
#include <memory>
#ifndef GEOS_DEBUG
#define GEOS_DEBUG 0
#endif
#if GEOS_DEBUG
#include <iostream>
#endif
using namespace geos::geom;
namespace geos {
... | ALGO | 0.996839 | 7.088317 |
e2eae8c1-dcbc-47a6-9bd0-182be18cb78d | Mephisto1024/MFST_Engine | Engine/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/src/test/test_parallel_scan.cpp | #include "tbb/parallel_scan.h"
#include "tbb/blocked_range.h"
#include "harness_assert.h"
#include <vector>
typedef tbb::blocked_range<long> Range;
static volatile bool ScanIsRunning = false;
//! Sum of 0..i with wrap around on overflow.
inline int TriangularSum( int i ) {
return i&1 ? ((i>>1)+1)*i : (i>>1)*(i+1... | ALGO | 0.901909 | 5.813643 |
c08689a8-769f-432d-823c-26ce5e3b8a22 | shirleyla10/BinarySearchTree | main.cpp | /*
main.cpp
Written By: Lauren Shirley
Date: 05/03/16
Description: This is the driver file to test
the BinarySearchTree data structure.
*/
#include "BST.h"
#include <cstdlib> //for use of rand()
#include <iostream>
using namespace std;
int main(){
BinarySearchTree B; //initialize a null BST
srand (time(NULL... | ALGO | 0.876579 | 4.695444 |
db2dee33-1c50-4138-8c43-cc55283e9b76 | RAVI-SINGH2003/DSANEW | graphs/39_DSU.cpp | #include<bits/stdc++.h>
using namespace std;
// TC : 4*alpha where alpha~1 so constant time compexity O(4)
class DSU{
vector<int> parent,size,rank;
public :
DSU(int n){
rank.resize(n+1,0);
size.resize(n+1,1);
parent.resize(n+1);
for(int i=0;i<n;i++){
parent[i] = i... | ALGO | 0.999912 | 4.368566 |
24a2a1c2-9ee0-43b1-94b4-dd61db2270f9 | gino1610/cpp_examples | basic/prime_number2.cpp | #include <iostream>
using namespace std;
// C++ Program to Print next Prime number
int main()
{
int ii, jj = 2, number;
cout << "Enter any number: ";
cin >> number;
cout << "Next primer number: ";
for (ii = number+1; ii < 3000; ii++)
{
for (jj = 2; jj < ii; jj++)
{
... | ALGO | 0.994439 | 3.999586 |
8ad9f06c-a249-4d81-819d-ba34a7127983 | monta0315/atcoder_begin | donyoku/additionandmultiplication.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define fore(i,a) for(auto &a:a)
#define e(v) sort(v.begin(), v.end())
#define rev(v) reverse(v.begin(), v.end())
#define out(s) cout << s << endl
#define decimal10(s) cout << fixed << setprecision(10) << s << endl
#define two... | ALGO | 0.999968 | 3.794958 |
60b61581-bf69-4105-b7b8-37483b095433 | Brulogg/atv_c_2sem | Ex1 Parte 2.cpp | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL,"Portuguese");
int n;
float mod4, mod5;
printf("NMEROS DIVISVEIS POR 4 E 5\n");
printf("Insira um nmero: ");
scanf("%d",&n);
mod4 = n-4 * (n/4);
mod5 = n-5 * (n/5);
if (mod4==0 && mod5==0)
{
printf("Este nm... | ALGO | 0.996659 | 3.846487 |
7b9d6d48-589c-4b50-8669-528da9df917e | LazyPlanet/MX-Architecture | ThirdParty/boost_1_63_0/libs/spirit/classic/phoenix/example/fundamental/sample4.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <boost/spirit/include/phoenix1_operators.hpp>
#include <boost/spirit/include/phoenix1_primitives.hpp>
#include <boost/spirit/include/phoenix1_statements.hpp>
#include <boost/spirit/include/phoenix1_special_ops.hpp>
using namespace std;
using namespace... | TOOL | 0.88567 | 4.742697 |
b9ad7807-64d3-4c20-b7a4-c939949978c3 | siilieva/root | interpreter/llvm-project/llvm/lib/ProfileData/ProfileSummaryBuilder.cpp | #include "llvm/IR/ProfileSummary.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/ProfileData/ProfileCommon.h"
#include "llvm/ProfileData/SampleProf.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
namespace llvm {
cl::opt<bool> UseContextLessSummary(
"profile-summary-contextless", cl::Hidd... | TOOL | 0.856686 | 7.812695 |
cbeec9c3-2166-4244-ae56-9c8899295a59 | stork-max/SphinxSearch | src/wordbreaker.cpp | //
// $Id$
//
#define PREFER_ALLDICT 0
#define UNKNOWN_WORD_COEFF 3.0f
#define DICT_THRESH 12
#define DEFAULT_DICT "wordbreaker-dict.txt"
#define DICT_COMPOUND_MIN 6 // keywords longer than this are potential compounds
#define DICT_COMPOUND_THRESH 0.0001f // penalize a no-split with a rare potential compo... | TEST | 0.993271 | 5.016171 |
e4e7b56d-b6d4-4572-b1a6-9a8231a2e2eb | ruicoelhopedro/pawn | src/MoveOrder.cpp | #include "MoveOrder.hpp"
#include "Types.hpp"
#include "Position.hpp"
#include "Move.hpp"
#include "Hash.hpp"
#include "NNUE.hpp"
#include <iostream>
void CurrentHistory::add_bonus(Move move, PieceType piece, int bonus)
{
main_history->add(move.from(), move.to(), bonus);
for (std::size_t i = 0; i < NUM_CONTINU... | ALGO | 0.997003 | 6.915291 |
334640d8-c541-4e66-8f22-22a593cdbdc2 | shallx/problem_solving | leetcode/array/217.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
class Solution {
public:
bool containsDuplicate(vector<int>& v) {
sort(v.begin(),v.end());
int ln = v.size() - 1;
for(int i = 0; i < ln; i++){
if(v[i] == v[i+1]) return true;
}
return ... | ALGO | 0.999841 | 4.822646 |
ed67c40a-7e04-482e-809d-88429beea408 | ishandutta2007/codeforces | heno239/normal/1553/I.cpp | #pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>... | ALGO | 0.999993 | 3.912779 |
c58199d2-3c82-4e9b-9ca7-d18f7c93ef05 | aqfaridi/Competitve-Programming-Codes | HACKEREARTH/JDA/StrategicWarehouseplacements_backup.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <vector>
#include <iomanip>
#include <cmath>
#include <set>
#include <map>
#include <queue>
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define... | ALGO | 0.999889 | 4.780229 |
c27ee68f-f660-483d-ada8-4fda03e7a1ff | ychaaibi/leetcode | 88-merge-sorted-array/merge-sorted-array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int l = n + m - 1 , p1 = m - 1, p2 = n - 1;
while (p1 >= 0 or p2 >= 0)
{
if (p1 < 0)
nums1[l--] = nums2[p2--];
else if (p2 < 0)
nums1[l... | ALGO | 0.999972 | 5.375605 |
888e567b-730d-4d44-8a4f-970b83784c0b | cran/scorematchingad | inst/cppad/speed/cppad_jit/det_minor.cpp | /*
{xrst_begin cppad_jit_det_minor.cpp}
cppad_jit Speed: Gradient of Determinant by Minor Expansion
###########################################################
Specifications
**************
See :ref:`link_det_minor-name` .
Implementation
**************
{xrst_spell_off}
{xrst_code cpp} */
# include <map>
# include <c... | ALGO | 0.999846 | 6.32233 |
55c02e96-5760-43e4-ae6f-e9bf85487239 | Alienworm/dataStruct | 栈/SqStack.cpp | #include <iostream>
#define MaxSize 50
using namespace std;
// 顺序栈存储结构
typedef struct {
int *data; // 动态数组
int top; // 顺序栈栈顶位置
} SqStack;
// 初始化顺序表
void initStack(SqStack &S) {
S.data = new int[MaxSize];
S.top = -1;
}
// 获取第一个元素
int top(SqStack &S) {
return S.data[S.top];
}
// 入栈
bool push(SqS... | ALGO | 0.995668 | 4.248517 |
6070982f-358d-4004-804e-4e0ea1dc095d | SurgicalSteel/Competitive-Programming | Hackerrank/Sherlock and The Beast.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int tc,a,b;
string ba,bb;
scanf("%d",&tc);
while(tc--)
{
scanf("%d",&a);
b=a;
while(b%3!=0)
{b-=5;}
if(b<0){printf("-1\n");}
else
{
ba="";
bb="";
for... | ALGO | 0.999787 | 3.900698 |
2947ca31-9e4e-47cb-9884-a505edb2f787 | odilbekmarimov/sept17 | problem15.cpp | //
// Created by Odilbek Marimov on 19/09/24.
//
#include <iostream>
using namespace std;
int main() {
int num;
cin>>num;
// int condition=1;
// if (num>0) {
// condition=1;
// }
// else if (num<0) {
// condition=-1;
// }
// else {
// condition=0;
// }
// ... | ALGO | 0.997479 | 4.010668 |
d435c553-734a-4030-8a50-141bc6637877 | MrinmoiHossain/LeetCode | 876.Middle_of_the_Linked_List/MiddleoftheLinkedList.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) {}
* };
*/
class Solution {
public:
ListNode* middleNode(... | ALGO | 0.99982 | 5.914674 |
ab2e84b2-d38c-46cf-869b-7be770c1e0e1 | MaksymZolotarchuk/epic7 | Task3v18(1).cpp | #include <iostream>
#include <cmath>
#include <Windows.h>
using namespace std;
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251); //
double money;
cout << " : " << endl;
cin >> money;
double fraction;
double integer;
fraction = modf(money, &integer); //
cout << integer << " ." << " " ... | ALGO | 0.988867 | 3.422487 |
f05beb9c-7e0c-4a5a-b202-6b3ffb3d0110 | MirrorShih/CodeBook | Online Judge/Zerojudge/b058.cpp | #include<bits/stdc++.h>
#include<bits/extc++.h>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
using ll = long long;
#define AC ios::sync_with_stdio(0),cin.tie(0);
struct node
{
int val,deg=0,mx=0;
bool tag=0;
vector<int> child;
vector<int> par;
};
vector<node> v;
int dfs... | ALGO | 0.999986 | 4.223495 |
dac89dfb-07b3-43e1-9f01-fbbdbf610f19 | agg-yash/Codeforces | Queueatschool.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,t;
cin>>n>>t;
cin.ignore();
string s;
cin>>s;
while(t--)
{
for (int i = 0; i < n-1; ++i)
{
if (s[i]=='B' && s[i+1]=='G')
{
swap(s[i],s[i+1]);
i... | ALGO | 0.999854 | 3.858343 |
0bdb1658-ac6c-40a0-9ec0-cfbd0340c391 | Jiwon116/Algorithm | Programmers/타겟 넘버.cpp | #include <bits/stdc++.h>
using namespace std;
int solution(vector<int> numbers, int target) {
int answer = 0;
// 경우의 수 -> 각 노드마다 2가지씩 (더하기, 빼기)
queue<pair<int,int>> q;
q.push({0, numbers[0]});
q.push({0, -numbers[0]});
while(!q.empty()) {
int hereNumIdx = q.front().first; // ... | ALGO | 0.999748 | 5.686715 |
54657c1c-0f8f-4cd8-9325-59e90dd9430c | PauGarza/Fracciones-Mixtas | fracciones mixtas/main.cpp | #include <iostream>
long long int n, d;
int main()
{
std::cin>>n>>d;
if(n/d>0){
std::cout<<n/d<<" ";
}
if(n%d!=0){
std::cout<<n%d<<"/"<<d<<std::endl;
}
return 0;
}
| ALGO | 0.998961 | 5.297117 |
9ecc0a65-8dbe-4008-9c6b-2d963d50b90d | Naushad-ansarintiw/DSA_REPO | Array basic/Easy Ques/12slidingWindowMax_subARR.cpp | #include <iostream>
#include <vector>
#include <deque>
using namespace std;
class Solution{
public:
vector<int> maxSlidingWindow(vector<int> &vec,int k){
deque<int> dq;
vector<int> ans;
for (int i = 0; i < vec.size(); i++)
{
if(!dq.empty() && d... | ALGO | 0.999935 | 4.60705 |
5638275c-b27f-49a2-8f8a-92da8c4f0135 | ishandutta2007/codeforces | krijgertje/normal/425/D.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.999971 | 4.321457 |
b4864d9a-ddb4-4da0-a63c-c1b2a0e5eb2d | ishandutta2007/codeforces | shmilyty/normal/710/D.cpp | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define elif else if
#define ALL(x) x.begin(),x.end()
#define lowbit(x) (x&(-x))
using namespace std;
void fileio(const string &s)
{
freopen((s+".in").c_str(),"r",stdin);
freopen((s+".out").c_str(),"w",stdout);
}
const int INF=4e18;
inline in... | ALGO | 0.999949 | 3.528666 |
27cf1b4b-0803-49f3-8d0a-d66ecbbad76c | Ankit-Kum-ar/DSA_CPP | Problems_On_Sorting/Q1).cpp | /*
Ques: Given an array with N distinct elements, convert the given array to a form where all elements are in the range from 0 to N-1. The order of elements is the same, i.e., O is placed in the place of the smallest element, 1 is placed for the second smallest element, ... N-1 is placed for the largest element.
*/... | ALGO | 0.999987 | 5.301148 |
0a49e5d1-5034-46bc-a2c5-fb747b0029ea | kkisic/Procon | CPP/AtCoder/agc/001/a.cpp | #include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>
#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef pair<int, int> P;
const int INF = 1e15;
const int MOD... | ALGO | 0.999691 | 3.589193 |
c121c948-66d2-4025-88fe-e95fceeb70cd | ishandutta2007/codeforces | siberian/normal/1726/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define pbc push_back
#define pob pop_back()
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define vin(a) for (auto& i : a) cin >> i
// mt19937 rnd(chrono::steady_clock::now().tim... | ALGO | 0.999511 | 4.288123 |
7e411e66-4d89-4f41-b5d4-b53c4c2fe0ce | fud200/Algorithm | p1504.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
vector<int> oneto(801);
vector < pair<int, int>> graph[801];
int min(int a, int b) {
return a < b ? a : b;
}
vector<int> check(int start, int end) {
vector<int> cost(end, 987654321);
cost[start] = 0;
int neighbor,distanceton;
priority_queu... | ALGO | 0.999949 | 3.939747 |
54b28951-014d-4dfc-9925-48cf5cf3162d | zomawia/Loops | Loops Excersices/Project2/Source.cpp | //Exercise 2:
//Using a for loop, iterate through numbers 0 to 100.
//- For multiples of 3 print Fizz
//- For multiples of 5 print Buzz
//- For multiples of 3 and 5 print FizzBuzz
//- Otherwise print the number.
//Note, you will need to use the modulus operator (%)
//Zomawia Sailo
//<EMAIL>
#include <iostream>
int m... | ALGO | 0.999378 | 4.20481 |
62527cee-2112-481f-a1f1-e05632e0bce2 | akshita2703/DSA | DivideAndConquer/daty2/printPermuatation.cpp | #include <iostream>
using namespace std;
void printPermutation(string &str , int i){
// base case
if(i>= str.length()){
cout<<str<<" ";
return ;
}
for(int j = i; j<str.length();j++){
swap(str[i],str[j]);
printPermutation(str , i+1);
swap(str[i],str[j]);
}
}... | ALGO | 0.99997 | 5.085258 |
6913ec66-6697-4401-95c7-55aa8bac24e7 | RisingOS-XTI/android_hardware_interfaces | broadcastradio/common/utils2x/Utils.cpp | #define LOG_TAG "BcRadioDef.utils"
#include <broadcastradio-utils-2x/Utils.h>
#include <android-base/logging.h>
namespace android {
namespace hardware {
namespace broadcastradio {
namespace utils {
using V2_0::IdentifierType;
using V2_0::Metadata;
using V2_0::MetadataKey;
using V2_0::ProgramFilter;
using V2_0::Prog... | TOOL | 0.857219 | 7.258409 |
94597cec-542e-472a-9221-aa040e44ae60 | meltedsoysouce/LearnCpp | Lesson9/Sample7-2/Sample7-2.cpp | #include <iostream>
using namespace std;
double avg(int* pT);
int main()
{
int test[5];
cout << "5人のテストの点数を入力してください。\n";
for (int i = 0; i < 5; i++)
cin >> test[i];
double ans = avg(test);
cout << "5人の平均点は" << ans << "です。\n";
}
double avg(int* pT)
{
double sum = 0;
for (int i = 0; i < 5; i++)
sum += *(... | ALGO | 0.992022 | 3.947351 |
4d40f960-ddd5-406b-995b-dab6aa1ada02 | florianvazelle/fenetrage-remplissage | src/FenetreSH.cpp | #include <iostream>
#include "FenetreSH.h"
// Methods test si intersection segment-droite
bool coupe(const Eigen::Vector2f &S, const Eigen::Vector2f &P, const Eigen::Vector2f &F, const Eigen::Vector2f &F1)
{
Eigen::Vector2f FF1 = {F1[0] - F[0], F1[1] - F[1]};
Eigen::Vector2f FS = {P[0] - F[0], P[1] - F[1]};
Eigen:... | ALGO | 0.979058 | 3.829833 |
060ef1ca-0d64-4c40-952d-1ea5c889b711 | Singhaditya3116/Data-Structures-and-Algorithms | 2.Recursion/mergesort.cpp | #include<bits/stdc++.h>
using namespace std;
void merge1(int A[],int si,int mid,int end)
{
int temp[end-si+1];
int i=si,j=mid+1,k=0;
while(i<=mid && j<=end)
{
if(A[i]<A[j])
{
temp[k]=A[i];
i++;
k++;
}
else
{
temp[k... | ALGO | 0.999993 | 4.377962 |
e05b47d7-6015-43d3-bdd3-d6e475214dfa | Yitao-LIN/Dynamical-simulation-of-tethered-net-capture-of-space-debris | CPP/Tether-net Deployment/main.cpp | #include<iostream>
#include<Eigen/Dense>
#include"Object.h"
#include"Runge_Kutta.h"
#include<math.h>
using namespace std;
using namespace Eigen;
int main() {
int num_col = 15;
int num_row = 15;
double tether_initial_length = 0.25;
double tether_stiffness = 12566.0;
double single_tether_mass = 0.000784;
double bu... | ALGO | 0.98566 | 3.544864 |
7281137b-8290-436d-8434-b071d8232e4a | AcuLuis/KattisProblemas | Skammstofun.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int n=0;
cin>>n;
if(n>100 || n<1) return 0;
string iniciales="";
for(int i=0; i<n; i++){
string word;
cin>> word;
if(word.size()<1 || word.size()>1000) return 0;
if(isupper(word[0])){
... | ALGO | 0.985126 | 4.563142 |
2f47d764-5fe9-4c78-aa8f-0244b030b2f9 | orionkishan/6Companies30days | Adobe/sumOfPowerOfNaturalNumbers.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:
long long numOfWays(int n, int x)
{
// code here
vector<int> sq;
for(int i=1;i<=n;i+=1)
{
... | ALGO | 0.999903 | 5.846625 |
4e7b5709-b6b0-4ff0-9c37-bc4da79562d1 | benfrancis314/AMATH_583 | final_from_cluster/eigenfaces_block.cpp | #include "amath583.hpp"
// Parallelize, optimize, and cache block me
auto gen_covariance(const std::vector<Vector>& z) {
size_t sz = z[0].num_rows();
Matrix C(sz, sz);
size_t largest_block = 32;
const int blocksize = std::min(sz, largest_block);
// Outer loop
size_t z_size = z.size();
size_t diff = s... | ALGO | 0.996774 | 4.049766 |
5b462c4b-7086-403d-8e62-5bf648ae5d7f | yash88990/GFG-Solution-CPP | Difficulty: Basic/Data Type/data-type.cpp | //{ Driver Code Starts
// Initial Template for C++
// {Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int dataTypeSize(string str) {
// your code here
if(str == "Character")... | ALGO | 0.884989 | 5.485143 |
2a141c1d-6909-4eae-a0d2-35263d834f81 | EdgarHovhann1syan/Hash-Map | hash_map.cpp | // hash_map.cpp
#include "hash_map.h"
#include <iostream>
HashMap::HashMap() :
m_totalNumberOfSlotsInHashTable(10),
m_numberOfItemsInHashTable(0),
m_loadFactor(0),
m_elems(m_totalNumberOfSlotsInHashTable, nullptr) {}
HashMap::HashMap(std::size_t totalNumberOfSlotsInHashTable) :
m_totalNumberOfSlot... | ALGO | 0.998771 | 6.535179 |
98e14d57-4f25-4fda-888d-4422fa643052 | coreqode/geometry_processing | deps/libigl/include/igl/rotate_vectors.cpp | #include "rotate_vectors.h"
IGL_INLINE Eigen::MatrixXd igl::rotate_vectors(
const Eigen::MatrixXd& V,
const Eigen::VectorXd& A,
const Eigen::MatrixXd& B1,
const Eigen::MatrixXd& B2)
{
Eigen::MatrixXd RV(V.rows(),V.cols());
for (unsigne... | ALGO | 0.999167 | 7.489518 |
ad0f42b2-194e-405d-8178-cc7d36dc7c8f | Mulab11/cntt2016-hw1 | TC-SRM-597-div1-250/wwt.cpp | #include <bits/stdc++.h>
using namespace std;
int ap[1000],bp[1000];
class LittleElephantAndString
{
public:
int getNumber(string A, string B)
{
for(auto p : A) ap[p] ++;
for(auto p : B) bp[p] ++;
for(char x = 'A';x <= 'Z';x ++)
if (ap[x] != bp[x]) return -1; //A和B出现的字符要相同
for(int i = B.length() - 1,j =... | ALGO | 0.999953 | 4.51752 |
ab333666-d1d3-4b5a-828b-1f03aae88000 | xiaoyezi1998902/c-test | 8209230330 陈颖欣/第二题.cpp | #include<iostream>
using namespace std;
#define P 3.14
int main() {
int r = 0;
cout << "Բİ뾶 " << endl;
cin >> r;
int h = 0;
cout << "Բĸ " << endl;
cin >> h;
cout << "ԲΪ " << (P * r * r * h) / 3 << endl;
system("pause");
return 0;
} | ALGO | 0.99884 | 3.294347 |
faf71037-e3f8-438a-811b-84008232fdb8 | infriend/infriend-homework | data_structure/数据结构课程设计.cpp | /*
【课程设计题目十二】
二叉排序树
【问题描述】
输入一个数列创建一棵二叉排序树T,对二叉排序树T按递增、递减两种序列输出,计算该
二叉排序树T的平均查找长度并输出,在二叉排序树T上删除指定结点,
并输出二叉排序树T中指定结点的平衡因子。
【基本要求】
1.输入一个数列L,生成一棵二叉排序树T finish
2.对二叉排序树T作递增、递减输出 finish
3. 计算二叉排序树T的平均查找长度,输出结果 finish
4.在二叉排序树T上删除指定结点 finish
5.输出二叉排序树T中指定结点的平衡因子 finish
6.写出课程设计报告
【测试数据】
分别对选定两组测试数据进行测试,验证程序的正确性。
*/
#includ... | ALGO | 0.999941 | 4.110044 |
61f39eb2-854a-4295-a4fb-8ab4d88d02ae | Abhik-Chakraborty/DSA | 2685-first-completely-painted-row-or-column/2685-first-completely-painted-row-or-column.cpp | class Solution {
public:
int firstCompleteIndex(vector<int>& arr, vector<vector<int>>& mat) {
int m = mat.size();
int n = mat[0].size();
unordered_map<int, pair<int, int>> posMap;
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
posMap[... | ALGO | 0.999987 | 6.12237 |
9136f8cb-0822-4ddc-a61a-035d628d6f3e | yzzupgo/MFTCG | Data/abc123_b/thetaKU/ac/4851178.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(signed i=0; i<n; i++)
#define FOR(i, k, n) for(signed i=k; i<n; i++)
#define yn(b) cout << ((b)?"Yes":"No") << endl
#define YN(b) cout << ((b)?"YES":"No") << endl
#define pr(r) cout << r << endl
#define min(x,y) (x<y)?x:y
#define ... | ALGO | 0.999868 | 3.612742 |
b9edbaee-e9e6-45f7-9b56-e601752ece8d | fearlessfollowing/titan | src/eigen-3.3.1/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = m * n;
cout << "-- Matrix m*n: --" << endl << result << endl << endl;
result = m.array() * ... | ALGO | 0.996064 | 4.306757 |
4f835f3f-fc72-4d6a-911b-a64c0c9946fb | nmf-wasi/Data-Structures | Module#16.5 [extras]/4.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
stack<int> Lia;
int input;
cin >> input;
for (int i = 0; i < input; i++)
{
int x;
cin >> x;
Lia.push(x);
}
int x;
cin >> x;
for (int i = 0; i < input - x; i++)
{
Lia.pop();
}
cout <... | ALGO | 0.999651 | 3.500168 |
44c6baea-cd17-41ef-8872-a1508c592ecf | 2019Shun/atcoder_submission | ABC/abc161/abc161_f_11538728.cpp | #include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#defi... | ALGO | 0.999855 | 3.724033 |
4ff377f6-bea0-4aec-8465-6746845422ae | zzm99/Algorithm-and-data-structure | Datastructure/数据结构练习题/二分查找/二叉树的最近公共祖先.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if(!root || ... | ALGO | 0.999983 | 6.175633 |
9a118389-18c9-46b0-9064-d0bc5545caf4 | wbl1997/mars_images_ba | include/eigen3/doc/examples/tut_arithmetic_matrix_mul.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d mat;
mat << 1, 2,
3, 4;
Vector2d u(-1,1), v(2,0);
std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
std::cout << "Here is mat*u:\n" << mat*u << std::endl;
std::cout << "Here is u^T*mat:\n" << u.transpo... | ALGO | 0.999583 | 3.818344 |
04171059-58a1-4b95-a64b-7adb6388aa9e | pcbsd/NextBSD | contrib/groff/src/libs/libgroff/prime.cpp | #include <math.h>
int is_prime(unsigned n)
{
if (n <= 3)
return 1;
if (!(n & 1))
return 0;
if (n % 3 == 0)
return 0;
unsigned lim = unsigned(sqrt((double)n));
unsigned d = 5;
for (;;) {
if (d > lim)
break;
if (n % d == 0)
return 0;
d += 2;
if (d > lim)
break;
... | ALGO | 0.999092 | 4.88718 |
81be582d-7d12-4a2e-a8c8-08abf65f893f | OmarHisham99/New_LeetCode | problems/same_tree/solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999955 | 6.546574 |
23ce0cf8-b0d3-412d-8144-661aa6d565e7 | AmitPandey31/CP | CodeChef/2023/APRIL/12th/Inside The Stadium.cpp | #include <iostream>
using namespace std;
void solve(){
int n;
cin>>n;
int arr[n];
for(int i = 0; i < n; i++){
cin>>arr[i];
}
float runs = 0, ans = 0;
for(int i = 0; i < n; i++){
runs += arr[i];
float balls = i + 1;
float sr = (runs/balls)*100;
if(sr == 100){
ans++;
}
}
cout<<ans<<endl;
... | ALGO | 0.999669 | 4.478106 |
5ff4fd7a-1398-4107-b58f-3c0235cf4384 | Arnav2300/leetcode_problems | 60-permutation-sequence/60-permutation-sequence.cpp | class Solution {
public:
string getPermutation(int n, int k) {
ios_base::sync_with_stdio(0);
cin.tie(0);
int fact=1;
vector<int>numbers;
for(int i=1;i<n;i++){
fact=fact*i;
numbers.push_back(i);
}
numbers.push_back(n);
string s="... | ALGO | 0.999991 | 6.333705 |
811301a5-436e-4357-b3ae-9c7eb6446417 | ishandutta2007/codeforces | romawhite/normal/513/D1.cpp |
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:128777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cst... | ALGO | 0.999993 | 3.34893 |
68c44a1e-92bd-4a3a-80c9-6932d13dec9f | Johniel/contests | atcoder/arc063/D/main.cpp | #include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template<typename P, typename Q>
ostream& operator << (ostream& os, pair<P, Q> p)
{
os << "(" << p.first <<... | ALGO | 0.999765 | 3.977823 |
d471b1e0-f14d-4602-b757-eae252194dde | CAPTAINRAJ19/Codeforces-Codes | longjumps.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define mod 1000000007
#define vecinput(v1, n) for(int i=0; i<n; i++) {int x; cin >> x; v1.push_back(x);}//will have to define v1 before this statement
#define arrinput(arr, n) for(int i=0; i<n; i++) {cin >>arr[i];}//will have to define arr before this ... | ALGO | 0.999764 | 3.909531 |
2a3c6b8e-3ccd-4ef7-a9dd-dc182611be2a | fatemehkarimi/codeforces-solutions | codeforces-contest-987-A.cpp | //http://codeforces.com/contest/987/problem/A
//Infinity Gauntlet
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main(void)
{
int n = 0;
map <string , string> Map;
Map["purple"] = "Power";
Map["green"] = "Time";
Map["blue"] = "Space";
Map["orange"] = "Soul";
Map["red"] = "Realit... | ALGO | 0.991395 | 3.708717 |
43258728-2833-4d4d-a322-1850a1e5f642 | JayaRaghaCharan/DSA_basics | LinkedList/linked_list_basics.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int data;
Node* next;
Node()
{
data = -1;
next = NULL;
}
Node(int data)
{
this->data = data;
this->next = NULL;
}
Node(int data, N... | ALGO | 0.99891 | 4.528552 |
418f2736-3939-4ba7-895e-80e6602a1fd7 | Uday-Mi/Interview-Bit | Programming Interview Bit/Arrays/AddOneToNumber.cpp | /*
Given a non-negative number represented as an array of digits, add 1 to the number ( increment the number represented by the digits ).
The digits are stored such that the most significant digit is at the head of the list.
NOTE: Certain things are intentionally left unclear in this question which you should practic... | ALGO | 0.999823 | 6.057418 |
a9a6870c-bfc4-44d8-9d3c-c3e6d863a508 | Prototanium/Pr | src/pubkey.cpp | #include "pubkey.h"
#include "eccryptoverify.h"
#ifdef USE_SECP256K1
#include <secp256k1.h>
#else
#include "ecwrapper.h"
#endif
bool CPubKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchSig) const {
if (!IsValid())
return false;
#ifdef USE_SECP256K1
if (secp256k1_ecdsa_verify((co... | TOOL | 0.854231 | 6.378423 |
c5070129-264b-4188-9432-d59505ba5e47 | NataliaN24/Data-Structures-and-Algorithms-2023-2024 | 12.Minimal Spanning Tree/Solutionhw39.cpp | #include <iostream>
#include <vector>
#include <algorithm>
struct Road {
size_t start, end;
long long cost;
bool operator<(const Road &other) const {
return this->start < other.start || (this->start == other.start && this->cost > other.cost);
}
};
const size_t MAX_NODES = 2 * 1e5 + 5;
std::ve... | ALGO | 0.999708 | 4.924111 |
0de1fc28-83b6-4206-bd80-9c6c75150766 | Vinayak-palya/DSA | pointer/pointerarithemetic4.cpp | #include<iostream>
using namespace std;
int main(){
int arr[2] = {7,5};
int *ptr = &arr[0];
cout<<*++ptr<<"\n";
cout<<arr[0]<<" "<<arr[1];
return 0;
} | ALGO | 0.992781 | 3.56247 |
286c3ba8-8c83-414a-98aa-b451c081453d | nextgensultan/CP-Codeforces | 1780_B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <list>
#include <queue>
#include <sstream>
#include <bitset>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
using name... | ALGO | 0.999779 | 3.899376 |
39792994-6311-4813-85e0-0905108b6885 | kmoilane/pre-studies | learncpp/ex1.3/main.cpp | #include <iostream>
char getOperator();
void printResult(int ans)
{
std::cout << ans << '\n';
}
int calculate(int a, int b, char c)
{
switch (c)
{
case '+':
return(a + b);
case '-':
return(a - b);
case '*':
return(a * b);
case '/':
... | ALGO | 0.969828 | 4.525426 |
78e3877f-f8bb-43d8-9284-5702c4dacfad | lubabahasan/Online-Judge-Problems | Codeforces/1001-2000/1873A.cpp | #include<iostream>
using namespace std;
int main()
{
int t;
cin>>t;
string og="abc", input,s1,s2,s3;
while(t--){
cin>>input;
if(input=="bca" || input=="cab")
cout<<"NO"<<'\n';
else
cout<<"YES"<<'\n';
}
return 0;
} | ALGO | 0.999686 | 3.885395 |
ef138960-168b-48bc-843d-80e37d19f845 | ishandutta2007/codeforces | sdya/normal/333/B.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <ctime>
#pragma comment (linker, "/STACK:256000000")
using namespace std;
int main() {
//freopen("input.txt", "r... | ALGO | 0.999886 | 3.439655 |
044cbe33-43d2-4814-bd2f-c305a18531ec | nulyaka/algorithms | sort-radix.cpp | #include <iostream>
#include <vector>
#include <math.h>
struct NodeBin {
int data;
NodeBin *next;
};
int findMax (std::vector<int> &myArray) {
int max = INT_MIN;
for (int i(0); i < myArray.size(); ++i) {
if (max < myArray.at(i)) { max = myArray.at(i); }
}
r... | ALGO | 0.999728 | 5.844858 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.