uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
5f9d9e7d-9f9c-4292-8018-a31942ae8f78 | mdhlimonmia/Codeforces_Problem_Solution | B_Permutation_Printing.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define Limon() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define lli long long int
void solve(){
int n;cin>>n;
int s = 1, l = n;
for (int i = 1; i <= n; i++)
{
if(i&1){
cout<<s<<" ";
s++;
... | ALGO | 0.999978 | 4.133 |
aa86ec7d-2765-4f7b-8e4e-c70c4101d9c6 | thaongo95/z113qgroundcontrol | libs/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.971374 | 3.245548 |
4534db8c-e35e-4c7a-9533-eb59dee7092a | vindhya-14/6Companies30days | company2/problem2.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
class Solution {
public:
string convertToTitle(int columnNumber) {
string result = "";
while (columnNumber > 0) {
columnNumber--;
int remainder = columnNumber % 26;
result += ('A' +... | ALGO | 0.999813 | 6.447275 |
25b7c4ab-c2bf-4b4f-a560-fa7b1857548c | randbatch-md/gromacs-rbe | src/gromacs/linearalgebra/gmx_lapack/dlagts.cpp | #include <stdlib.h>
#include <cmath>
#include "gromacs/utility/real.h"
#include "../gmx_lapack.h"
#include "lapack_limits.h"
void
F77_FUNC(dlagts,DLAGTS)(int *job,
int *n,
double *a,
double *b,
double *c__,
double *d__,
int *in,
double *y,
double *tol,
int *info)
{
int i__1;
double d__1, d__... | ALGO | 0.999818 | 4.653492 |
e9ad6548-4444-4dbe-934e-0b21d9a9d910 | Ishwarendra/Contests | CODEFORCES_CONTEST/thinkCell_Round1/D2.cpp | #include "bits/stdc++.h"
#ifdef LOCAL
#include "/Users/ishwar/Debug/debug.h"
#else
#define print(...) 1;
#endif
using i64 = long long;
void solve()
{
int n;
std::cin >> n;
std::string s;
std::cin >> s;
std::vector<i64> dp(n + 1);
dp[0] = 0;
for (int i = 1; i <= n; i++)
{
a... | ALGO | 0.999451 | 4.72884 |
baa74b5c-331b-466b-87f7-de894db86078 | dr3dd589/2018-ctfs-chall-and-sol | 35c3CTF18/strinmaster1/stringmaster1.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <unistd.h>
#include <limits>
using namespace std;
const string chars = "abcdefghijklmnopqrstuvwxy";
void spawn_shell() {
char* args[] = {(char*)"/bin/bash", NULL};
execve("/bin/bash", args, NULL);
}
void print_menu() {
co... | TOOL | 0.909364 | 4.50804 |
6f2a6abc-43e3-43dc-97a9-e6bcadb2b82e | kjh01140/codetree-TILs | 241220/운행 되고 있는 시간/hours-in-service.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int arr[100][2] = {};
int ans = 0;
int main() {
int N; cin >>N;
for(int i=0; i<N; i++){
cin >> arr[i][0] >> arr[i][1];
}
for(int i=0; i<N; i++){ //제외선정
int time = 0;
int time_arr[1000] = {};
for(int j=0; j<... | ALGO | 0.999872 | 4.562315 |
9987f245-7540-492f-9949-2838af71e7fa | Davidrd25/PEL | Ejercicios/Ejercicio2.cpp | #include <iostream>
using namespace std;
template <typename T> T intercambio (T a, T b, T c){
c=a;
a=b;
b=c;
return (a && b);
}
int main(int, char**) {
int a = 4, b=6, g, n;
double c = 6.5, d = 1.3, e, m;
n = intercambio <int> (a,b,g);
m = intercambio <double> (c,d,e);
cou... | ALGO | 0.986195 | 3.842499 |
a746009b-a8a9-4aa2-ac04-f662b46442ff | icepack/Trilinos | packages/muelu/research/mmayr/composite_to_regions/src/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <vector>
#include <iostream>
#include <numeric>
#define RegionsSpanProcs 1
#define MultipleRegionsPerProc 2
#include "ml_config.h"
#ifdef HAVE_MPI
#include "mpi.h"
#include "Epetra_MpiComm.h"
#else
#include "Epetra_SerialComm.h"
... | ALGO | 0.994872 | 3.137031 |
491e632f-9a0d-490a-a274-3199a6e562a8 | ChiyoYuki/xcpc | cf/1352/G_Special_Permutation.cpp | /**
* author: ChiyoYuki
**/
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define st first
#define nd second
#define elif else if
typedef long long ll;
typedef unsigned long long ull;
typedef double lf;
typedef pair<ll, ll> pll2;
typedef priority_queue<ll> pqll;
typedef vector<ch... | ALGO | 0.999971 | 4.198609 |
112aee64-6748-4a78-9d1b-1cf283e83f36 | cormoran/CompetitiveProgramming | src/contest/topcoder/SRM702div1/RepeatedStrings.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
#define rep(i,j) for(ll i=0;i<j;i++)
#define repeat(i,j,k) for(ll i=(j);i<(k);i++)
#define all(v) v.begin(),v.end()
class RepeatedStrings {
public:
string S;
int K;
bool is_sub_seq(const string &s) {
i... | ALGO | 0.999683 | 4.256565 |
ea3a132a-96da-45c9-a754-9e37025b7cb2 | tivolicloud/interface | libraries/shared/src/AABox.cpp | #include "AABox.h"
#include "AACube.h"
#include "Transform.h"
#include "Extents.h"
#include "GeometryUtil.h"
#include "NumericalConstants.h"
const glm::vec3 AABox::INFINITY_VECTOR(std::numeric_limits<float>::infinity());
AABox::AABox(const AACube& other) :
_corner(other.getCorner()), _scale(other.getScale(), oth... | TOOL | 0.995482 | 7.606731 |
d890f2e5-6968-4533-91be-c7821e1c3898 | Vaibhav-2402/Simple_programs_5 | ch4q11.cpp | #include<iostream>
using namespace std;
struct time
{
int hours;
int minutes;
int seconds;
};
struct convert
{
time t1;
time t2;
};
int man()
{
convert c;
int l1,l2,l3,f1,f3,f5,f2;
cout<<"\n Enter the hours, minutes, seconds of time 1: "<<endl; cin>>c.t1.hours>>c.t1.minutes>>c.t1.second... | ALGO | 0.993776 | 3.290421 |
81f5fca3-4bc3-4f07-a255-71cd37fd35ba | ishandutta2007/codeforces | rniya/normal/1562/D1.cpp | #define LOCAL
#include <bits/stdc++.h>
using namespace std;
#pragma region Macros
typedef long long ll;
typedef __int128_t i128;
typedef unsigned int uint;
typedef unsigned long long ull;
#define ALL(x) (x).begin(), (x).end()
template <typename T> istream& operator>>(istream& is, vector<T>& v) {
for (T& x : v) is ... | ALGO | 0.999915 | 4.55866 |
10010d51-25d4-4462-9e60-793418f6cbba | Leshmith/Data-Structures-and-Algorithms | In_class_Lab_Week_07/Lab7.cpp | #include <iostream>
using namespace std;
struct Node {
int key;
struct Node *left, *right;
};
// Inorder traversal
void traverseInOrder(struct Node *root) {
if (root != NULL) {
traverseInOrder(root->left);
cout << root->key << " ";
traverseInOrder(root->right);
}
}
// Insert a node
struct Node *i... | ALGO | 0.999901 | 6.040969 |
6e871780-de55-4857-8181-151c12062f8f | ishandutta2007/codeforces | redant/normal/1263/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
void setIO() {
ios_base::sync_with_stdio(0);
cin.tie(0);
}
int main() {
setIO();
int t; cin>>t;
while(t--) {
LL a, b, c;
cin>>a>>b>>c;
LL sum = a+b+c;
LL mx = max(a, max(b, c));
LL mn = min(a,... | ALGO | 0.999983 | 5.125217 |
52459423-be35-4b44-b5f5-2431f12c0080 | tShivam25/Data-Structures-and-Algorithm | msa_kadanes_algo.cpp | #include<iostream>
using namespace std;
void display(int arr[],int size){
for(int start=0; start<size; start++){
for(int end=start; end<size; end++){
for(int i=start; i<=end; i++){
cout << arr[i];
}
cout << " ";
}
cout << " ";
}
c... | ALGO | 0.987351 | 4.524199 |
75bebf84-8219-47c9-a3a2-bbf7a7a9788c | alexandraback/datacollection | solutions_2652486_0/C++/Storm/ProbC.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <sstream>
#include <set>
#include <algorithm>
#include <sstream>
using namespace std;
int main()
{
freopen("C:\\Projects\\gcj\\input.txt", "r", stdin);
freopen("C:\\Projects\\gcj\\output.txt", "w", stdout);
int z;
cin >> z;
for (i... | ALGO | 0.998013 | 3.135406 |
38d4d1ba-43bc-418a-90a9-f2b0c11f05c6 | pikapi2030/CPP2nd | DSAtoZ-main/algorithms/boyer_smoore_svoting.cpp | #include<bits/stdc++.h>
using namespace std;
/*
this is and extended version of moore's voting
it gives elements whose freq>n/3
*/
/*
instead of only using one cnt and one element var here we use 2 counters and 2 elements var
considered as majority(maximum majority elements can only be 2 in case of n/3)
*/
/*
T.C O(2... | ALGO | 0.999975 | 4.871612 |
aa60d481-a8be-4796-bf69-a954f5d132d0 | maheshraut07/DSA-Practise | 95DSA02_Graph_DFS_Traversal_of_a_graph.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
return 0;
}
void dfs(int node, vector<int> adj[], unordered_map<int, bool> &visited, vector<int> &component) {
component.push_back(node);
visited[node] = true;
for (auto i : adj[node]) {
if (visited[i] == fa... | ALGO | 0.999833 | 5.845318 |
3988cbba-9a88-4836-b66e-c417db94c5a1 | utoppia/leetcode | Search/200-number-of-islands.cpp | /******************************************
* author : utoppia
* description : solution for leetcode
* updated at : 2024-01-12 20:42:09
* filename : 200-number-of-islands.cpp
* language : cpp
* editor : Emacs 27.1
*****************************************/
#include <algorithm>
#include <bits/std... | ALGO | 0.999956 | 6.618732 |
d6a1223a-2ba1-40fe-8cee-73150d7406e7 | lzyrapx/Competitive-Programming | 百度之星/2020/复赛/B.cpp | #include <cstring>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 123;
const int mod = 998244353;
int sum[maxn];
int main(int argc, char const *argv[])
{
int t;
cin >> t;
while(t--) {
int n = 0;
... | ALGO | 0.999979 | 4.691251 |
a5178750-c6dd-4c1d-a4cd-0fd456ae9690 | jayesh37/Leetcode-Problems | 2240-number-of-ways-to-buy-pens-and-pencils/2240-number-of-ways-to-buy-pens-and-pencils.cpp | class Solution {
public:
long long waysToBuyPensPencils(int total, int cost1, int cost2) {
long long int n= total/cost1;
long long ans=0;
for(long long i=0;i<=n;i++)
{
ans += (total/cost2) +1;
total -= cost1;
}
return ans;
}
}; | ALGO | 0.99946 | 5.103596 |
53ad41e9-567c-4b8e-86d6-f569b24a3099 | northpoleforce/lesson_DS | 3栈和队列/EDS队列--组队列.cpp | #include <stack>
#include <queue>
#include <string>
#include <iostream>
using namespace std;
int t, n[100], g[100][10000];
int get_pos(int num) {
for (int i = 0; i < t; ++i) {
for (int j = 0; j < n[i]; ++j)
if (g[i][j] == num) return i;
}
return -1;
}
int main() {
cin >> t;
q... | ALGO | 0.9999 | 3.932405 |
b569cf21-a223-4fe9-a385-1e74b185ac8f | pedroguarderas/KRIGA | src/kriga.cpp | #include <gsl/gsl_math.h>
#include <string>
#include "kriga.hpp"
Kriga::KrigaError::KrigaError( const Exep e, const GA_array& array ) :
_error( e ),
_garray( array ) {
}
const char* Kriga::KrigaError::what() const throw () {
std::string message;
switch ( _error ) {
case type:
message = "Problems in type ag... | ALGO | 0.98885 | 5.834634 |
0418545d-95a4-4173-9e20-c997459f1787 | muftifaiyazshamim/data-structure | Linear_search.cpp | #include <iostream>
using namespace std;
int main()
{
int a;
cout<<"Enter arrey size : ";
cin >> a;
int arr[a];
cout<<"Enter elements of arrey : ";
for(int i=0; i<a; i++)
{
cin>>arr[i];
}
int c;
cout<<"Enter element to get : ";
cin >> c;
for(int i=0; i<a; i++)
... | ALGO | 0.993251 | 3.66507 |
69d911e2-ab44-420a-8789-c5a640ed240e | Borked3DS/ext-boost | libs/url/src/parse_path.cpp | #ifndef BOOST_URL_IMPL_PARSE_PATH_IPP
#define BOOST_URL_IMPL_PARSE_PATH_IPP
#include <boost/url/detail/config.hpp>
#include <boost/url/parse_path.hpp>
#include <boost/url/error.hpp>
#include "detail/path.hpp"
#include <boost/url/grammar/parse.hpp>
#include "boost/url/rfc/detail/path_rules.hpp"
namespace boost {
names... | TOOL | 0.883708 | 6.346095 |
030b3f34-c70d-49a5-8fdf-6476119053b8 | Goodnameisfordoggy/College-assignment | numericalComputationMethod/上机实验/7.数值积分/复化柯特斯求积公式.cpp | /***
* @Author: HDJ
* @StartDate: please fill in
* @LastEditTime: 2024-05-11 17:07:47
* @FilePath: \c++\numericalComputationMethod\ϻʵ\7.ֵ\˹ʽ.cpp
* @Description:
* @
* @ * д¥дּ䣬дּԱ
* @ * ԱдóǮ
* @ * ֻߣ
* @ * ոգ긴ꡣ
* @ * ԸԼ䣬ԸϹϰǰ
* @ * ۱ȤгԱ
* @ * Ц߯ЦԼ̫
* @ * ƯãĸóԱ
* @Copyri... | ALGO | 0.999957 | 4.939953 |
219d55e5-a89f-455d-af11-1e48537ea8c3 | bpru/faceoff | boost_1_62_0/libs/graph/example/default-constructor2.cpp | using namespace boost;
template < typename Graph > void
read_graph_file(std::istream & in, Graph & g)
{
typedef typename graph_traits < Graph >::vertex_descriptor Vertex;
typedef typename graph_traits < Graph >::vertices_size_type size_type;
size_type n_vertices;
in >> n_vertices; // read in number... | ALGO | 0.957274 | 5.691417 |
c1f08a04-5159-4aea-a9ed-b51ada5be1d4 | piyushnbali/competitive-coding | Siddhesh/Leetcode/AddTwoNumbersLinkedList.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* addTwoNumber... | ALGO | 0.999967 | 6.124219 |
f3733210-962d-4633-a27f-f5735bd2d3d1 | ishandutta2007/codeforces | greenheadstrange/normal/1530/D.cpp | // Awwawa! Dis cold yis ratten buy tEMMIE!
#include <bits/stdc++.h>
#define ll long long
#define maxn 200005 /*rem*/
#define mod 998244353
#define db double
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define fi first
#define se second
template <typename T> bool chkmax(T ... | ALGO | 0.999849 | 4.46581 |
e86f60f9-eaa0-44e9-aaa5-484a2a60f2e8 | Kostyancapral/Dima | 3 массива с одинаков.размером/Проект2/Исходный код.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main ()
{
int *massiv_1, *massiv_2, *massiv_3;
int n;
cout << "Vvedite kol elementov v massive ";
cin >> n;
massiv_1 = new int [n];
massiv_2 = new int [n];
massiv_3 = new int [n];
for(int i = 0; i < n; i++)
{
massiv_1[i] = rand()%21;
massiv_2[i... | ALGO | 0.984729 | 3.050316 |
8f83bf50-47ba-453d-baeb-28ce651d4fec | eosspark/eos-sidechain | SideChain/externals/binaryen/test/emscripten/tests/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp | #include "btSphereSphereCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
btSphereSphereCollisionAlgorithm::btSphereSphereCollisionAlgorithm(btPersistentM... | ALGO | 0.998692 | 6.586013 |
4061f0bd-067d-4b73-88c2-01c10d2343c1 | MeghavatiChaudhari/todo_flutter_traning | 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 |
701add42-0410-4d35-8a50-f17fda0aab77 | cfeitong/ACM-problem-archive | math/7-cf776-E.cpp | #include <iostream>
#include <cmath>
using namespace std;
typedef long long LL;
const LL MOD = 1000000007;
LL phi(LL n) {
LL ans = n;
for(LL i=2; i*i<=n; i++) {
if(n%i==0) {
ans=ans/i*(i-1);
while(n%i==0) n/=i;
}
}
if(n>1) ans=ans/n*(n-1);
return ans;
}
i... | ALGO | 0.999982 | 4.483356 |
42838a9f-3a5d-4305-9912-ae505688225e | J-AugustoManzano/livro_CPP-Orange | Cap06/EXER062B.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(void)
{
int A[5], B[5][3], I, J;
cout << setiosflags(ios::right);
// Entrada de dados
cout << "\nInforme dados da matriz A" << endl;
for (I = 0; I <= 4; I ++)
{
cout << "A[" << I + 1 << "] = ";
cin >> A[I];
}
// Pro... | ALGO | 0.978318 | 3.2436 |
7cd77b72-6192-47cc-8b59-13a3a11d89ac | kt117/ProCom | atcoder/abc/226/f.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 998244353;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) <<... | ALGO | 0.999981 | 4.658066 |
5f0a91e1-1b31-4347-822a-acaa4c04fc29 | nonoivan1234/112DSAP | hw/hw2/b2.cpp | #include <utility>
#include <vector>
#include <iostream>
#include <initializer_list>
#include <algorithm>
#include <cassert> // For Test
#include <random> // For Test
#include <functional> // For Test
template<typename T>
struct ListNode {
explicit ListNode(T val) : val{std::move(val)}, next{nullptr} {}
... | ALGO | 0.972536 | 4.836287 |
948a2ad8-1724-4258-8c18-ccceffc42eb9 | kedonaghey/QuantLibAdjoint | ql/experimental/mcbasket/longstaffschwartzmultipathpricer.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/math/generallinearleastsquares.hpp>
#include <ql/experimental/mcbasket/longstaffschwartzmultipathpricer.hpp>
#include <ql/utilities/tracing.hpp>
namespace QuantLib {
LongstaffSchwartzMultiPathPricer::PathInfo::PathInfo(S... | ALGO | 0.999684 | 4.176713 |
a57f389f-634b-4773-af89-f3159ed82428 | Oriburger/problem_solving_1w3solve | BOJ/21610_마법사상어와비바라기.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
struct Pos { int y; int x; };
int n, m;
int a[51][51];
bool check[51][51];
const int dy[8] = {0, -1, -1, -1, 0, 1, 1, 1};
const int dx[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
vector<Pos> clouds;
void rain(int d, int s)
{
fo... | ALGO | 0.999789 | 4.679749 |
f7d7a074-71de-4bc8-9f24-e66e638da18d | apkmew/Code | Beta Progrmming/Programming/0016_Ptice.cpp | /*
TASK : Ptice
LANG : C++
AUTHOR : Apkmew
SCHOOL : Kasetsart University
*/
#include <bits/stdc++.h>
using namespace std;
int a[5];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0),cout.tie(0);
int i,n,mx;
char c;
cin >> n;
for(i=0;i<n;i++){
cin >> c;
if(i%3==... | ALGO | 0.999822 | 4.817726 |
404362b1-96cf-485d-b0af-bd42b6947946 | backengineering/llvm-msvc | llvm/lib/CodeGen/MachineVerifier.cpp | #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include ... | TOOL | 0.859622 | 7.892145 |
19b1c2d8-9bb8-4669-a39d-5665f1121d10 | part-of-the-crew/cpp_backend | sprint1/Find_Print_In_Container/main.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std::string_literals;
template <typename C>
void PrintRange(const C& begin, const C& end) {
bool is_first = true;
for (auto it = begin; it != end; ++it... | ALGO | 0.996034 | 4.930972 |
53564695-3858-4730-ba08-3b63600e8e7c | NicolasNFF/Estrutura-de-Dados-2022 | Estrutura de Dados - Tadeu/Estrutura de Dados - Tadeu/Exercicios ED/EX7/main.cpp | #include <iostream>
#include "Fila.h"
using namespace std;
int main()
{
int num;
Node<int> * node = NULL;
Fila<int> * F = new Fila<int>();
bool wasEven = true;
bool wasDiferent = true;
cin >> num;
while(num >= 0){
node = new Node<int>();
node->setInfo(num);
F->Push... | ALGO | 0.999973 | 4.893737 |
a47160bf-0855-4736-91f4-82c03a2b8d17 | YanqiangWang/Cpp_primer | exercises/5/ex5_24.cpp | #include <iostream>
#include <stdexcept>
using namespace std;
int main() {
int num1, num2;
cin >> num1 >> num2;
if (num2 == 0)
throw runtime_error("divisor is 0");
cout << num1 / num2;
return 0;
}
| ALGO | 0.983464 | 4.470571 |
8de5cb61-8a37-4b59-8e6a-392bdc923bf8 | sagar-deep-saha/Require_Up | CPP/CPP-ALPHA/A14.cpp | #include<iostream>
using namespace std;
int factorial(int n){
if(n<=1){
return 1;
}
// else
return (n*(factorial(n-1)));
}
// FACTORIAL BY RECURSION
int main(){
int q;
cout<<"enter the value:"<<endl;
cin>>q;
cout<<"The factorial is "<<factorial(q)<<endl;
return 0;
} | ALGO | 0.999454 | 3.910222 |
e494fc0c-77c6-491a-8dd6-0db60e3fd16d | Zhang-Tianxu/Algorithms | SortAlgorithms/MergeSort.cpp | #include <iostream>
#include "SortTester.h"
/*
* Descriptions:
* A[s,e] is a set of numbers that is divided into two ordered subarray, A[s,m] and A[m+1,e]. Merge() merge them into one ordered array inplace.
*
* Inputs:
* A[] s set of numbers,
* s, start point.
* m, middle point
* e, end poin... | ALGO | 0.998229 | 5.308606 |
8d15bb2b-ea95-4c93-a2e9-eaf3c600cc54 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6078_11.cpp | #include <bits/stdc++.h>
using namespace std;
long long l[20000];
long long res, p, i, k, n, j;
int main() {
cin >> n >> k;
l[1] = 1;
l[2] = 2;
l[3] = 9;
l[4] = 64;
l[5] = 625;
l[6] = 7776;
l[7] = 49 * 49 * 49;
l[8] = 64 * 64 * 64 * 8;
for (i = k + 1; i <= n; i++) {
l[k] = l[k] * (n - k);
l[... | ALGO | 0.999969 | 3.863001 |
342ca17d-8b85-4704-989c-2d21dd1becfd | ddt-hirasawa/meikai-medium-cpp | e_02_04/src/func.cpp | /*
演習2-4 符号なし整数の第 pos bit ~ 第 pos + n -1 までの n このビットを
それぞれ 1 0 反転させた値を返す関数の作成
作成日 2017年5月15日
作成者 平澤敬介
*/
#include<iostream>
#include<math.h>
using namespace std;
//関数 指定したbitからn個のbitを1に書き換えます
//仮引数 変換する整数 指定するbitの位置 変換する個数
//返却値 変化させた整数
unsigned set(unsigned tmp, int pos, int num) {
//指定したbitの位置から n個分 すべて1... | ALGO | 0.999462 | 4.430226 |
9bfffeff-a6a6-4f4e-9184-9804a77af8a1 | Siddhant/revkit-copy | src/algorithms/synthesis/exact_synthesis.cpp | #include "exact_synthesis.hpp"
#include <cmath>
#include <fstream>
#include <iostream>
#include <boost/assign/std/vector.hpp>
#include <boost/assign/std/set.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/bind.hpp>
#include <boost/format.hpp>
#include <core/utils/timer.hpp>
#include <core/functions/fully_spec... | ALGO | 0.999803 | 5.134037 |
48f0b0c9-633e-4260-a893-7d3751e88160 | Omair95/A_prototype_MPEG-G_encoder | boost_1_66_0/libs/mpi/src/computation_tree.cpp | // Compute parents, children, levels, etc. to effect a parallel
// computation tree.
#include <boost/mpi/detail/computation_tree.hpp>
namespace boost { namespace mpi { namespace detail {
int computation_tree::default_branching_factor = 3;
computation_tree
::computation_tree(int rank, int size, int root, int branchi... | ALGO | 0.999933 | 6.537826 |
1e137255-e5e7-4e83-883f-537647468800 | Hiraiffi/Code_files | DS/AVL insert.cpp | #include<iostream>
using namespace std;
class node
{
public:
int key;
node *lchild;
node* rchild;
int height;
node()
{
key=0;
lchild=NULL;
rchild=NULL;
height=1;
}
node(int k)
{
key=k;
lchild=NULL;
rchild=NULL;
height=1;
}
};
class AVL
{
public:
node *root;
AVL()
{
root=NULL;
}
... | ALGO | 0.999863 | 4.533834 |
787ca68e-170f-43fb-9738-f38c1e0fbd53 | luaman/g3d-cpp | source/G3Dcpp/ConvexPolyhedron.cpp | /**
@file ConvexPolyhedron.cpp
@author Morgan McGuire, <EMAIL>
@created 2001-11-11
@edited 2006-01-10
Copyright 2000-2006, Morgan McGuire.
All rights reserved.
*/
#include "G3D/platform.h"
#include "G3D/ConvexPolyhedron.h"
#include "G3D/debug.h"
namespace G3D {
ConvexPolygon::ConvexPolygon(const ... | ALGO | 0.994087 | 7.633131 |
8a3f9c69-7561-414b-b715-af3306d3f78e | lhlssmile/leetcode-practice | lc_cpp/lcCpp/linkList/mergeKLists23.cpp | #include <iostream>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode():val(0),next(nullptr) {}
ListNode(int val):val(val),next(nullptr) {}
ListNode(int val,ListNode* next) :val(val),next(next) {}
};
class merge_k_lists23 {
public:
ListNode* mergeKLists(v... | ALGO | 0.999914 | 5.537279 |
0d1c7b1c-43ca-4496-a18b-3dda1d59f3b5 | khanhtran0111/Advanced-Programming-INT2210 | tuan7/bai8.cpp | #include<bits/stdc++.h>
#define int long long
#define speed ios_base::sync_with_stdio(0); cin.tie(0);
#define fi first
#define se second
#define taskname ""
using namespace std;
const int maxn=1e5+10;
const int mod=998244353 ;
void trim_right(char a[]){
int n=strlen(a);
int i=n-1;
while(a[i] == ' ') i--;... | ALGO | 0.999688 | 3.409418 |
f0741f8b-70d1-4e90-97c8-3a9bee3ed520 | ashokabairwaideology/Leet-code-problem | solution/0300-0399/0314.Binary Tree Vertical Order Traversal/Solution2.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.999986 | 6.340148 |
b67d14e1-72b0-4b9c-bd14-210005265927 | paulfitz/coopy | src/libcoopy_core/Mover.cpp | #include <coopy/Mover.h>
#include <coopy/Dbg.h>
#include <algorithm>
using namespace std;
using namespace coopy::cmp;
#include <stdio.h>
bool Mover::move(const std::vector<int>& src, const std::vector<int>& dest,
std::vector<int>& order,
std::vector<int>& forbidden,
int depth) {
if (depth==0) {
gl... | ALGO | 0.999877 | 4.719687 |
a6bc8b1c-6d81-4f3d-ae2e-61928e57c6da | tkvitko/cpp_advanced | function_vector_move/function_vector_move/main.cpp | //
// main.cpp
// function_vector_move
//
// Created by tkvitko on 13.03.2024.
//
#include <iostream>
#include <vector>
template <typename VALUE>
void move_vectors(std::vector<VALUE>& src, std::vector<VALUE>& dst) {
dst = std::move(src);
}
int main(int argc, const char * argv[]) {
std::vector <std::string... | TOOL | 0.938473 | 5.327044 |
e7c99c4e-69d2-4811-b902-bff820e79d18 | viralipurbey/CompetitiveProgramming-CN | function_pointers.cpp | #include<bits/stdc++.h>
using namespace std;
void print(int* p){
cout << *p << endl;
}
void increment_p(int* p){
p++;
}
void increment(int* p){
(*p)++;
}
void sum(int a[], int size){
int sum = 0;
cout << sizeof(a) << endl;
for(int i = 0; i < size; i++){
sum+=a[i];
}
cout << sum << endl;
}
int main(){
int... | ALGO | 0.860733 | 3.437076 |
b4f8a3bc-e6d0-4fd4-b40a-171ef388da4c | bollu/polymage | sandbox/ipp_bench/harris/ipp_harris_corner.cpp | #include <stdio.h>
#include <iostream>
#include <ippcore.h>
#include <ippvm.h>
#include <ipps.h>
#include <ippi.h>
#include <ippcv.h>
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "../timing.h"
#ifndef NRUNS
#define NRUNS 5
#endif
#ifndef SI... | ALGO | 0.993106 | 5.002312 |
c39b0d02-ec42-4099-9162-5a1eaf74d092 | Account1-Anurag/PRACTICE-CODES | codeforces9222.cpp/codeforces164.cpp | // // #include <bits/stdc++.h>
// // using namespace std;
// // int maxi(vector<int>& arr) {
// // unordered_map<int, int> frequencyMap; // Map to store frequency of each element
// // int maxFrequency = 0; // Track maximum frequency
// // int elementOfMaxOccurrence; // Element with maximum occurrence
... | ALGO | 0.99966 | 5.368357 |
7b259913-14d6-43b1-9756-d88607ff7757 | knaeeim/XPSC | week-1/Day-3/A_Forgotten_Episode.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
int a[n];
map<int, int> mp;
for (int i = 0; i < n; i++){
cin >> a[i];
mp[a[i]]++;
}
int ep = 0;
for (int i = 1; i <= n; i++)
{
... | ALGO | 0.999885 | 4.387803 |
3ecc7067-3a72-4843-bcc7-d3a04ca941d2 | yinzixuan126/my_udacity | CarND-MPC-Project/src/Eigen-3.3/bench/perf_monitoring/gemm/gemm.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <Eigen/Core>
#include "../../BenchTimer.h"
using namespace Eigen;
#ifndef SCALAR
#error SCALAR must be defined
#endif
typedef SCALAR Scalar;
typedef Matrix<Scalar,Dynamic,Dynamic> Mat;
EIGEN_DONT_INLINE
void gemm(const Mat &A, const Mat &B, Mat &C)
{... | TEST | 0.970116 | 5.689105 |
9e70044a-1dd6-4d16-ad73-c0db5e5c71a0 | Verterax/CodeEval_Solutions | ShortestRepetition/ShortestRepetition/main.cpp | // By Christopher Caldwell
// <EMAIL>
// Challenge 107
// Shortest Repetition
#include <iostream>
#include <fstream> //fileStream
#include <string>
#include <sstream>
//using namespace std;
using std::cout;
using std::endl;
#pragma region Defaults
//Template function set to run on each
//line read from the text file... | ALGO | 0.970404 | 4.693278 |
65d13e6e-7880-4809-934a-cc9280d4cee7 | Omair95/A_prototype_MPEG-G_encoder | boost_1_66_0/libs/intrusive/example/doc_sg_set.cpp | using namespace boost::intrusive;
class MyClass : public bs_set_base_hook<>
{
int int_;
public:
//This is a member hook
bs_set_member_hook<> member_hook_;
MyClass(int i)
: int_(i)
{}
friend bool operator< (const MyClass &a, const MyClass &b)
{ return a.int_ < b.int_; }
frien... | TEST | 0.886957 | 6.011098 |
64c2df4f-fa00-4d6c-b8c2-63100161f930 | Mehulcoder/Codeforces | Random_Problems/1130B.cpp | /*
Name: Mehul Chaturvedi
IIT-Guwahati
*/
/*
Talent is Overrated
*/
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, les... | ALGO | 0.99858 | 3.786083 |
b64c41b3-44db-4aab-9526-841e3b190ba0 | tte0/CP | J_K_query.cpp | /*
Author: Teoman Ata Korkmaz
*/
#pragma GCC optimize("O3,fast-math,unroll-all-loops")
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define int ll
#define ff first
#define ss second
#define endl '\n'
#define spc ' '
#define pb push_back
#define e2(x) (1LL<<(... | ALGO | 0.999738 | 4.443367 |
f5a49b0f-792a-40b8-98d5-a838fa121cd2 | huangcaohui/Data-Structure-And-Algorithm | 栈_递归.cpp | /*笔记与图见4.2 栈与递归*/
#include <iostream>
#include <stack>
using namespace std;
typedef struct elem{
int rd, pn, pf, q1, q2;
}ELEM;
class nonrec
{
private:
stack <ELEM> S;
public:
nonrec(void){};
void replace1(int n, int &f);
};
void nonrec::replace1(int n, int &f)
{
ELEM x, tmp;
x.rd = 3;
... | ALGO | 0.999918 | 3.225024 |
e4de0685-a9ec-4e80-83cf-3d63ff1f65e0 | davidp918/VISolver | src/vis/functions/nlp.cpp | #include "nlp.h"
namespace vis
{
NLP::NLP(const VIPData &data, Solution *solution)
: vipd_(data), solution_(solution), n_(static_cast<Ipopt::Index>(data.n))
{
x_sol_.resize(n_);
}
void NLP::set_objective(std::function<void(const Vec &, Number &)> F,
std::fun... | ALGO | 0.998156 | 6.189662 |
5c307fb5-1aed-431d-b6b5-1039a9a9ffd8 | kbidzhiev/Random_perturbation | code/quantum_measurement.cpp | #include "itensor/all.h"
#include "observables.hpp"
using namespace itensor;
using namespace std;
void RandomUnitary2sites(MPS& psi, const SiteSet &sites, const int j, Args args){
auto j0 = siteIndex(psi, j);
auto j1 = siteIndex(psi, j+1);
auto T = randomITensor(j0,j1,prime(j0),prime(j1));
auto W = T + swapTags(d... | ALGO | 0.945992 | 3.297944 |
5299b43a-1c66-4b21-8906-24dbdefa3a04 | Saphal-Thammu/Leet-Code-solutions | subsets/subsets.cpp | // //Normal Recursion
// //when dont chose is first and then chose.
// class Solution {
// vector<vector<int>> result;
// public:
// vector<vector<int>> subsets(vector<int>& nums) {
// if(nums.empty()) return result;
// helper(nums,vector<int> {},0);
// return result;
... | ALGO | 0.999906 | 5.918986 |
a5911d69-4afe-44c6-a379-3b974dda2bc0 | ishandutta2007/codeforces | krk/normal/359/A.cpp | #include <cstdio>
using namespace std;
int n, m;
int best = 4;
int main()
{
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++) {
int num; scanf("%d", &num);
if (num == 1 && (i == 0 || i == n - 1 || j == 0 || j == m - 1))
best = 2;
}
printf("%d\n", best);
return 0;
} | ALGO | 0.999799 | 3.232945 |
f2737cb0-22e7-43b0-ba59-0eb341a20f4e | pkg-ime/libpinyin | src/lookup/pinyin_lookup.cpp | #include "pinyin_lookup.h"
#include <math.h>
#include <assert.h>
#include "stl_lite.h"
#include "novel_types.h"
#include "pinyin_phrase2.h"
#include "ngram.h"
#include "winner_tree.h"
using namespace pinyin;
const gfloat PinyinLookup::bigram_lambda = LAMBDA_PARAMETER;
const gfloat PinyinLookup::unigram_lambda = 1 - L... | ALGO | 0.996913 | 5.727645 |
d256b5f2-9d25-428f-bc0a-d46ad3415a16 | AYUSHNSUT/CSES | Geometry/chull.cpp | #include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define DEBUG(x) cerr << '>' << #x << ':' << x << endl;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
#define all(c) ... | ALGO | 0.999969 | 4.691842 |
a76cb8dc-4e3c-4f9c-ad24-87112c1ed99d | rahulsingh36/DSA | Stacks/deleted_middle_element_from_stack.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(stack<char> &inputstack, int count,int size){
//base case
if(count == size/2){
inputstack.pop();
return;
}
int num = inputstack.top();
inputstack.pop();
// recursive call
solve(inputstack,count+1,size);
inputstac... | ALGO | 0.999898 | 4.945387 |
05936261-0c50-4abe-bf9d-7b962bb77cd8 | GoWest279/ORAM_SLAM_ROS_Odroid_N2 | A00opencv-3.4.3/modules/core/src/hal_internal.cpp | #include "hal_internal.hpp"
#ifdef HAVE_LAPACK
#include <complex.h>
#include "opencv_lapack.h"
#include <cmath>
#include <algorithm>
#include <typeinfo>
#include <limits>
#include <complex>
#include <vector>
#define HAL_GEMM_SMALL_COMPLEX_MATRIX_THRESH 100
#define HAL_GEMM_SMALL_MATRIX_THRESH 100
#define HAL_SVD_SM... | TOOL | 0.991331 | 6.766641 |
11a9b37a-e5a3-4058-893e-3168d00eae00 | saurabhkumar2001/CPP_PRACTICE | loop control/primenumber.cpp | #include <iostream>
using namespace std;
main()
{
int skj = 0;
int num;
cout<<"Enter the number!! "<<endl;
cin>>num;
if (num == 0 || num == 1)
{
cout << "the number is not prime" << endl;
}
for (int i = 2; i < num; i++)
{
if (num%i== 0)
{
skj = 1;
... | ALGO | 0.998299 | 3.012612 |
ea42de7d-7175-425a-ac5d-d819eb741789 | Shinichi0713/Reinforce-Learning-Study | robo-study/humanoid/examples/SoftDemo/SoftDemo.cpp | ///btSoftBody implementation by Nathanael Presson
#include "btBulletDynamicsCommon.h"
#include "BulletSoftBody/btSoftRigidDynamicsWorld.h"
#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h"
#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
#include "LinearMath/btQuickprof.h"
#in... | TOOL | 0.974496 | 5.840566 |
a5441ee3-d1ae-435f-971a-8e0acb5e8262 | parasguglani1/competitive_coding | Codechef/long challenge/Jan2023/Minimize_the_Maximum.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#define ff first
#define ss second
#define int long long
using ll = long long;
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define mod 1000000007
#define inf 1e18
#define PI 3.1415926535897932384626
#define ps(x,... | ALGO | 0.999912 | 4.401534 |
5a225edd-f8e2-4b09-b370-f6eeb02fb8ce | qhb1001/For-that-dream | 紫书/第九章 dp/hcx/UVa1626.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;
string s;
int d[105][105];
int T,n;
bool Match(char a,char b){
if(a=='['&&b==']')return true;
if(a=='('&&b==')')return true;
return false;
}
void dp(){
for(int i=0;i<n;i++){
d[i+1... | ALGO | 0.999137 | 4.471669 |
0bf83ebd-f538-4295-8b83-ac15f952425f | bmzhong/dev | luogu/luogu2/1387.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int n, m, a[101][101], dp[101][101], res = 0;
inline int min(int x, int y, int z)
{
int t = x > y ? y : x;
return t > z ? z : t;
}
int main()
{
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; ++j)
... | ALGO | 0.999986 | 3.446743 |
31840953-235c-48e5-8ef3-f4392a69f8ba | lucas-prtt/Practica | C++-Practica/2023/P6 - Arrays/Ejercicios/Ej1.cpp | #include <iostream>
#include <stdio.h>
#include <conio.h>
using namespace std;
void output(int[], int);
void input(int[], int);
int max(int[], int);
main(){
int q = 30;
int array[q];
input(array, q);
cout<<endl<<endl<<"Numero maximo: "<< max(array, q);
getch();
return 0;
}
int max(int v[], ... | ALGO | 0.942517 | 3.84714 |
6b885504-3189-4e6d-a3bd-1f02ecfd30f9 | YeungShaoFeng/FIlesBackUps | VS 2019/C++/OOP/struct_TO_OOP/struct_TO_OOP.cpp | #include <iostream>
#include "head.h"
using namespace std;
int main()
{
Circle Cobj; Rectangle Robj;
Cobj.r = 3; Robj.length = 4; Robj.width = 5;
// cin >> Cobj.r >> Robj.length >> Robj.width;
cout << "The area of the circle is: " << Cobj.CArea() << ". " << endl;
cout << "The perimeter of the circle is: " << Co... | TOOL | 0.883903 | 3.386149 |
8d019d45-acb5-4349-8ccc-25343f4e26e6 | YangWoomin/CodingTestPrep | CodingTestPrep2/merge_two_arrays.cpp |
#include "sort_test.h"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
static std::vector<int> solution1(std::vector<int> arr1, std::vector<int> arr2)
{
std::vector<int> res;
int i = 0, j = 0;
while (i < arr1.size() && j < arr2.size())
{
if (arr1[i] < arr2[... | ALGO | 0.996255 | 5.453862 |
200d7e84-2ed5-4891-89a4-22a02ca7c1a2 | lulunlnl/BOJ | 1028/main.cpp | #include "bits/stdc++.h"
using namespace std;
int arr[800][800], dp[800][800];
int main() {
cin.tie(0)->sync_with_stdio(0);
int R, C; cin >> R >> C;
for (int i = 0; i < R; i++) {
string S; cin >> S;
for (int j = 0; j < C; j++) {
arr[i][j] = S[j] - '0';
}
}
// 대각선... | ALGO | 0.999401 | 3.104796 |
cf2fbfa9-489f-4223-8301-4d9280f5a588 | EdgarSls/CIS-5CSC-5-42829 | HelloWorld_V1/main.cpp | #include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
char playerOne;
char playerTwo;
cout << "Player 1: Enter R for rock, P for paper, or S for scissors: " << endl;
cin >> playerOne;
cout << "Player 2: Enter R for rock, P for paper, or S for scissors: " << endl;
cin ... | ALGO | 0.873118 | 3.638059 |
4f7d4af7-1fe6-4c0d-90d4-a6fde7fb3788 | kyeah/Cloth-Fluids-Solver | cloth/eigen_3.2.2/blas/double.cpp | #define SCALAR double
#define SCALAR_SUFFIX d
#define SCALAR_SUFFIX_UP "D"
#define ISCOMPLEX 0
#include "level1_impl.h"
#include "level1_real_impl.h"
#include "level2_impl.h"
#include "level2_real_impl.h"
#include "level3_impl.h"
double BLASFUNC(dsdot)(int* n, float* x, int* incx, float* y, int* incy)
{
... | ALGO | 0.997722 | 4.855024 |
f2d62ad6-04dd-4d88-8f87-38c2c970a009 | tanvi56463/Leetcode | 0938-range-sum-of-bst/0938-range-sum-of-bst.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.999997 | 6.605621 |
03fb0238-fb36-40e7-ae2e-6a395b7e8ec2 | almasluffy/Algorithm-and-data-structures | Projects/Week2/Examples/1.cpp | #include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include<cmath>
using namespace std;
int main()
{
int a[5];
for(int i=0;i<5;i++)
{
a[i] = rand();
}
int mx = a[0];
int mn = a[0];
for(int i=1;i<5;i++)
{
mx = max(mx,a[i]);
mn = min(mn,a[i]);
}
cout<<mx<<" "<<... | ALGO | 0.99989 | 3.314876 |
0d6b6c85-2fdc-4673-84f9-502dae173cb6 | linuxdeepin/deepin-ocr-plugin-manager | src/paddleocr-ncnn/utility.cpp | #include <dirent.h>
#include <utility.h>
#include <iostream>
#include <ostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <vector>
namespace PaddleOCR {
std::vector<std::string> Utility::ReadDict(const std::string &path)
{
std::ifstream in(path);
std::string line;
std::vector<std::string> m_ve... | DATA | 0.883965 | 5.343906 |
a714bd99-3c0c-4e00-8313-647c487f7a2a | alexandraback/datacollection | solutions_5751500831719424_1/C++/Azras/A.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n;
string arr[100];
int all[100];
vector<char> vec;
vector<int> pos;
int ans;
bool succ;
void getMin() {
int meAns = 1000000000;
for (int qq = 1; qq <= 100; qq++) {
int now = 0;
for (int i = 0; i < n; i++) {
now += abs... | ALGO | 0.999964 | 4.56092 |
d2d11f43-ac1f-4d9b-a4e2-27763f2f3249 | Anuragtiwari7485/cpp | class_template.cpp | #include<iostream>
using namespace std;
template<class T>
class vector{
T num1,num2;
public:
void set_data(T n1,T n2){
num1 = n1;
num2 = n2;
}
void check(){
if(num1>num2){
cout<<num1 <<" is greater than "<<num2<<endl;
}
else
{
... | ALGO | 0.993669 | 3.453416 |
ce3e649b-456d-45f9-824d-e381e1825a5d | Ryugene/AOC | 2022/04/1.cpp | #include <bits/stdc++.h>
using namespace std;
bool containinterval(pair<int,int> i1, pair<int,int> i2) {
if (i1.first >= i2.first && i1.second <= i2.second)
return true;
return false;
}
pair<int,int> parseinput(string in) {
int n1;
int n2;
string n = "";
int i = 0;
while (in[i] !=... | ALGO | 0.999576 | 4.360031 |
ff041e74-68e3-432e-9353-65fea094f65c | JustLouispace/Code | CSS223/HW/HW2/HW2_2.cpp | #include <iostream>
using namespace std;
class Polynomial
{
private:
Polynomial *next;
int coefficient;
int exponent;
public:
Polynomial(Polynomial *next = NULL)
{ // O(1)
this->next = next;
}
Polynomial(int coefficient, int exponent, Polynomial *next = NULL)
{ // O(1)
t... | ALGO | 0.99933 | 3.923634 |
58135bbc-6b44-452a-a40d-0f00e552010e | Gownta/RayTracer | lib/algorithms.cpp | #include "algorithms.hpp"
#include "program_options.hpp"
#include <cassert>
///////////////////////////////////////////////////////////////////////////////
// Bounding Surfaces
///////////////////////////////////////////////////////////////////////////////
static double EXTRA = 1e-5;
// find the minimum bounding sph... | ALGO | 0.999391 | 3.184339 |
45c541de-1601-44e8-889e-7b0e8e6aa4cb | huytan29/CTDL_pTIT | CTDL_PTIT/DSA03007.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define MOD 1000000007
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
int a[n], b[n];
for (int i = 0; i < n; i++) cin >> a[i];
... | ALGO | 0.999979 | 3.409059 |
1542ce20-1074-47d2-b6cc-491f6aad0788 | nawngs/CompetitiveProgramming | VNOI/stone.cpp | #pragma GCC optimize ("O2")
#include <bits/stdc++.h>
#define int ll
#define ll long long
#define ld long double
#define fi first
#define se second
#define pll pair < ll, ll >
#define pii pair < int, int >
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const string NAME = "";
const... | ALGO | 0.999463 | 3.863572 |
7706d9e5-3c7a-4d15-a791-93ff850ba9ea | fUuiyaa/lab18 | lab18_1.cpp | #include<iostream>
using namespace std;
struct Rect{
double x,y,w,h;
};
double overlap(Rect R1, Rect R2){
double xstart = max(R1.x,R2.x);
double xend = min(R1.x+R1.w,R2.x+R2.w);
double ystart = min(R1.y,R2.y);
double yend = max(R1.y-R1.h,R2.y-R2.h);
double w = xend-xstart;
double h = ystart-yend;
if(w>0&&h>0... | TOOL | 0.975179 | 3.572769 |
7860a0bf-9bcb-48ca-8c3b-da109bc9e47e | crimson000000/OIcode | CF/CF576E.cpp | #define LOCAL
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef long double ld;
inline ll read()
{
ll x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' ... | ALGO | 0.999997 | 4.112994 |
757666f7-afdc-455c-b259-c95f891fdf52 | old-yan/leetcode-solutions | leetcode_solutions/leetcode_450/429/429.cpp | #include "utils.h"
class Solution {
#define Node MultiTreeNode//提交时注释本行
public:
vector<vector<int>> levelOrder(Node* root) {
vvi ans;
queue<Node*>Q;
if(root)Q.push(root);
while(int l=Q.size()){
vi temp;
while(l--){
auto p=Q.front();
... | ALGO | 0.999902 | 5.974206 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.