uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c406b94f-7e1b-4145-b637-54764d2d2b92 | GoGradually/PS-Saved-Repository | Edu #128/1680A.cpp | #include <bits/stdc++.h>
#define ll long long
#define INF (int)1e9 + 10
#define lINF (ll)1e18 + 10LL
const ll MOD = 1000000007LL;
// #include <atcoder/modint.hpp>
// using mint = atcoder::modint998244353;
using namespace std;
void Solve() {
int l1, l2, r1, r2;
cin >> l1 >> r1 >> l2 >> r2;
if (l1 <= l2 && ... | ALGO | 0.999819 | 3.767911 |
6c67e38d-1356-4ba0-a55e-aa69e33f1dfc | ishandutta2007/codeforces | s2speed/normal/1634/F.cpp | #include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("Ofast")
#define all(x) x.begin() , x.end()
#define sze(x) (ll)(x.size())
#define mp(x , y) make_pair(x , y)
#define wall cerr<<"--------------------------------------"<<endl
typedef long long int ll;
typedef pair<ll , ll> pll;
typedef pair<int , int... | ALGO | 0.999963 | 4.070517 |
ed9f9bcd-9396-4e69-a9a3-d5e333c60a30 | Shell-Wataru/AtCoder | Codeforces/CGR21/G.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <numeric>
using namespace std;
using ll = long long;
// https://ei1333.github.io/luzhiled/snippets/structure/segment-tree.html
// を元にfunctionを使わないように改... | ALGO | 0.999982 | 5.182024 |
33106a8a-6d06-48dc-9c23-a4b5e6ff3fad | divyanshi23/CB-Algo | Recursion/RemoveDuplicates.cpp | /*Take as input S, a string. Write a function that removes all consecutive duplicates. Print the value returned.
Input Format
String
Constraints
A string of length between 1 to 1000
Output Format
String
Sample Input
aabccba
Sample Output
abcba
Explanation
For the given example, "aabccba", Consecutive Occurrence of ... | ALGO | 0.999986 | 5.395145 |
e55e2ccf-4016-4c2a-8ec1-c7063c1cd71c | freerunner/platform_external_skia | src/gpu/GrPathUtils.cpp | #include "GrPathUtils.h"
#include "GrPoint.h"
#include "SkGeometry.h"
GrScalar GrPathUtils::scaleToleranceToSrc(GrScalar devTol,
const GrMatrix& viewM,
const GrRect& pathBounds) {
// In order to tesselate the path we get a bound on... | ALGO | 0.988065 | 5.769855 |
4e561c7d-c259-45a4-b13c-2b3018567eb2 | NohYeongHun/Cpp-Study | CPP_Study/CPP_Study/set.cpp | #include <iostream>
using namespace std;
#include <set>
// : set
int main()
{
// Key ʿѰ
set<int> s;
s.insert(10);
s.insert(30);
s.insert(50);
s.insert(70);
s.insert(90);
//
s.erase(10);
// ã;
set<int>::iterator findIt = s.find(50);
if (findIt == s.end())
{
cout << " ã" << endl;
}
else
{
cou... | TOOL | 0.90258 | 3.799881 |
bc910030-f018-4323-ae75-2f642eff0391 | areshta/cpp-edu | zArchive/misc/someCppQt/cpp_lambda/lambda.cpp | // Example of using c++11 lambda (by Oleksii Reshta)
// Sorting vector of strings by size
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
using VS = vector<string>;
void out(const string& title, const VS& vs)
{
cout << "\n=== " << title << " ===" << endl;
for (aut... | ALGO | 0.999196 | 5.791843 |
c519587d-67fa-4dda-9d1e-25dbe319eb02 | adarshak07/DSA- | check if word is valid.cpp | class Solution {
public:
bool isValid(string s) {
stack<char>st;
for(int i=0;i<s.length();i++){
if(s[i]=='a'){
st.push(s[i]);
}else if(s[i]=='b'){
if(!st.empty() && st.top()=='a'){
st.push(s[i]);
}else{
... | ALGO | 0.999795 | 5.867003 |
3bd1a4fc-fb98-4c3f-bf11-a140bf19c440 | kircodeengineer/Transport-Catalogue | source/transport_router.cpp | #include "transport_router.h"
#include "router.h"
#include <stdexcept>
namespace items {
Bus::Bus(std::string_view bus, int span_count, double time) : bus_(bus), span_count_(span_count), time_(time) {}
Wait::Wait(std::string_view stop_name, double time) : stop_name_(stop_name), time_(time) {}
}
Item::Item()
: valu... | ALGO | 0.96434 | 5.538047 |
043bc1c2-c48a-48fc-9642-052f23d1f8b5 | kanishk123agarwal/DSA | array/2DArray_mid.cpp | #include<bits/stdc++.h>
using namespace std;
https://leetcode.com/problems/spiral-matrix/description/
54: Spiral Matrix
class Solution {
// Most important question
// print a spiral matrix
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
int m=matrix.size();
int n=matrix[0].... | ALGO | 0.999956 | 5.886189 |
86100251-0178-4b07-98bb-2f404d3d7f63 | sujeetvarshney/cppcompetitive | recur4.cpp | #include<iostream>
using namespace std;
int power(int n,int p)
{
if(p==0) //base condition where recursion should stop
return 1;
else
{
return n*power(n,p-1);
}
}
int main()
{
int n,p;
cout<<"\nEnter n";
cin>>n;
cout<<"\nEnter p";
cin>>p;
cout<<n<<" raise to the power "<<p<<" is "<<power(n,p)... | ALGO | 0.99929 | 4.904337 |
5b3f6da6-ed59-476d-8eec-0712be3c10a6 | sjr-kr/crefle-apriltag-cpp | src/camera_calibration.cpp | #include "camera_calibration.hpp"
#include <iostream>
void capture_calibration_images(int camera_index, int num_corners_x, int num_corners_y, float square_size) {
cv::VideoCapture cap(camera_index);
if (!cap.isOpened()) {
std::cerr << "Error: Could not open camera." << std::endl;
return;
}
... | TOOL | 0.851056 | 5.824474 |
143ffbe2-619d-4b77-8cc2-2bf6bb2bbacd | Nikhilthehokage/450 | 388.cpp | int max(int a,int b,int c){
return a>b?(a>c?a:c):(b>c?b:c);
}
int max1(int a, int b){
return a>b?a:b;
}
int DP[51][51];
int solve(int n, int m , vector<vector<int>> &M,int i, int j){
if(i>=n || i<0 || j>=m ||j<0){
return 0;
}
if(DP[i][j]!=-1){
... | ALGO | 0.999733 | 4.67661 |
d1f78c33-9a55-4159-9235-704b4cd47184 | tanvgen/gfg_solutions | Difficulty: Medium/Painting the Fence/painting-the-fence.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
#include<stdio.h>
#include<math.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int mod = 1e9+7;
long long countWays(int n, int k){
// code here
vector<long long> dp(n+1,0);
long long m=k;
dp[1]=m%mod;
... | ALGO | 0.999972 | 5.712839 |
9c5257d6-f403-4e10-8c68-109bfad758db | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8/ACMonster/8294486_5681755159789568_ACMonster.cpp | //Problem C
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
using namespace std;
int get() {
char c;
while (c = getchar(), c != '-' && (c < '0' || c > '9'));
bool flag = (c == '-');
if (flag)
c = getchar();
int x = 0;
... | ALGO | 0.999823 | 3.832689 |
d6e126e1-7fe1-4a3a-a651-1d312f09bb74 | littlesun12138/CUDA-accelarator | Project/project/third_party/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp | MatrixXd X = MatrixXd::Random(5,5);
MatrixXd A = X + X.transpose();
cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl;
SelfAdjointEigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << ... | ALGO | 0.999731 | 3.056724 |
2d04d971-114d-496d-873d-4f5b6d32d4d9 | swingld/ceph-14.2.8 | src/boost/libs/graph/test/mcgregor_subgraphs_test.cpp | #include <cmath>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <boost/lexical_cast.hpp>
#include <boost/random.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/filtered_graph.hpp>
#include <boost/graph/graphviz.hpp>
#include <boost/graph/isomorphism.hpp>
#incl... | TEST | 0.938237 | 6.522034 |
ab2b538a-0745-468f-99b7-ec1f72b90f27 | ishandutta2007/codeforces | elegia/normal/1364/B.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>
#include <algorithm>
#include <random>
#include <bitset>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <limits>
#include <n... | ALGO | 0.999824 | 3.860095 |
b5d9f364-45f7-4d3b-838c-59d698810473 | Abdul6498/datastructure-and-algorithms | week3_greedy_algorithms/2_maximum_value_of_the_loot/fractional_knapsack.cpp | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
using std::vector;
double get_optimal_value_naive(int capacity, vector<int> weights, vector<int> values) {
double value = 0.0;
// write your code here
if (capacity == 0 || weights.size() == 0){
return 0;... | ALGO | 0.99992 | 4.962821 |
cb0fbc23-3b8c-46f3-bd26-cb3d14caaa3d | GAINS-ASEN23/Ground-Software | boost/libs/math/example/root_finding_fifth.cpp | // root_finding_fith.cpp
// Example of finding fifth root using Newton-Raphson, Halley, Schroder, TOMS748 .
// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
// To get (copious!) diagnostic output, add make this define here or elsewhe... | ALGO | 0.999866 | 5.494011 |
9cbbe227-71b7-4576-acf2-1f90d30b6dbf | EloiLemaire/learn-advanced-cpp | 72_fractal_creator/src/72_fractal_creator.cpp | #include <iostream>
#include "Bitmap.h"
#include "Mandelbrot.h"
using namespace std;
using namespace ele;
int main() {
int const WIDTH = 800;
int const HEIGHT = 600;
Bitmap bitmap(WIDTH, HEIGHT);
bitmap.setPixel(WIDTH / 2, HEIGHT / 2, 255, 255, 255);
int min = 999999;
int max = -999999;
unique_ptr<int[]> hist... | ALGO | 0.967321 | 5.231638 |
1a2cd0ef-7eac-422b-b238-fc49af9898d3 | LouisDo2108/HCMUS_APCS_CS162 | W01+H01/Assignment 03/19125106_Ex03.cpp | #include <iostream>
#include <fstream>
#include <string>
#include "Header.h"
using namespace std;
int main()
{
ofstream fo;
ifstream fi;
int n;
double result[100];
Oxy oxy[100];
char inputfilename[10] = "input.txt";
char outputfilename[20] = "output.txt";
input_oxy(fi, oxy, inputfilename, n);
sort_oxy(oxy, ... | ALGO | 0.98147 | 3.825624 |
fc194490-7d55-45e7-b2bf-88099df7ec46 | mnishiguchi/cpp_notebook | cs1/at_mark_pyramid/at_mark_pyramid/main.cpp | #include <iostream>
using namespace std;
int main() {
double outerCount, innerCount;
cout << "Enter the number of the rows: ";
cin >> outerCount;
cout << endl;
outerCount = 1;
while (outerCount <= 11) {
// Print spaces
innerCount = 1;
while (inner... | ALGO | 0.992164 | 5.35709 |
c398c826-7f51-4d19-862e-a8885f05cb93 | Modernbeast02/SoftwareEngineeringLab | Lab2/Directory.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
class directory
{
public:
unordered_map<string, vector<string>> numbers;
void setdata(string phone, string name)
{
if (numbers.find(name) == numbers.end())
{
numbers[name].push_back(phone);... | ALGO | 0.997763 | 5.316041 |
5a7a5cc0-8bc0-4a1b-983e-c5773e2514e3 | nayanex/Data-Structures-Coursera | Assignments/week2_priority_queues_and_disjoint_sets/3_merging_tables/merging_tables.cpp | #include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::max;
using std::vector;
struct DisjointSetsElement {
int size, parent, rank;
DisjointSetsElement(int size = 0, int parent = -1, int rank = 0):
size(size... | ALGO | 0.999788 | 4.414168 |
53d57417-7fd2-446f-90ec-31732263d3aa | talented-adverb/DSA-Data_Structures_and_Algorithms- | BinaryTree/BSTPred.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* left;
node *right;
node(int val){
data=val;
left=NULL;
right=NULL;
}
};
class BST{
public:
node *TreeMax(node *x){
while(x->right!=NULL){
x=x->right;
... | ALGO | 0.999988 | 4.045876 |
4d9e04fa-eeee-47e4-b797-6d5ddab555a0 | lz520520/rust-1.75-ollvm | src/llvm-project/llvm/lib/CodeGen/MachineDominators.cpp | #include "llvm/CodeGen/MachineDominators.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/PassRegistry.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
namespace llvm {
// Always verify dominfo if expensive ... | ALGO | 0.999057 | 7.742328 |
a8287ae3-7d02-449a-a6b7-956bd2573a16 | abhiraftaar007/Data-Structures-Algorithms | strings/TwoStringsClose.cpp | #include<bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/determine-if-two-strings-are-close/?envType=study-plan-v2&envId=leetcode-75
bool closeStrings(string word1, string word2)
{
// If lengths are different, the words can't be close
if (word1.length() != word2.length())
return f... | ALGO | 0.999994 | 5.698737 |
1bb97a4b-1545-4068-8bc9-15369d51f02b | pranavsindura/CompetitiveProgramming | codeforces/B/810b.cpp | #include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define mod 1000000007
#define eps 0.000000001
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define vi vector<i... | ALGO | 0.999913 | 3.006126 |
9b2953f1-f590-4b30-a197-b5cb7e22342c | AtharIbrahim/Image-BG-Remover-App | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
47ea609e-847e-4c17-9d35-4642361f027a | YadavDhirendra/Data-Structures-and-ALgorithms-Problems | program62.cpp | //Minimize and maximize between the diffrence of heights.
/*Given an array a[] denoting heights of N towers and a positive integer K.
For each tower, you must perform exactly one of the following operations exactly once.
->Increase the height of tower by K
->Decrease the height of tower by K(you can perform this opera... | ALGO | 0.999815 | 4.463295 |
253498fb-81f6-4a93-ad32-7be299cdf7f5 | ricejasonf/heavy-compiler | libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp | // <algorithm>
// template<ForwardIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
// constexpr OutIter // constexpr after C++17
// rotate_copy(InIter first, InIter middle, InIter last, OutIter result);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iter... | TEST | 0.983862 | 7.229033 |
611927be-c541-4c0f-beb1-c3181a5f0f83 | shahrohit/Interview_DS_Algo | BitManupulation/Add_Binary.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* ------------------------------------ Introducion ------------------------------------
* Title : Add Binary
* Leetcode No : 67
* Difficulty : Easy
* Topic : String, Bit Manupulation
* Link : https://leetcode.com/problems/add-binary/description/
*
*/
/**
* ---... | ALGO | 0.999942 | 6.643031 |
4239e2f1-d09b-48dc-a0bb-a73b7d6762ec | chengluxi1818/program-practising | Delete Node in a Linked List - C++/src/Delete Node in a Linked List - C++.cpp | /*
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.
Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, the linked list should become 1 -> 2 -> 4 after calling your function.
*/
#include <iostream>
using namespace std;... | ALGO | 0.971724 | 5.983439 |
da3f65fb-0f55-4246-84a2-d382b3e3c891 | Andy-Lv/Cpp-Learning | C++Things/2 Practice/重点/09-类模板之栈.cpp | //
// Created by andy on 2021/7/4.
//
#include <iostream>
using namespace std;
template<typename T,int MAXSIZE>
class Stack{
public:
Stack(){};
void init()
{
top=-1;
}
bool isFull()
{
if (top>=MAXSIZE-1)
return true;
else
return false;
}
... | ALGO | 0.990035 | 4.40133 |
744ed266-776b-46ca-8de3-92c61cf25d91 | Jianyi2004/Algorithms_problems | algorithms_contest_book/2基本数据结构/acw134_双端队列.cpp | #include<iostream>
#include<algorithm>
using namespace std;
const int N =2e5+10;
typedef pair<int,int>PII;
PII a[N];
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i].first;
a[i].second=i;
}
sort(a,a+n);
int last=-0x3f3f3f3f;
int dir=-1,cnt=0;
for(int i=0;i... | ALGO | 0.999933 | 3.749325 |
a200d85c-5501-4f8f-b9d2-3b2705c0c57c | PBBx0/CSES | mathematics/25 Inversion Probability.cpp | #include <bits/stdc++.h>
#define sz(n) (int)(n).size()
#define dbg(x) cerr << #x << " = " << x << '\n';
using namespace std;
using ll = int64_t;
using ld = long double;
const int N = 101;
ld dp[N];
const ld ONE = 1.;
void solve() {
int n;
cin >> n;
vector<ld> r(n);
for (ld & el : r) cin >> el;
ld r... | ALGO | 0.999587 | 3.993993 |
8ec019b1-de74-4828-adac-c4d2a34d8b58 | haowanwuyifan/data_structure_and_algorithm | 动态规划/luogu1681.cpp | /*------------------------------------------------------------------------------
* @file LUOGU1681.CPP
* @author FIRMWARE TEAM
* @date 2024/02/12 11:09:47
* @brief THIS FILE PROVIDES ALL THE FIRMWARE FUNCTIONS.
* -----------------------------------------------------------------------------
/* Define to ... | ALGO | 0.99996 | 4.175343 |
50fcb05b-33ca-4573-bcec-f7500636daf9 | Ankit75124/Leetcode | Daily-Challenge/290. Word Pattern/0101-solution.cpp | class Solution {
public:
bool wordPattern(string pattern, string s)
{
map<char, string>chToWordMap;
map<string, char>wordToChMap;
s.push_back(' ');
string currWord = "";
int chIdx = 0;
//============================================================================... | ALGO | 0.999728 | 6.225964 |
48e38c11-d2f7-4181-bbed-124498159104 | MrArthor/CPP | C++/camelcase-matching.cpp | // Time: O(n * l), n is number of quries
// , l is length of query
// Space: O(1)
class Solution {
public:
vector<bool> camelMatch(vector<string>& queries, string pattern) {
vector<bool> result;
for (const auto& query : queries) {
result.emplace_back(is_matched(query, pa... | ALGO | 0.999032 | 6.463116 |
81f9506d-2351-4dd7-9681-c9fc9f84229a | aleafall/DS-A | leetcode/lc0386.cpp | //
// Created by aleafall on 17-9-27.
//
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<int> lexicalOrder(int n) {
vector<int> ans(n);
for (int i = 0; i < n; ++i) {
ans[i] = i + 1;
}
sort(ans.begin(), ans.end(),[](int a,int b){
return to... | ALGO | 0.999785 | 6.180401 |
afbda00f-3ec7-4111-9f45-679cd623e934 | Vaalla42/CN | 6tema/rare.cpp | #include <vector>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <limits>
using namespace std;
template <class T>
struct Element {
size_t pos;
T value;
};
template <class T>
class Matrix {
typedef vector<Element<T> > Row;
typedef vector<Row> Mat;
typedef Element<T> element;
... | ALGO | 0.995738 | 3.42511 |
aef5cfc6-d5c0-42ac-86cc-a536f3e123a6 | osama-ibrahim72/DATA-STRUCTURE-Course-Assignments | Assignment 2/problem (11)/main.cpp | /*
Name: Lilian Astfanous Younan ID : 20200404 Lab :15-16
Name : Osama Ibrahim Marzok ID : 20200069 lab : 25-26
Name : Joeshwoa George Abo Hager Melek ID : 20200131 Lab : 25-26
Name: Mostafa Mohamed Ali ID : 20200544 Lab : 13
Name :abdalla emad abdelhamid ... | ALGO | 0.999743 | 4.36861 |
d2dea463-fb4b-42bf-8c23-c0b8b578b959 | alex-narrator/xp-dev_xray | 3rd party/MagicSoftware/FreeMagic/Source/Distance3D/MgcDist3DVecRct.cpp | #include "MgcDist3DVecRct.h"
using namespace Mgc;
//----------------------------------------------------------------------------
Real Mgc::SqrDistance (const Vector3& rkPoint, const Rectangle3& rkRct,
Real* pfSParam, Real* pfTParam)
{
Vector3 kDiff = rkRct.Origin() - rkPoint;
Real fA00 = rkRct.Edge0().Squa... | ALGO | 0.996955 | 4.341398 |
1c6aebea-84ea-4bcb-b1d1-dd38aac4d313 | monman53/online_judge | AtCoder/ABC/023/a.cpp | // header {{{
// #define NDEBUG
#include <bits/stdc++.h>
using namespace std;
// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define ALPHABET (26)
#define INF INT_MAX
#define MOD (1000000007LL)
#define EPS (1e-10)
#define EQ(a, b) (abs((a)-(b)) < EPS)
#define CILING(a, b) (((a)+(b)-1)/(b))
temp... | ALGO | 0.998038 | 3.913509 |
f237f4a6-7ad8-4982-9b69-a06a000d478e | mandsrossi/devc | eX2.cpp | #include <iostream>
using namespace std;
float nota1, nota2, nota3, media;
int main ()
{
cout<<"Nota 1: ";
cin>>nota1;
cout<<"Nota 2: ";
cin>>nota2;
cout<<"Nota 3: ";
cin>>nota3;
media=(nota1+nota2+nota3)/3;
cout<<"\nMedia= "<<media;
if (media<4)
cout<<"\nREPROVADO";
else if (media<6)
cout<<"\nEXAME... | TOOL | 0.856808 | 3.661061 |
774e9dd0-305d-4dd1-8ad5-30ddea348e5f | dvaitam/codeforces | 0-999/700-799/750-759/754/solD.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
using namespace std;
typedef long long ll;
int getint(){
int x=0,f=1; char ch=getchar();
while(ch>'9'||ch<'0') {if(ch=='-')f=-1;ch=getchar();}
while(ch<='9'&&ch>='0') {x=x*10+ch-'0';ch=getchar();}
return f*x;
}... | ALGO | 0.999978 | 3.201821 |
ca2244dc-e84f-4091-b7d7-872ce75ea76d | protonplus-org/frameworks_av | media/codecs/amrnb/enc/src/c1035pf.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/c1035pf.c
Functions: q_p
build_code
code_10i40_35bits
Date: 09/28/2000
------------------------------------------------------------------------------
REVISION HISTORY
De... | ALGO | 0.999908 | 5.906797 |
9db7d461-20b9-4616-aaec-85e2372fd2a5 | WindBlowAssCold/ollvm | libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
// <algorithm>
// template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
// weakly_incrementable O, class Comp = ranges::less,
// class Proj1 = identity, class Proj2 = identit... | TEST | 0.934288 | 7.575808 |
a9d3e19d-53b3-4f59-b3bd-0ffd14349c4a | siddharth905/DSA_Problem_Solving | Leetcode Problems/451. Sort Characters By Frequency.cpp | class Solution {
public:
string frequencySort(string s) {
map<char,int> counter;
for(int i=0;i<s.size();i++){
counter[s[i]]++;
}
priority_queue<pair<int,char>> pq;
for(auto it=counter.begin(); it != counter.end(); it++){
pq.push({it->second,it->first})... | ALGO | 0.999967 | 5.960452 |
6cc048c9-a7d1-4a61-96aa-9ece9d0844f4 | ishandutta2007/codeforces | ytkn/normal/1379/F1.cpp | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cmath>
#include <numeric>
#include <functional>
#include <cassert>
#include <algorithm>
#include <cassert>
#include <vector>
#ifdef _MSC_VER
#include... | ALGO | 0.999953 | 4.107382 |
05fb6ed5-a0a0-4f88-bb47-97cb3b1e59bd | RaxoTheOne/tictactoe_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998756 | 6.772262 |
48500954-0a24-4205-b1b9-bd3345ef4ec8 | daiwenbo/leetcode | 328.OddEvenLinkedList.cpp | /*Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.
You should try to do it in place. The program should run in O(1) space complexity and O(nodes) time complexity.
Example:
Given 1->2->3->4->5->NUL... | ALGO | 0.999989 | 5.542731 |
cfa68f2f-93d8-44a0-97a9-c956964cd800 | ar0per0/Marlin_Kingroon_KP3S | Marlin/src/lcd/fontutils.cpp | /**
* @file fontutils.cpp
* @brief help functions for font and char
* @author Yunhui Fu (<EMAIL>)
* @version 1.0
* @date 2016-08-19
* @copyright GPL/BSD
*/
#include "../inc/MarlinConfig.h"
#if HAS_WIRED_LCD
#include "marlinui.h"
#include "../MarlinCore.h"
#endif
#include "fontutils.h"
uint8_t re... | TOOL | 0.902232 | 5.716172 |
0948702c-0035-415f-bbf2-7433c0803e07 | codulluiandrei/pbinfo | pbinfo-4558/main.cpp | #include <iostream>
using namespace std;
int main()
{
int n,e=1,c=1,d=1;
cin>>n;
while(n>9)
{
if(n%10==n/10%10) { c=0; d=0; }
else if(n%10>n/10%10) { e=0; d=0; }
else { e=0; c=0; }
n=n/10;
}
if(e==1) cout<<"egale";
else if(c==1) cout<<"strict crescatoare";
... | ALGO | 0.999964 | 3.636101 |
d9841c88-3dfe-4de8-aab0-cf7f9e3b8633 | nourrrhan/Automata-Implementation | first_machine/first_machine/first_machine.cpp | #include <iostream>
#include <string>
using namespace std;
int state0(char current_alphabet)
{
string transition_table[3][3] = { " ", "state 0", "state 1",
"0", "state 0", "state 0",
"1", "state 1", "state 1" };
if (current_alphabet ==... | ALGO | 0.999273 | 4.894115 |
02abf27d-dcfd-4b54-97d7-3b29e0aacfac | pkduy17279/DataStructures-Algorithms | pttt/cvahn_doanconm.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 2e4 + 25, INF = 1e15 + 25;
int a[N], n, res = -INF, sum[N];
void Read()
{
cin >> n;
for(int i = 1; i <= n; i++)
{
cin >> a[i];
a[i + n] = a[i];
}
}
void Solve()
{
for(int i = 1; i <= 2 * n; i++)
... | ALGO | 0.999536 | 4.001702 |
a5c46aac-39c0-4a6c-9a9f-f1d55a847a63 | KamaruzzamanFahad/Super-Problem-Solvers-Zone | Week-2/A_Almost_Prime.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = 3000;
vector<int> allprimes;
void sieve()
{
vector<bool> prime(maxN + 1, true);
for (int i = 2; i * i <= maxN; i++)
{
if (prime[i])
{
for (int j = i + i; j <= maxN; j += i)
{
prime[j] = ... | ALGO | 0.999685 | 5.333448 |
c167a360-317f-4d50-b8bb-291af298f8d5 | weg0818/PIC-code | gbc-master/2d/extra/libs/eigen/doc/examples/Tutorial_BlockOperations_colrow.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(3,3);
m << 1,2,3,
4,5,6,
7,8,9;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "2nd Row: " << m.row(1) << endl;
m.col(2) += 3 * m.col(0);
cout << "After adding 3 times the first colu... | ALGO | 0.990321 | 3.576145 |
8ffde5ae-7e02-403b-8d6b-bfbca76ef161 | lx3389/BindImage | ImageOptimize.cpp | // ImageOptimize.cpp : ʵļ
//
#include "stdafx.h"
#include "BindImage.h"
#include "ImageOptimize.h"
#include ".\imageoptimize.h"
#include "optipng/optipng.h"
#include <vector>
using namespace std;
// CImageOptimize Ի
IMPLEMENT_DYNAMIC(CImageOptimize, CDialog)
CImageOptimize::CImageOptimize(CWnd* pParent /*=NULL*/)
: ... | TOOL | 0.968524 | 3.18956 |
e1c24b4c-ff2f-44f7-931a-2541abd4aa67 | naschwertner/flutter_exemplo_expense_tracker | 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.9988 | 6.76073 |
6c9a59ba-9798-469c-81c8-f7d98569c2c3 | sarvex/leetcode-powershell | solution/2300-2399/2379.Minimum Recolors to Get K Consecutive Black Blocks/Solution.cpp | class Solution {
public:
int minimumRecolors(string blocks, int k) {
int cnt = count(blocks.begin(), blocks.begin() + k, 'W');
int ans = cnt;
for (int i = k; i < blocks.size(); ++i) {
cnt += blocks[i] == 'W';
cnt -= blocks[i - k] == 'W';
ans = min(ans, cnt... | ALGO | 0.999896 | 5.575593 |
d1200265-6422-4eac-aa16-71d5268c11c9 | Ahnaf-41M/Codeforces_AtCoder | codeforces/499/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s1,s2;
map<string,string> mp;
int n,m;
cin>>n>>m;
while(m--)
{
cin>>s1>>s2;
mp[s1] = s2;
}
while(n--)
{
cin>>s1;
s2 = mp[s1];
if(s1.size()>s2.size())
... | ALGO | 0.999954 | 3.93924 |
25c41c51-0ca9-4bb1-91f2-4d59b9adb5e2 | priyanshug01/Cpp-Programs | Basics/Vowels.cpp | #include<iostream>
using namespace std;
int main()
{
char alpha;
cout<<"Enter a Character: ";
cin>>alpha;
switch(alpha)
{
case 'a':
cout<<"Vowel";
break;
case 'e':
cout<<"Vowel";
break;
case 'i':
cout<<"Vowel";
break;
case 'o':
cout<<"Vowel";
break;
case 'u':
cout<<"Vowel";
... | ALGO | 0.99811 | 3.271421 |
806e3123-2c4c-4bad-a5b2-6a8c7ece5ae7 | shiftedchaos/sem4 | 2nd task/task1.cpp | #include <iostream>
#include <vector>
#include <random>
using namespace std;
int main()
{
default_random_engine gen; //генератор случайных чисел
//равномерное распределение от 0 до 10.0
uniform_real_distribution<double> dist(0.0,10.0);
cout << "TASK 1\n";
vector<double> v1;
for (size_t i = 0; ... | TOOL | 0.867459 | 4.030097 |
14ebbde8-3a94-44ad-801d-d9b5c0149931 | DevJPM/CryptoJPM | Source/CryptoPP/Threefish.cpp | // Threefish.cpp - written and placed in the public domain by Jean-Pierre Muench
#include "pch.h"
#include "Threefish.h"
#include "misc.h"
#define KeyScheduleConst 0x1BD11BDAA9FC1A22L
NAMESPACE_BEGIN(CryptoPP)
typedef BlockGetAndPut<word64,LittleEndian> Block;
typedef GetBlock<word64,LittleEndian> CurrentGetBlock;
... | ALGO | 0.960459 | 7.081229 |
1813c7dd-7da0-4a4e-b1d9-1f3672d6d7b5 | GJT-npu/cpp-learning | test_2/2_5.cpp | #include <iostream>
#include <cmath>
int main()
{
using namespace std;
double area;
cout << "Enter the floor area, in square feet, of your home: ";
cin >> area;
double side;
side = sqrt(area);
cout << "That's the equivalent of a square " << side << " feet to the side." << endl;
retu... | TOOL | 0.958712 | 3.745112 |
81bfa6b4-3fa8-4845-82de-c1b04c91069c | iamtiteuf/SoftBody-Cube-Physics | ExternalLibs/glfw/include/symengine/matrices/immutable_dense_matrix.cpp | #include <symengine/matrices/immutable_dense_matrix.h>
#include <symengine/matrices/zero_matrix.h>
#include <symengine/matrices/identity_matrix.h>
#include <symengine/matrices/diagonal_matrix.h>
namespace SymEngine
{
hash_t ImmutableDenseMatrix::__hash__() const
{
hash_t seed = SYMENGINE_IMMUTABLEDENSEMATRIX;
... | ALGO | 0.934068 | 7.516658 |
5b627cc8-7640-4500-abbd-a8ece4ebc6f1 | kireb1298/RepositorioCpp | Estructura de Datos/Arboles/Ejercicio01.cpp |
//Crear una función que devuelva el número de elementos de un árbol binario.
#include <iostream>
using namespace std;
struct NodoArbol
{
int info;
NodoArbol *hi;
NodoArbol *hd;
};
typedef NodoArbol *arbol;
void inserta(arbol &abb, int x);
bool empty(arbol abb);
int size(arbol abb);
int main()
{
arbo... | ALGO | 0.999573 | 5.717665 |
65d07181-9f24-45b3-906c-6d26e6d27058 | Soumyaworks/AlgoVault | codeforces_653/Problem_B.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
#define ll long long int
#define pb push_back
#define mp make_pair
#define ld long double
#define fi first
#define se second
#define mod 1000000007
#define fill(a,x) memset(a,x,sizeof(a))
#... | ALGO | 0.999868 | 4.366287 |
9fbe8ef2-2d19-413a-b329-a54aa9430373 | yashvi27/Data-Structures | StackSTLQueue.cpp | #include <iostream>
#include <queue>
using namespace std;
std::queue<int> q1;
std::queue<int> q2;
class Stack
/*
Objective: Create a class to implement Stack using STL queue
Approach: Class definition provides data member and member functions for the stack class
Description: Class definition
Input paramet... | ALGO | 0.900465 | 4.507856 |
144b2303-5eaa-4a20-aae8-6d94b2d41445 | barrystyle/myce | src/masternode-payments.cpp | #include <activemasternode.h>
#include <masternode-payments.h>
#include <masternode-sync.h>
#include <masternodeman.h>
#include <messagesigner.h>
#include <netfulfilledman.h>
#include <spork.h>
#include <util.h>
#include <netmessagemaker.h>
#include <script/standard.h>
#include <key_io.h>
#include <boost/lexical_cast.... | TOOL | 0.990045 | 5.411808 |
61dafd1f-ec72-42e9-b82e-db78307ab06c | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/03/0315/personal_submission/cf1076e_sheepstick.cpp | #include <iostream>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <li... | ALGO | 0.9997 | 4.591923 |
a3df5fa5-7d2a-49e0-a243-d2651077dd93 | ZhuangPeng97/BuildFaceFlowDataCode | tools/BuildGraph_face/include/igl/lbs_matrix.cpp | IGL_INLINE void igl::lbs_matrix(
const Eigen::MatrixXd & V,
const Eigen::MatrixXd & W,
Eigen::MatrixXd & M)
{
using namespace Eigen;
// Number of dimensions
const int dim = V.cols();
// Number of model points
const int n = V.rows();
// Number of skinning transformations/weights
const int m = W.cols... | ALGO | 0.996903 | 5.107077 |
7ceb9479-6144-4fb0-8c35-faade41fd02c | Liuyi-Wang/LeetCode | src/156_Binary_Tree_Upside_Down.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.548824 |
c3b95bc6-930e-4c09-88d1-9ac0174ca00d | wiyr/Algorithm | ACMICPC/sam.cpp | const int N = 100000;
const int sigma = 26;
int ch[N][sigma], tot, len[N], fail[N];
int tail, root;
void init() {
tot = root = tail = 0;
fail[root] = -1;
rep(c, sigma)
ch[root][c] = root;
}
void _alloc(int l) {
len[++ tot] = l;
rep(c, sigma)
ch[tot][c] = 0;
}
void extend(int c) {
int p = tail;
_alloc(len... | ALGO | 0.999864 | 3.87774 |
bf178273-a152-41ba-9b1b-5a4637d69264 | ZJUAndyLee/ptaAdvanced | leetcode/721.cpp | //重新审视并查集的步骤与方法
//1,每个结点都建立一个独立的集合 也即父结点是自己的集合
//2,对于不同的集合可以用集合中的某一个元素也可以用一个标签表示集合的代表,然后把已经得到的集合建立起来 也即把现成集合的所有元素的父结点统一
//3,然后再对所有的元素进行合并,合到同一个集合里面。
string findPar(unordered_map<string, string>&p, string str) {
while (p[str] != str) { str = p[str]; }
return str;
}
vector<vector<string>> accountsMerge(vector<vector<s... | ALGO | 0.999648 | 4.338031 |
b310408e-b28c-4e82-a461-26a8422142e8 | hottinggot/AlgorithmPractice | src/BOJ_17626/problem_17626.cpp | //Four Squares
#include<iostream>
#include<math.h>
using namespace std;
int D[50001];
int INF = 987654321;
int cal(int n) {
if(D[n]>0) return D[n];
if(n==0) return 0;
int temp = INF;
for(int i=1; i*i<=n; i++) {
temp = min(temp, 1+cal(n-i*i));
}
return D[n] = temp;
}
int main() {
... | ALGO | 0.99982 | 3.904292 |
b81e36fc-f3b1-4932-855f-ed86546d29cc | Bear-Go/OJProgram | leetcode/T258/main.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int addDigits(int num) {
if (num < 10) return num;
int sum = 0;
while (num) {
sum += num % 10;
num /= 10;
}
return addDigits(sum);
}
};
int main() {
Solution s;
cout... | ALGO | 0.999756 | 5.977937 |
defaccd1-0732-47b5-a7c3-6fdf70e80d0e | xseifert/UE4-GameWorks | Engine/Source/ThirdParty/CryptoPP/5.6.2/include/twofish.cpp | // twofish.cpp - modified by Wei Dai from Matthew Skala's twofish.c
// The original code and all modifications are in the public domain.
#include "pch.h"
#include "twofish.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
// compute (c * x^4) mod (x^4 + (a + 1/a) * x^3 + a * x^2 + (a + 1/a) * x + 1)
// over GF(256)
sta... | ALGO | 0.999853 | 6.873923 |
df435953-2b88-435b-9f4d-dc18d363c4c3 | ishaankalsi/All_algos_ds_needed | code/graph-algorithms/left_view_binary_tree/left_view_binary_tree.cpp | #include<bits/stdc++.h>
using namespace std;
// Part of Cosmos by OpenGenus Foundation
struct node
{
int d;
node *left;
node *right;
};
struct node* newnode(int num)
{
node *temp=new node;
temp->d=num;
temp->left=temp->right=NULL;
return temp;
}
void lefttree(struct node *root, int level, int *maxlevel)
{
i... | ALGO | 0.999973 | 4.1237 |
ad9c20ed-fa0e-4740-8f07-40332af79cf6 | wasif2020/Leetcode-GFG | 2469-convert-the-temperature/2469-convert-the-temperature.cpp | class Solution {
public:
vector<double> convertTemperature(double celsius) {
vector<double>v;
std::setprecision(5);
std::fixed;
double kel=celsius+273.15;
double fah=celsius*1.80+32.00;
v.push_back(kel);
v.push_back(fah);
return v;
}
}; | ALGO | 0.997912 | 5.804375 |
06f26b31-1373-4c89-94a8-1f91b5d1fc3a | user557742/PC1 | dsu/LSCform.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1000000 + 5;
const ll INF = 1e18;
#define mp make_pair
#define pb push_back
#define rei(i,a,b) for(int i = (a); i <= (b); ++i)
#define red(i,a,b) for(int i = (a); i >= (b); --i)
#define fi first
#define se second
struct BIT {
int ... | ALGO | 0.999975 | 3.963914 |
a1768615-5e39-4c32-9741-38b6431b028a | rbnpontes/REngine-Atomic | Source/ThirdParty/DiligentCore/ThirdParty/SPIRV-Tools/source/opt/dead_insert_elim_pass.cpp | #include "source/opt/dead_insert_elim_pass.h"
#include "source/opt/composite.h"
#include "source/opt/ir_context.h"
#include "source/opt/iterator.h"
#include "spirv/1.2/GLSL.std.450.h"
namespace spvtools {
namespace opt {
namespace {
constexpr uint32_t kTypeVectorCountInIdx = 1;
constexpr uint32_t kTypeMatrixCountInId... | ALGO | 0.905271 | 8.012589 |
6b9be2f5-20b6-48fc-b992-e37acda0d490 | niteshydv01/Data-Structure-Algorithm | 0136-single-number/0136-single-number.cpp | class Solution {
public:
int singleNumber(vector<int>& nums) {
for(int i = 0; i < nums.size(); i++) {
int count = 0;
for(int j = 0; j < nums.size(); j++) {
if(nums[i] == nums[j]) {
count++;
}
}
if(count == 1)... | ALGO | 0.999967 | 5.884693 |
65e418b9-697c-4506-808b-b4ef756bbdde | FFFcomewhere/leetcode | 0215.cpp | #include <iostream>
#include <vector>
#include <list>
#include <map>
using namespace std;
//快排 O(nlogn) O(n^2)
class Solution
{
public:
int findKthLargest(vector<int> &nums, int k)
{
sort(nums.begin(), nums.end());
return nums[nums.size() - k];
}
};
/*
分析:
方法:
总结:
*/ | ALGO | 0.999617 | 4.411083 |
058b0aea-7cfc-4f19-83a4-abaaf0c636d4 | kocanory/baekjoon | gold 5/14284.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <queue>
using namespace std;
int n, m, s, t;
unordered_map<int, vector<pair<int, int>>> graph;
vector<vector<int>> dist;
priority_queue<pair<int, int>> pq;
void dijkstra() {
pq.push({0, s});
while (!pq.empty()) {
auto [cost, now... | ALGO | 0.99996 | 5.524041 |
f7b61782-242f-401d-b7d7-223694393d1d | NE-Shahidul-Islam/Apna_College_c-- | pattern.2.cpp | #include <iostream>
using namespace std;
int main()
{
int row, count=1;
cin >> row;
for (int i = 1; i <= row; i++)
{
for (int j = 1; j <= i; j++)
{
cout << count <<" " ; count++;
}
cout << endl;
}
}
| ALGO | 0.998418 | 3.72072 |
4dc874ef-2a9d-481e-865e-fd3e8aec9ca3 | Wsheng19/Cpp_work | 二叉树/二叉树/BiTree.cpp | #include<iostream>
#include"BiTree.h"
using namespace std;
int main()
{
char data[10000] = {0};
data[0] = 'A';
data[1] = 'B';
data[2] = 'C';
data[3] = 'D';
data[4] = 'E';
data[5] = 'G';
data[9] = 'F';
//tree
BiTree<char> tree(data);
cout << "ǰΪ";
tree.PreOrder(tree.root);
cout << "\nΪ";
tree.InOrder(tree... | ALGO | 0.999778 | 4.016847 |
0cd0e936-5764-4ce9-bbdd-dc7076549d90 | Turbo87/cpp-lib | src/cgi.cpp | #include "cpp-lib/cgi.h"
#include "boost/algorithm/string.hpp"
#include <vector>
typedef boost::iterator_range<std::string::iterator> stringpiece;
std::pair<std::string, std::string>
cpl::cgi::parse_parameter(std::string const& s) {
std::vector<stringpiece> keyval;
std::string ss = s;
boost::algorithm::split(... | WEB | 0.903412 | 6.117645 |
737b1e83-a97e-4720-aacb-f2f70241e241 | alexandraback/datacollection | solutions_5756407898963968_0/C++/leanil/main.cpp | #include <cstdio>
#include <set>
using namespace std;
int main()
{
int t;
FILE* fp(fopen("input.txt","r"));
fscanf(fp,"%d",&t);
FILE* out(fopen("output.txt","w"));
for(int i=1;i<=t;i++) {
int row;
fscanf(fp,"%d",&row);
int tmp;
set<int> num1;
for(int j=1;j<=... | ALGO | 0.998241 | 3.463515 |
6a868dd7-6d1b-4351-850e-4ab3963e9faf | StanislausJoel/chess_AI | stockfish/src/bitboard.cpp | #include "bitboard.h"
#include <algorithm>
#include <bitset>
#include <initializer_list>
#include "misc.h"
namespace Stockfish {
uint8_t PopCnt16[1 << 16];
uint8_t SquareDistance[SQUARE_NB][SQUARE_NB];
Bitboard LineBB[SQUARE_NB][SQUARE_NB];
Bitboard BetweenBB[SQUARE_NB][SQUARE_NB];
Bitboard PseudoAttacks[PIECE_TYP... | CONFIG | 0.99722 | 5.958623 |
5048fb6c-6459-4520-83c1-07dbb51d5717 | shabinasiddiqui/leetcode- | C++/BinarySearch.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int n=nums.size();
int high=n-1,low=0;
while(low<=high){
int mid=(low+high)/2;
if(target==nums[mid]){
return mid;
}
else if(target>nums[mid]){
... | ALGO | 0.999917 | 6.23955 |
256962cf-6735-45de-b61f-e1664416827d | kevinrjt/leetcode | palindrome-number/palindrome-number.cpp | #include <iostream>
using namespace std;
bool isPalindrome(int x)
{
if (x < 0 || (x != 0 && x % 10 == 0))
{
return false;
}
int r = 0;
while (r < x)
{
r = 10 * r + x % 10;
x /= 10;
}
return r == x || r / 10 == x;
}
int main()
{
return 0;
} | ALGO | 0.999848 | 5.337185 |
327308ef-f8c9-43fa-9023-9a83b2e2cd1e | mbyar/Data-Structures-Algorithms-and-Applications-in-C-plus-plus | 4_1_2.cpp | #include<iostream>
#include<ctime>
#include<iomanip>
using namespace std;
template<typename T>
void insertionSort(T a[], int n)
{
for (int i = 1; i < n; i++)
{
T t = a[i];
int j;
for (j = i - 1; j >= 0 && t < a[j]; j--)
a[j + 1] = a[j];
a[j + 1] = t;
}
}
void test01(void)
{
int a[1000], step = 10;
doubl... | ALGO | 0.989214 | 5.179245 |
0eebbe54-f69d-4f0e-be22-9cf43abbe6be | Zimse12345/Code | Luogu/P1472 [USACO2.3]Cow Pedigrees.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdlib>
#include <ctime>
#define int long long
#define ull unsigned long long
using namespace std;
int read(){int qrx=0,qry=1;cha... | ALGO | 0.999927 | 4.003963 |
e456f8a6-afbc-4435-8604-e05dcb8d997e | raincross7/code-similarity | codes/train_code/problem044/problem044_286.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int h[100];
cin >> n;
for (int i = 0; i < n; i++) cin >> h[i];
int ans = 0;
while (true) {
if (*max_element(h, h + n) == 0) break;
int i = 0;
while (i < n) {
if (h[i] == 0) i++;
e... | ALGO | 0.999926 | 4.736114 |
53249a44-1b7a-4eb6-9902-17085de8f520 | kwl3434/boj | 2028.cpp | #include<cstdio>
#include<stdlib.h>
#include<cstring>
int main(){
int T;
scanf("%d",&T);
while(T--){
char n[10],a[10];
int N;
bool check=1;
scanf("%s",n);
N=atoi(n);
N=N*N;
snprintf(a,10,"%d",N);
for(int i=0;i<strlen(n);i++){
if(a[strlen(a)-strlen(n)+i]!=n[i]){check=0;}
}
if(check) printf("YE... | ALGO | 0.999678 | 4.124207 |
aeed2989-fdc5-4bcc-9742-797a1e670093 | Peter-Refaat/Leetcode | Easy/2778. Sum of Squares of Special Elements.cpp | class Solution {
public:
int sumOfSquares(vector<int>& nums)
{
int sum = 0;
int n = nums.size();
for(int i = 0 ; i < n ; ++i)
{
if(n % (i+1) == 0) sum += pow(nums[i],2);
}
return sum;
}
};
| ALGO | 0.999821 | 5.8095 |
7409bcb8-bb4f-4a79-ad90-4a636b862c72 | fletcher97/CPP09 | ex02/src/classes/PmergeMe.cpp | #include <cctype>
#include <sstream>
#include <stdexcept>
#include "Log.hpp"
#include "Timer.hpp"
#include "PmergeMe.hpp"
void
PmergeMe::sortVec(size_t start, size_t end, size_t k)
{
if (end - start + 1 <= k) {
this->insertVec(start, end);
} else if (end - start > 1) {
this->sortVec(start, start + ((end - star... | ALGO | 0.997259 | 5.799311 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.