uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
bd538bcc-a3a5-410e-922e-61b908549670 | yuvraj0502/DSA | stack/stackOperation.cpp | #include<bits/stdc++.h>
using namespace std;
#define n 100;
class stack{
int* arr;
int top;
public:
stack(){
arr=new int[n];
top=-1;
}
void push(int value){
if(top==n-1){
cout<<"stack is overflow:"<<endl;
return;
}
top++;
... | ALGO | 0.990014 | 3.713161 |
9a79dcf5-3c77-4363-863e-8c6d659c0e2b | SETHJI01/DSA | Sorting/bubbleSort.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fin for(int i=0;i<n;i++)
#define ff first
#define ss second
#define vi vector<int>
#define vc vector<char>
#define vii vector<int,int>
#define pb push_back
#define mp make_pair
void bubbleSort(int arr[],int n){
for(int i=0;i<n;i++){
for(int j=... | ALGO | 0.999933 | 3.779864 |
0d381d06-3c38-47aa-b8db-840f02c1eeef | fjiyt/daily-algorithm | ICT 코테/6.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
vector <vector<int>> textQueries(vector<string> sentences, vector <string> queries)
{
vector <vector<int>> answer(queries.size(), vector<int>());
unordered_map <string, vector <int>> hash;
for(int i=0; i<sentences.size();... | ALGO | 0.997456 | 4.683717 |
3f22a35f-a142-4fad-86e7-f6c7b68a102a | KseniaKhmelnk/INF442-Connected-Components | gen_data/gen_dmatrix_data.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include "../kosaraju/kosaraju.hpp"
#include "../dbscan/dbscan.hpp"
using namespace std;
const bool IDX_0 = true; // if nodes ids start from 1 and not 0
const bool REINDEX = true; // if nodes ids are not in range [0, n-1] ou [1, n]
int main()... | ALGO | 0.999412 | 4.910117 |
80ea59d9-83f7-452c-84d2-9bf678e3d0a4 | PrazaVasNeema/story-of-my-BAMCS | CPP_NUMERICAL_ANALYSIS/1_semester/4/Source.cpp | #include <iostream>
#include <math.h>
using namespace std;
#define Y1(x) pow(x,3)/3
#define Y2(x) pow(x,3)/3*(1+pow(x,4)/21)
#define Y3(x) pow(x,3)/3*(1+pow(x,4)/21+2*pow(x,8)/693+pow(x,12)/19845)
void main()
{
double a = 0, b = 2, step = 0.2;
bool f = 1;
cout << "X: \n";
for (double i = a; i <= b; i ... | ALGO | 0.989906 | 3.071095 |
d34aed7e-56ff-4b6a-a08b-78c8156a371e | ryul99/algorithm-study | C++/boj/boj1992.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//https://www.acmicpc.net/problem/1992
int check_value(int arr[][100], int le... | ALGO | 0.999431 | 4.339171 |
5bab39c5-ed03-4b14-be43-84038122c46a | ChipenkoMaxim/Exercises | chap2/2-3/reverse.cpp | #include <iostream>
using namespace std;
int main() {
for(int i = 0; i < 4; i++) {
for(int j = 0; j < (14 - (i + 1)) - i; j++) {
cout << " ";
}
for(int j = 0; j < i + 1; j++) {
cout <<"#";
}
cout << "\n";
}
return 0;
} | ALGO | 0.993103 | 3.373631 |
5cf02756-b8a4-42dc-ac1a-8a3f3498330e | jhlee1108/algorithms | baekjoon-online-judge/14625/14625.cpp | #include <cstdio>
int main() {
int ans = 0;
int s_h, s_m, e_h, e_m, n;
scanf("%d %d %d %d %d", &s_h, &s_m, &e_h, &e_m, &n);
while(s_h != e_h || s_m != e_m) {
int x = s_h / 10;
int y = s_h % 10;
int a = s_m / 10;
int b = s_m % 10;
if(x == n) ans++;
else ... | ALGO | 0.999424 | 3.754991 |
de13aa23-7f10-4eea-a7a7-cbaab7006be8 | aryan-gupta/PrimeFinder | ov/Runner.cpp | /*
*/
#include <cstdlib>
#include <string>
#include <sstream>
#include <iostream>
using namespace std;
template < typename T > std::string to_string( const T& n )
{
std::ostringstream stm ;
stm << n ;
return stm.str() ;
}
int main() {
for(int i = 1; i < 11; ++i) {
std::strin... | TOOL | 0.991891 | 3.370799 |
cb835795-2970-42fe-a414-56b59991438f | YoungsunCho/Algorithm_HidatoPuzzle | generator/HidatoGenerator.cpp | #include "HidatoGenerator.h"
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <malloc.h>
using namespace std;
HidatoGenerator::HidatoGenerator() {
// Point 클래스를 사용하여 각 방향 잡아주기
// 0 ~ 8 : nw ~ se 시계방향으로 direction배열에 저장
Point nw(-1, -1); // NW
Point n(-1, 0... | ALGO | 0.995116 | 5.022585 |
40123096-acb4-4129-bcc2-2c3d7e51f9dd | annereinarz/ExaHyPE-Workshop-Engine | Submodules/Peano/cookbook/chapter-4.2.6/multigrid/mappings/AdditiveMG.cpp | #include "multigrid/mappings/AdditiveMG.h"
#include "multigrid/mappings/JacobiSmoother.h"
#include "multigrid/VertexOperations.h"
/**
* @todo Please tailor the parameters to your mapping's properties.
*/
peano::CommunicationSpecification multigrid::mappings::AdditiveMG::communicationSpecification() {
return pean... | ALGO | 0.929133 | 6.180094 |
6a1b41cb-14f8-49ff-9154-fb7842eacdc6 | gnolp/DSA | chuyen tu ds canh sang ds ke.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int test; cin >> test;
while(test--){
int dinh,canh;
cin >> dinh >> canh;
vector<vector<int>> a(dinh+1);
int dd,dc;
while(canh--){
cin >> dd >> dc;
a[dd].push_back(dc);
a[dc].push_back(dd);
}
for(int i = 1; i <= dinh; i++){
cout... | ALGO | 0.999463 | 3.829934 |
19fced53-4f3d-4358-803c-c1cd80769f1e | Johannyjm/c-pro | AtCoder/asa/2020/asa1005/d.cpp | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<int> a(n);
int mn_a = 100... | ALGO | 0.999852 | 4.289819 |
6fd54651-98c9-43d5-a63b-eb216f6415ed | snl-dakota/dakota-packages | trilinos/packages/rol/example/PDE-OPT/navier-stokes/example_04.cpp | /*! \file example_04.cpp
\brief Shows how to solve the stochastic Navier-Stokes problem.
*/
#include "Teuchos_Comm.hpp"
#ifdef HAVE_MPI
#include "Teuchos_DefaultMpiComm.hpp"
#endif
#include "ROL_Stream.hpp"
#include "Teuchos_GlobalMPISession.hpp"
#include "Teuchos_XMLParameterListHelpers.hpp"
#include "Tpetra_Co... | ALGO | 0.99819 | 4.727567 |
8051efac-2582-47f9-90e4-25ec90b0823c | TranBaLoi/DSA_PTIT | DuongDiVaChuTrinhEULERVoiDoThiVoHuong.cpp | #include<bits/stdc++.h>
using namespace std;
int deg[1005];
int V, E;
vector<int> a[1005];
void solve()
{
bool flag1 = true;
bool flag2 = true;
int cnt = 0;
for(int i = 1; i <= V; i++)
{
deg[i] = a[i].size();
if(deg[i] % 2 == 1)
{
flag2 = false;
cnt+... | ALGO | 0.999804 | 4.661452 |
2c09f58e-f14e-4d00-9852-204205dd5fda | stg0123/baekjoonlearn | basic/baekjoon1004.cpp | #include <iostream>
using namespace std;
class find_uni{
private:
pair<int,int> p1,p2;
public:
find_uni(){
std::cin >> p1.first >> p1.second;
std::cin >> p2.first >> p2.second;
};
bool cal_in(pair<int,int> point1,pair<int,int> point2,int rnd){
int dx= point1.first-point2.first;
... | ALGO | 0.998652 | 4.124333 |
62212b08-08da-428a-a670-6d33fcaa7ae6 | Akashchintakindi/CPP | recursion/Fibonacci.cpp | #include <iostream>
using namespace std;
int fibon(int n) {
if (n == 0 || n == 1) {
return n;
}
return fibon(n-1) + fibon(n-2);
}
int main() {
// Loop from 0 to 5 and print each Fibonacci number
for (int i = 0; i <= 5; i++) {
cout << fibon(i);
// Add comma and space for all... | ALGO | 0.999825 | 5.623368 |
72deeae2-80c2-4367-9b04-f676ece8b7b3 | jjitch/AtCoder | ABC_from001to100/ABC014/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
int N;
cin >> N;
char previous = ' ';
unordered_set<string> us;
bool first = false;
bool second = false;
bool found = false;
for (int i = 0; i < N; i++)
{
string w;
cin >> w;
if ... | ALGO | 0.99982 | 4.237856 |
ea42f0d9-c3bb-4e1c-8828-a2d12bdbd769 | Syeeraaaa/CircularQueuesArray_0222 | CircularQueuesArray.cpp | /**
* @mainpage Documentation circular Queues
*
* @section Introduction
* project ini merupakan project struktur data
* menggunakan struktur data queues dengan pendekatan circular arrays.
*
* @section Operations
* - en queue for insert element into queues
* - de queue for delete elements from queues
* - sh... | ALGO | 0.994894 | 5.635994 |
fed56e1e-80f2-41ff-a395-051bd7baecce | ucczs/AoC_2023 | 11_cpp/11_02/11_02.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
typedef std::vector<char> row_t;
typedef std::vector<row_t> map_t;
constexpr long long int expansion_rate = 1000000;
void printMap(map_t map) {
for (row_t row : map) {
for (char c : row) {
... | ALGO | 0.998913 | 6.150299 |
52d5a151-ecad-4207-89f2-23103c6ee48a | byhj/Algorithm | Practice/Basic/Magical String.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string str;
cin >> str;
for (char ch : str) {
cout << char(26-(ch-'a') + 'a'-1);
}
cout << endl;
}
return 0;
}
| ALGO | 0.999695 | 4.33847 |
4dca62dc-eddc-4226-bf79-68d0db2c4f8b | veenits123/SDE-Sheet | BBT counter.cpp | // never the same!!
#include <iostream>
#include <cstdio>
#include <cmath>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <iomanip>
#include <cassert>
#include <string>
#include <cstring>
#include <queue>
using namespace std;
/*ϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕ*/
... | ALGO | 0.999976 | 4.581656 |
457146bf-9fc9-41ef-8af2-cb3c0361d894 | Astrophilic/Daily-Cpp-Problems | 1_06_2018/bytecoins.cpp | #include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
//#define mp make_pair
#define ll long long
#define ull unsigned long long
#define all(a) a.begin(),a.end()
#define BitCnt(a) __builtin_popcountll(a)
#define MEM(a,val) memset(a,val,sizeof(a))
#define pul pair<ull,ull>
#define pl pair<ll,l... | ALGO | 0.999836 | 3.94378 |
4399f3a0-6f85-44db-b875-3d85269e4373 | bjbjkidrock/LeetCode-1 | Algorithms/maximum-length-of-repeated-subarray.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int findLength(vector<int>& A, vector<int>& B) {
int sz1 = A.size(), sz2 = B.size(), i, j, result = 0;
if (sz1 == 0 or sz2 == 0) {
return 0;
}
vector<vector<int>> C(... | ALGO | 0.999868 | 5.577941 |
bdd40f7a-8003-479f-839e-6f6804558657 | TimoSaemann/caffe-enet | examples/cpp_classification/classification.cpp | #include <caffe/caffe.hpp>
#ifdef USE_OPENCV
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#endif // USE_OPENCV
#include <algorithm>
#include <iosfwd>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#ifdef USE_OPENCV
using names... | DATA | 0.959481 | 7.695897 |
cba5671d-40d7-46b7-a4a6-af7d7a27f22b | KevinGaldeano/Practicas-C-358930 | Practicas-C++-358930/Practica19.cpp | //Calcular raiz cuadrada a un valor con una libreria
#include <iostream>
#include "Raiz.h"
using namespace std;
int main()
{
int x;
cout <<"Ingresa un numero : " <<endl;
cin >>x;
cout <<"Su raiz cuadrada es : " << Raiz(x) <<endl;
cout <<"Su cuadrado es : " << C2(x) <<endl;
return 0;
} | TOOL | 0.993645 | 3.231711 |
a1b9f837-81c7-4228-886f-b4d381aa3c35 | ducanh2706/Advanced-Programming-INT2210 | Function/bai1.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
const int dx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
void generateMines(int m, int n, int K, int mines[][10]) {
while (K > 0) {
int x = rand() % m;
int y = rand() % n;
if (m... | ALGO | 0.998206 | 4.092231 |
f39c89f6-fde3-4737-8da3-117545d573a8 | objLew/UniYear2 | AVL_BinaryTree.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
class BinaryTree{
public:
int value;
BinaryTree* left;
BinaryTree* right;
BinaryTree(int value){ //Constructor
this->value = value;
this->left = NULL;
this->right = NULL;
}... | ALGO | 0.999929 | 4.54553 |
c91186b6-ad13-4f13-ab19-c8c3806a031a | RaviDeepu/atomicCPP | random/sizeoftree.cpp | #include <stdio.h>
#include <stdlib.h>
#include<iostream>
#include<stack>
using namespace std;
/* A binary tree node has data, pointer to left child
and a pointer to right child */
struct node
{
int data;
struct node* left;
struct node* right;
};
... | ALGO | 0.999979 | 4.71612 |
9e29b6ae-233b-4bc8-b325-53cb387086d5 | SOHAIL-CODE2/programming-cpp-language | patternForLoop/Question_8.cpp | // print the given pattern?.
// A
// A B
// A B C
// A B C D
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"enter num : ";
cin>>n;
for(int i=1; i<=n; i++){
for(int j=1; j<=i; j++){
cout<<(char) (j+64)<<" ";
}
cout<<endl;
}
}
| ALGO | 0.99714 | 3.803904 |
f4b69fce-6fe5-4932-979b-259126d88c8b | shkk941111/Algorithms | bubble_sort/bubble_sort_ver_1.cpp | #include <iostream>
using namespace std;
//void sort();
void findmax();
void swap();
void printo();
int arr[] = {7,5,2,4,3,1,9,8,6};
int main()
{
//sort();
for(int k=(sizeof(arr)/sizeof(int)-1);k>0;k--)
{
findmax();
}
printo();
}
/*//bubble sort
void sort()
{
for(int k=(sizeof(arr)/sizeof(int)-1);k>0;k--)
... | ALGO | 0.999707 | 4.141468 |
0579d8ad-b6ba-4284-a734-e7d6052f01ac | andrewei1316/OJSubmit | DATASOURCE_POJSubmit/1562/1562_20141223-222257_720K_16MS_AC.cpp | /*=============================================================================
# Author: He Shuwei
# Last modified: 2014-12-20 20:32
# Filename: a.cpp
# Description:
=============================================================================*/
#include <map>
#include <cmath>
#include <queue>
#include <stack>... | ALGO | 0.999887 | 3.775438 |
ffb90569-f41a-4c45-99b7-f664f1c0ba57 | gihop/AlgorithmStudy | Programmers/Programmers/멀쩡한_사각형.cpp | #include <iostream>
using namespace std;
//규칙을 알아내면 쉽게 풀어낼 수 있는 문제.
//answer = (long long)w * h; 에서 (long long)으로 미리 형변환을 해주지 않으면
//w * h 연산을 한 후에 형변환이 일어난다. 여기서 w와 h는 범위가 1억까지 포함되므로 overflow가
//발생할 수 있기 때문에 미리 형변환을 해야한다.
//유클리드 호제법을 이용하여 최대공약수를 구한다.
//a%b를 나머지 연산하고, 나머지가 0인 경우 b가 최대공약수,
//0이 아닌 경우는 a에 b값을 넣고, b에 나머... | ALGO | 0.999779 | 4.61648 |
b9ada703-fb72-41ce-8b96-3637fcab1bbc | VaishnavMankar/C-Plus--Pogramming | LeetCode 75 (ISSC)/7problem_448_2.cpp | //448.Find All Numbers Disappeared In An Array
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
vector<int> res;
for(int i = 0; i < nums.size();i++){
int curr = abs(nums[i]);
// nums[curr-1] = -ab... | ALGO | 0.99979 | 4.918516 |
83246620-864e-4516-bc6e-ac2e17c55f7d | Pri-27ya/Codeforces-Questions | A_Beautiful_Year.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int y,a,b,c,d;
cin >> y;
while (true)
{
y = y+1;
a = y / 1000;
b = y / 100 % 10;
c = y / 10 % 10;
d = y % 10;
if (a != b && a != c && a != d && b != c && b != d && c != d)
{
bre... | ALGO | 0.997889 | 3.20616 |
cdce0d7b-8801-4103-9896-315e8649cd23 | nerdyabhi/C-Plus-Plus | arrays/vectors/searching/ceilingOfaNumber.cpp | #include <iostream>
#include <vector>
using namespace std;
int ceil(vector <int> arr ,int target)
{
int s = 0 , e = arr.size() - 1 , ans = -1;
while (s <= e)
{
int mid = s + (e-s)/2;
if(arr[mid]>= target )
{
ans = mid;
e = mid -1;
}
else
{
... | ALGO | 0.999797 | 5.346399 |
69f6ea9e-5c60-4c51-b051-a7ebd64bf66c | rehmanghani2/LAB-8-Programming | Q10.cpp | /*10. Write a program in C to find the LCM of two numbers using recursion. */
#include <stdio.h>
int lcm(int ,int); //declaration
main()
{
int n1,n2,numer,denom; //numer=numerator denom=denominator
int LCM;
printf("Enter any two numbers:\n");
scanf("%d %d",&n1,&n2);
if(n1>n2)
{
numer=n1;
denom=n2;
}
else
... | ALGO | 0.999766 | 4.750502 |
7d75cf90-6dfc-49b0-a62c-bc720b81f88e | jedis/jedioutcast | CODE-mp/Splines/q_shared.cpp | // q_shared.c -- stateless support routines that are included in each code dll
#include "q_shared.h"
/*
============================================================================
GROWLISTS
============================================================================
*/
// malloc / free all in one place for debuggi... | TOOL | 0.9209 | 5.652329 |
5bc8a223-4ddc-46ae-891b-fb8f68d02b6d | TrainingAfternoon/CinCity | Jonny/NAPC2021/Day4Contest/BinomialCoefficients2.cpp | //
// Created by Jonny Keane on 8/12/21.
//
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define V vector
#define vi V<int>
#define vll V<ll>
#define vd V<double>
#define pii pair<int, int>
#define pll pair<ll,ll>
#define vpii V<pii>
#define vpll V<pll>
#define graph V<vi... | ALGO | 0.999639 | 5.014863 |
1150f64d-a97b-414c-8ef3-7ee0d3fb2ab4 | mbhs/mbit | archive/2022s/solutions/ParkPasses.cpp | // int max = 2 147 483 647 (2^31-1)
// ll max = 9 223 372 036 854 775 807 (2^63-1)
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < n; i++)
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define MOD 1000000007
typedef long long ll;
typedef long double ld... | ALGO | 0.999866 | 4.164424 |
9cab8702-8e94-4420-ab28-6faa2158c7cd | ozzwoy/SPOS-Course | lab1/boost_1_74_0/libs/graph/example/interior_pmap_bundled.cpp | #include <boost/config.hpp>
#include <iostream>
#include <algorithm>
#include <boost/graph/adjacency_list.hpp>
#include <boost/property_map/property_map.hpp>
#include <string>
using namespace std;
using namespace boost;
/*
Interior Property Map Basics
An interior property map is a way of associating properties
... | ALGO | 0.999696 | 5.011118 |
23c2c45a-9b87-40d6-aef8-7c6182ea19e1 | pritamnikam/CodingInterviewPreparation | PriorityQueue/kSmallestElement.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int KthSmallestElement(vector<int>& nums, int k) {
priority_queue<int> maxHeap;
for (int n : nums) {
maxHeap.push(n);
if (maxHeap.size() == k)
maxHeap.pop();
}
return maxHeap.top();
}
| ALGO | 0.999878 | 4.942101 |
b2c35677-6048-4c97-9cee-f60f7d68b216 | Keshari818/LeetCode | 0112-path-sum/0112-path-sum.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.999969 | 6.247232 |
34a78f8a-6a91-41aa-b396-f21d181ea854 | liangkang233/leetcode-cpp | 1163.按字典序排在最后的子串.cpp | /*
* @lc app=leetcode.cn id=1163 lang=cpp
*
* [1163] 按字典序排在最后的子串
*/
#include <iostream>
#include <string>
using namespace std;
// @lc code=start
class Solution {
public:
string lastSubstring(string s) {
string ans, ans1;
int j = 1;
char max = 'a' - 1;
for (int i = 0; i < s.size... | ALGO | 0.999938 | 6.228294 |
059cff58-1186-4c0a-a3ef-d5d556db8e6f | Jackarain/avhttp | boost/libs/proto/example/calc3.cpp | #include <iostream>
#include <boost/mpl/int.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/min_max.hpp>
#include <boost/proto/core.hpp>
#include <boost/proto/context.hpp>
#include <boost/proto/transform.hpp>
namespace mpl = boost::mpl;
namespace proto = boost::proto;
using proto::_;
// Will be used to define... | ALGO | 0.952565 | 7.659606 |
7cf0b031-06cf-41a1-8c00-b23a9f75a751 | ywRichard/C_CPP | cpp/15_5_overload_and_or.cpp | #include "stdafx.h"
#include <iostream>
using namespace std;
class Test {
int i;
public:
Test(int i) {
this->i = i;
}
Test operator+(const Test &obj) {
Test ret(0);
cout << "执行 + 号重载函数" << endl;
ret.i = i + obj.i;
return ret;
}
bool operator&&(const Test &obj) {
cout << "执行&&重载函数" << endl;
retur... | TEST | 0.926175 | 4.211929 |
ade17832-9754-4092-a659-f82b49791d01 | Houziyingbi/HOU | src/chainparams.cpp | #include "assert.h"
#include "chainparams.h"
#include "main.h"
#include "util.h"
#include <boost/assign/list_of.hpp>
using namespace boost::assign;
struct SeedSpec6 {
uint8_t addr[16];
uint16_t port;
};
#include "chainparamsseeds.h"
//
// Main network
//
// Convert the pnSeeds6 array into usable address ... | CONFIG | 0.902232 | 6.413817 |
ab3d1067-53c9-40df-9c89-a2569a8e3d53 | WenqiJiang/spatial-join-on-FPGA | FPGA_BFS/BFS_multi_PE_v3.2_2_PE/src/executor.cpp | #include "constants.hpp"
#include "DRAM_utils.hpp"
#include "join_PE.hpp"
#include "types.hpp"
extern "C" {
void executor(
///// input /////
int max_level_A,
int max_level_B,
int root_id_A,
int root_id_B,
int page_bytes,
int max_entry_num, // set during indexing
// input streams
// ... | ALGO | 0.99732 | 3.644405 |
4ef70dab-98c4-4640-b834-1131b83f7a54 | theargcoder/LeetCode | cpp/problem_id_152/main.cpp | #include <climits>
#include <math.h>
#include <utility>
#include <vector>
class Solution
{
public:
int
maxProduct (std::vector<int> &nums)
{
const int n = nums.size ();
if (n == 1)
return nums[0];
int max = INT_MIN, min = INT_MAX;
int tmpmax = 1, tmpmin = 1;
double abs = 1.0;
fo... | ALGO | 0.999821 | 5.873299 |
406ff6d6-195a-4927-9470-a51faa5d4c17 | krishnakishored/cpp-hinweis | Problems/HR/containers_hr.cpp | #ifndef IOSTREAM
#define IOSTREAM
#include <iostream>
#endif
#ifndef FSTREAM
#define FSTREAM
#include <fstream>
#endif
#ifndef VECTOR
#define VECTOR
#include <vector>
#endif
#ifndef STRING
#define STRING
#include <string>
#endif
#include<algorithm>
#include<iterator>
#include <iomanip>
using std::string;
using std... | ALGO | 0.999001 | 4.074634 |
2ccd8541-8bdf-461a-8a7c-17c0e3237780 | yinzixuan126/my_udacity | src/CarND-MPC-Quizzes/polyfit/src/Eigen-3.3/unsupported/doc/examples/MatrixSinh.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXf A = MatrixXf::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXf sinhA = A.sinh();
std::cout << "sinh(A) = \n" << sinhA << "\n\n";
MatrixXf coshA = A.cosh();
std::cout << "cosh(A) = \n"... | ALGO | 0.97371 | 5.890235 |
ca923912-db61-416d-be54-6b121565a043 | Varinderr/Basic-Programs | linkedlist.cpp |
#include <iostream>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
struct node
{
int data;
node *next;
};
struct node *head = NULL;
void insert_begin(int d)
{
node *temp =new node();
if(head==NULL)
{
temp->data=d;
temp->next=NULL;
... | ALGO | 0.99754 | 3.085897 |
f425d01a-d4b5-41dc-8509-a355e8ccb73e | geekpradd/USACO-Solutions | beads.cpp | /*
ID: pradd1
PROG: beads
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
ofstream fout ("beads.out");
ifstream fin ("beads.in");
int N;
fin >> N;
string beads;
fin >> beads;
if(beads.length() != N)
// either this or we could throw a fatal error
... | ALGO | 0.999637 | 4.001714 |
dac987b2-23e0-4379-bcec-bdff7fac8639 | capnmav77/Core-Programming | STL/DSA/DP/Interleaving String.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=CfzP4oXxZTI
Company Tags : Microsoft, FactSet, Google, Zillious, Yahoo
Leetcode Link : https://leetcode.com/problems/interleaving-string/
*/
************************************ C++ *******************************... | ALGO | 0.983945 | 6.105101 |
bbf7c664-5fd4-4212-aea7-00f7af0c5a66 | hari9608/LeetCode | Easy/1. Two Sum.cpp | /*
1. Two Sum
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
Example 1:
Input: nums = [2,7,1... | ALGO | 0.999701 | 6.355147 |
53e75898-8285-4ff1-a039-c605a723e773 | ishandutta2007/codeforces | vml/normal/573/A.cpp | #include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <ctime>
#include <memory.h>
#include <set>
#include <map>
#include <iomanip>
#include <queue>
#include <vector>
#include <unordered_set>
using namespace std;
int main() {
int n;
scanf("%d", &n... | ALGO | 0.99997 | 3.780571 |
b3d7057b-8c59-424c-8578-9b8911d5bf85 | Md-Minhajul-Islam/Phitron | XPSC_Batch_3/Week_05/G_T_8.cpp | // Q: https://www.codechef.com/problems/WARRIORCHEF
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t; cin >> t;
while(t--)
{
int n, h; cin >> n >> h;
long long a[n], total = 0;
for(int i = 0; i < n; i++) cin >> a[i], total += a[i];
long long l = 0, r = total, a... | ALGO | 0.999917 | 4.027536 |
051aecaf-d9ed-4556-8ed9-2bb20a7c484a | Im-Rises/physical-engine-webgl | PhysicalEngine/ParticleContact/ContactGenerator/ParticleLink/ParticleRode.cpp | #include "ParticleRode.h"
ParticleRode::ParticleRode(Particle *particle1, Particle *particle2, float length) : ParticleLink(particle1,
particle2) {
m_length = length;
}
int ParticleRode::addContact(ParticleContact *p... | TOOL | 0.939269 | 4.659631 |
5413a7a9-132b-4811-a245-fc583bb41e57 | AMAN-349/Daily-Problem-Leetcode | 2238-a-number-after-a-double-reversal/a-number-after-a-double-reversal.cpp | class Solution {
public:
bool isSameAfterReversals(int num) {
if(num==0) return true;
return num%10?true:false;
}
}; | ALGO | 0.99996 | 5.880899 |
1bbaeb13-3903-420b-88ed-4b173d0971c6 | guzman1203/Simple-Double-Circular-Linked-List | slinkedlist-class/SingleLinkedList.cpp | #include <iostream>
#include <string>
using namespace std;
class Node {
public:
Node() { next = nullptr; }
private:
int data;
Node* next;
friend class SLinkedList;
};
class SLinkedList {
private:
int numNodes;
Node* head;
public:
SLinkedList();
~SLinkedList();
void addBack(int x);... | ALGO | 0.999679 | 5.116236 |
caa6c37f-9daa-4bdb-b121-b86bff0a98b3 | LetsGrowMoreCommunity/DSA-Playyard | Matrix/02_MagicSquare.cpp | /* Magic square */
// A magic square is an arrangement of numbers (usually integers) in a square grid, where numbers in the forward and backward main diagonals, all add up to the same number. Write a program to find whether a given matrix is a magic square or not.
#include <iostream>
using namespace std;
int main()
{... | ALGO | 0.999974 | 5.66684 |
b2403f2e-cd25-4610-ba05-6df6c2d865a5 | hasib-24/DSA | Tree/13-BinaryTree.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int d)
{
this->data = d;
this->left = right = nullptr;
}
};
Node *AddChild(Node *&node, int value)
{
if (node == nullptr)
{
return new Node(value);
}
... | ALGO | 0.999966 | 4.756361 |
16ac5ef1-a9a9-40e7-872d-6d2fc6cd9b37 | Asif01933/Algo_Ds | graph/weired_connections.cpp | class Solution {
public:
void dfs(int i,vector<bool>&vis,vector<vector<int>>&adj){
vis[i]=true;
for(auto v:adj[i]){
if(vis[v]==0){
dfs(v,vis,adj);
}
}
}
int makeConnected(int n, vector<vector<int>>& g) {
if(g.size()<n-1){
re... | ALGO | 0.999959 | 5.885957 |
5a9aee44-a951-45c2-8d9b-b02c365ee66c | kmyobin/baekjoon | 연속합 1912/연속합 1912/연속합 1912.cpp | #include <iostream>
#include <climits>
#include <cmath>
using namespace std;
int N; int A[100001];
int R[100001]; // R[i] = i° ִ
int ans;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> N;
for (int i = 1; i <= N; i++)
{
cin >> A[i];
R[i] = A[i];
}
ans = R[1];
for (... | ALGO | 0.999895 | 4.145793 |
cd3bf168-34f4-4924-8aa6-0eee13d5db41 | cosc4740fa23/os_prog3_files | example/semaphore_buffer.cpp | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <thread>
#include <unistd.h>
#include <semaphore.h>
using namespace std;
int max_num = 20;
sem_t full,empty,multex;
int buffer[10], bufferc = 0;
int consumern =1, producern=1;
/*
* uses just semaphores for everything.
*/
void produc() {
int i,eid,... | ALGO | 0.998174 | 4.190858 |
e91ff5f5-3793-4162-a851-42e5991a9f84 | ishandutta2007/codeforces | cephian/normal/1629/D.cpp | #include <bits/stdc++.h>
using namespace std;
string flip(const string& s) {
string t = s;
reverse(t.begin(), t.end());
return t;
}
bool solve() {
int n;
cin >> n;
vector<string> s(n);
for(int i = 0; i < n; ++i)
cin >> s[i];
set<string> two;
for(int i = 0; i < n; ++i) {
if(s[i].size() == 2) {
if(two.c... | ALGO | 0.999851 | 5.294794 |
0306421c-7785-40c8-8354-edafb7a023f8 | aayush2761/Leetcode_prob | 0572-subtree-of-another-tree/0572-subtree-of-another-tree.cpp | class Solution {
public:
void computeZArray(string& s, vector<int>& z) {
int n = s.size();
int l = 0, r = 0;
for (int i = 1; i < n; i++) {
if (i <= r) {
z[i] = min(r - i + 1, z[i - l]);
}
while (i + z[i] < n && s[z[i]] == s[i + z[i]]) {
... | ALGO | 0.999851 | 5.720238 |
6f107acd-055b-466a-a262-5733bea1fb1d | Milky2018/Data-Structure-Homework | 练习3.25.cpp | #include <iostream>
using namespace std;
int F(int n)
{
if (n == 0)
return 1;
else
return n * F(n / 2);
}
int f(int n)
{
int product = 1;
while (n != 0) {
product *= n;
n /= 2;
}
return product;
}
int main()
{
int n;
cin >> n;
cout << f(n) << endl << F(n) << endl;
return 0;
} | ALGO | 0.999862 | 4.03249 |
c40a7aaa-ec4f-47b4-acbe-0a59af4a6e47 | SubhangiSati/Daily-DSA-Cpp | 0037-sudoku-solver/0037-sudoku-solver.cpp | class Solution {
public:
void solveSudoku(vector<vector<char>>& board) {
solve(board, 0);
}
private:
bool solve(vector<vector<char>>& board, int s) {
if (s == 81)
return true;
const int i = s / 9;
const int j = s % 9;
if (board[i][j] != '.')
return solve(board, s + 1);
fo... | ALGO | 0.998667 | 7.436737 |
21ab86c4-cca5-4625-84e4-fe8f639e9b4f | Sumit11Rawat/DSA-topics | Dynamic Programming/3-House Robber.cpp | class Solution {
public:
int chk(vector<int>&nums,int k,vector<int>&dp){
if(k>=nums.size()){
return 0;
}
if(k==nums.size()-1){
return nums[k];
}
if(dp[k]!=-1){
return dp[k];
}
int incl=chk(nums,k+2,dp)+nums[k];
int excl=chk(nums,k+1,dp);
dp[k]=max(incl,excl);
... | ALGO | 0.999903 | 5.69297 |
984d64aa-9075-4c6b-a297-f35bdbbbae6b | namhai0510/C-- | C--/KDC.cpp | #include <bits/stdc++.h>
using namespace std;
#define nothing ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define ll long long
#define ull unsigned long long
#define fi first
#define se second
#define pb push_back
const ll oo = 1e13;
const ll mod = 1e9 + 7;
const int maxn = 1e6;
... | ALGO | 0.999941 | 4.373831 |
060991d2-7b00-4788-99ad-166bb62442b3 | gabriel-candeia/Competitive-Programming-Solutions | URI/2854.cpp | #include<bits/stdc++.h>
#define N 500
using namespace std;
int bfs(vector<int> adj[N], int n){
int cc=0, top=0, z;
int stack[N], visited[N];
for(int i=0;i<=n;i++){
visited[i] = false;
}
for(int i=1;i<=n;i++){
if(visited[i]==false){
cc++;
stack[top++] = i;
... | ALGO | 0.999918 | 4.32009 |
b6eb49d0-a896-4356-831c-ec7c40ad34f2 | manuelTorrealba/tofu | src/core/parallel/reconstruct/reconstruct/pointFieldReconstructorReconstructFields.cpp | #include "parallel/reconstruct/reconstruct/pointFieldReconstructor.hpp"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>>
Foam::pointFieldReconstructor::reconstructField(const IOobject& fie... | TOOL | 0.868789 | 6.12574 |
7cfa9279-4362-4a21-8271-12005becc2fe | VijayNegi/LeetHub | 2439-minimize-maximum-of-array/2439-minimize-maximum-of-array.cpp | class Solution {
public:
int minimizeArrayValue(vector<int>& nums) {
long result=nums[0],n=nums.size();
long sum=nums[0];
for(int i=1;i<n;++i){
sum+=nums[i];
result = max(result,(sum+i)/(i+1L));
}
return result;
}
}; | ALGO | 0.999973 | 5.880564 |
a1775f84-a17a-470b-abbd-607332a6224e | vsr625/coding-solutions | codeforces/61-E/solution.cpp | #include <bits/stdc++.h>
using namespace std;
//Enemy is Weak
#define int long long
const int N = 1e6 + 6;
int power[N], power2[N];
map<int, int> reducedValues;
int segmentTree[N*4] = {0};
int lazy[N*4] = {0};
void update(int start, int end, int idx, int qs, int qe) {
if(lazy[idx] != 0) {
segmentTree[idx] +... | ALGO | 0.999813 | 3.802304 |
9ef2fb6b-49c1-4b06-9b22-9836aaf7d8ee | MrishikaNair/Computer-Graphics | Raytracing/code_A4/src/triangle.cpp | //triangle.cpp
#include "triangle.h"
bool checkposi(double value){
if(value>0){
return true;
}
else{
return false;
}
}
bool Triangle::intersect(Ray& ray) const
{
const float epsi = 0.0000001;
//Triangle vertices
Vector3D v0(-10,0,-11);
Vector3D v1(6,0,-11);
Vector3D v2(-2,8,-11);
Ve... | ALGO | 0.980818 | 6.097641 |
85578b98-2112-4c8e-8350-cf2de3df6f0a | xela6134/leetcode | 226/invert_binary_tree.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include "TreeNode.h"
TreeNode* invertTree(TreeNode* root) {
if (not root) return nullptr;
std::queue<TreeNode*> queue;
queue.push(root);
while (not queue.empty()) {
TreeNode* node = queue.front();
queue.pop();
std... | ALGO | 0.999817 | 5.445973 |
598711f6-1110-49a8-a9d5-b746c5a5dda3 | chenjie97/cpp_learn | C++05/08-STL-容器-list.cpp | #include<iostream>
using namespace std;
#include<list>
/*
list(链表)
STL中的链表是一个 双向循环链表
*/
void printList(const list<int> &L){
for (list<int>::const_iterator it = L.begin(); it != L.end(); it++)
{
cout<<*it<<" ";
}
cout<<endl;
}
//list的初始化方式
void test01(){
/*
* `list<T> lst;` ... | ALGO | 0.920158 | 4.236113 |
456ae276-0b8d-4157-b951-674ebc5039f2 | donaghyXu/PAT | PAT乙级(Basic Level)/B1002.cpp | #include <cstdio>
#include <cstring>
const int maxn = 105; //maxnΪ105Դ100
int main() {
char num[maxn];
char numToChinese[10][5] = {"ling", "yi", "er", "san", "si", "wu", "liu", "qi",
"ba", "jiu"};
int res[3];
int sum = 0, cnt = 0;
scanf("%s", num);
int len = strlen(num); //ַij
for(int i = 0; i < len; i+... | ALGO | 0.999779 | 3.660923 |
802fc412-4dde-46ac-addd-0eb965cf187a | Tangroots/ame | c++5.cpp | #include <bits/stdc++.h>
using namespace std;
class Submission
{
public:
int tid,pid;
string s,t;
void in();
};
void submission::in(){
cin>>tid>>pid>>s>>t;
}
int clatime(string time)
{
int h,m;
h=(time[0]-'0')*10+time[1]-'0';
m=(time[3]-'0')*10+time[4]-'0';
return (h-9)*60+m;
}
class Problem
{
public:
bo... | ALGO | 0.986581 | 4.250329 |
62925ac8-3045-4dcb-924e-da22fc983cb3 | Avdh512/LeetCode | Daily POTD/Day34/373. Find K Pairs with Smallest Sums Answer.cpp | #define pp pair<int, pair<int, int>>
class Solution {
public:
vector<vector<int>> kSmallestPairs(vector<int>& nums1, vector<int>& nums2, int k) {
int n1 = nums1.size();
int n2 = nums2.size();
vector<vector<int>> ans;
// Create a min-heap to store pairs of indices and the... | ALGO | 0.999997 | 6.23284 |
b66f20b1-96c1-48bd-8972-3af164cc4f2b | DRL-CASIA/ICV-book | Chapter_5/Open-RL-Torcs/torcs-1.3.7/src/drivers/inferno2/common.cpp | #include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <tgf.h>
#include <track.h>
#include <car.h>
#include <raceman.h>
#include <robot.h>
#include <robottools.h>
#include "common.h"
static tdble VI[10];
static tdble
Spline(tdble p0, tdble p1, tdble pos, tdble start, tdble end)
{
tdble t2, t3;
td... | ALGO | 0.99737 | 3.36489 |
8ec5b5b6-66ad-451f-88d7-f99a4594c97e | matumoto1234/cp-crawler | AtCoder/agc037/agc037_a/6963852.cpp | // detail: https://atcoder.jp/contests/agc037/submissions/6963852
#include<stdio.h>
#include<string.h>
int main(void){
int len,i,co=0;
char s[200001];
scanf("%s",s);
len=strlen(s);
for(i=0;i<len;i++){
if(s[i]!=s[i+1]){
co++;
}
else{
i++;
}
}
printf("%d",co);
return 0;
}
| ALGO | 0.999866 | 3.323992 |
2eae955a-a562-49c6-b088-a1a0cd60b3e1 | mfornet/icpc-ref | src/string/suffix_tree_shrink.cpp | template<typename T>
struct suffix_tree
{
const static int inf = 2e9;
vector<T> s;
vector<map<T, int>> next;
vector<int> spos, len, link;
int node, pos, last;
ll distinct; // shrink
int node2, pos2, leaves;
vector<int> parent;
suffix_tree() { make_node(0), node = pos = distinct = node2 = pos2 = le... | ALGO | 0.999451 | 4.359461 |
89df6b50-bead-436b-8ea9-811afc64aad4 | asincoin/asincoin | src/crypto/scrypt.cpp | #include "crypto/scrypt.h"
//#include "util.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <openssl/sha.h>
#if defined(USE_SSE2) && !defined(USE_SSE2_ALWAYS)
#ifdef _MSC_VER
// MSVC 64bit is unable to use inline asm
#include <intrin.h>
#else
// GCC Linux or i686-w64-mingw32
#include <cpuid.h>
... | ALGO | 0.986682 | 4.328618 |
233c0d76-2ec7-43c8-aae5-be343a4e5894 | SubharoopKabi/USCKIIT-Consistent-coding | Strings/3_printallsubsequencesofthestring.cpp |
#include <bits/stdc++.h>
using namespace std;
void printSubsequence(string input, string output)
{
if (input.empty()) {
cout << output << endl;
return;
}
printSubsequence(input.substr(1), output + input[0]);
printSubsequence(input.substr(1), output);
}
// Driver code
int main()... | ALGO | 0.999935 | 5.453516 |
3b6aa787-ee08-49da-86ac-d34ae37b1408 | EoinDavey/Competitive | Templates/LIS.cpp | int ls[MX_N];
int L[MX_N];
int I[MX_N];
void nlogn(){
for(int i = 1; i < N+1; ++i)
I[i]=INF;
I[0] = -INF;
int mx = 1;
for(int i = 0; i < N; ++i){
int ind = lower_bound(I,I+N+1,ls[i]) - I;
I[ind] = ls[i];
L[i] = ind;
mx = max(mx,ind);
}
int prv = INF;
... | ALGO | 0.999985 | 3.539114 |
25a193d0-fd91-4ea5-ae9b-1f1671a93ec7 | kogepanh/book-algorithm | section13/04.cpp | #include <iostream>
#include <vector>
using namespace std;
using Graph = vector<vector<int>>;
// 深さ優先探索
vector<bool> seen;
void dfs(const Graph &G, int v) {
seen[v] = true; // v を訪問済にする
// v から行ける各頂点 next_v について
for (auto next_v : G[v]) {
if (seen[next_v]) continue; // next_v が探索済だったらスルー
dfs(G, next_v... | ALGO | 0.999997 | 6.328379 |
a64bf845-8345-4b9f-87dc-7cd2058ad326 | alimran-dev/XPSC | Week_2/Day_2/H_Most_Similar_Words.cpp | #include<bits/stdc++.h>
#define ll long long int
#define endl "\n"
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
int n, m;
cin >> n >> m;
string arr[n];
for (int i = 0; i < n; i++)
{... | ALGO | 0.999903 | 4.556266 |
9b2f52a8-be10-492b-804a-7b4d0eec415d | Zero-Vec/cppACM | starryCoding/2024.7.22/C.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
int a, b;
cin >> a >> b;
ll ans = a;
int s = a;
while(s>=b){
ans += s / b;
int k = s / b;
s %= b;
s += k;
}
cout << ans << '\n';
}
int main()
{
ios::sync_with_stdio(0), cin.ti... | ALGO | 0.999935 | 4.082539 |
c30d1915-70d5-455b-a838-3e6cdf3a2c3f | AneekG8/DSA | ALGORITHM/Greedy/PICKING_UP_CHICKS.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int T;
cin>>T;
int test_case = 1;
while(T--)
{
int n,k,b,t;
cin>>n>>k>>b>>t;
int p[n],v[n];
for(int i=0;i<n;i++)
cin>>p[i];
for(int i=0;i<n;i++)
cin>>v[i];
int impossible = 0,swap... | ALGO | 0.999922 | 3.575806 |
1c60f393-2b58-4c7d-9012-ae9aeefe654f | it-is-it/Data-Structure-and-Algorithms | StructureAndfunctions.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
struct Rectangle
{
int length;
int breadth;
};
void initialize(struct Rectangle *r, int l, int b)
{
r->length = l;
r->breadth = b;
}
int area(struct Rectangle r)
{
return r.length * r.breadth;
}
int perimeter(Rectangle r)
{
int p;
... | TOOL | 0.947768 | 4.125605 |
f0faf89a-207e-41a0-834e-1c85b6164269 | cananella/baekjoonSolution | CPP/4386_constellation.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<cmath>
using namespace std;
int n;
vector<pair<float,float>> stars;
vector<pair<int,float>> grape[100];
int parents[100];
bool visited[100]={false,};
float findCost(pair<float,float> a, pair<float,float> b){
float r=sqrt(pow(a.first-b.first,2)+pow(a.sec... | ALGO | 0.999298 | 3.84755 |
340d70e6-9030-4849-bbfc-b5000d0d9bba | vfolunin/archives-solutions | UVa Online Judge/913.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
bool solve() {
long long n;
if (!(cin >> n))
return 0;
n = (n + 1) / 2;
long long last = 2 * n * n - 1;
cout << 3 * last - 6 << "\n";
return 1;
}
int main()... | ALGO | 0.992172 | 3.494597 |
e0671ac9-cf3e-43a3-9468-650f98f97b2c | RowerOjMateusza/grafikaUAM | dependencies/physx-4.1/source/geomutils/src/pcm/GuPCMContactBoxConvex.cpp | #include "geomutils/GuContactBuffer.h"
#include "GuGJKPenetration.h"
#include "GuEPA.h"
#include "GuVecBox.h"
#include "GuVecConvexHull.h"
#include "GuVecConvexHullNoScale.h"
#include "GuGeometryUnion.h"
#include "GuContactMethodImpl.h"
#include "GuPCMContactGen.h"
#include "GuPCMShapeConvex.h"
#define PCM_BOX_HULL_D... | ALGO | 0.996991 | 7.178792 |
14cba1b0-a73b-4fbd-8666-47c6c638a4ec | raincross7/code-similarity | codes/train_code/problem461/problem461_149.cpp | #include "iostream"
#include "vector"
#include "string"
#include "algorithm"
#include "math.h"
#include "cstring"
#include "stack"
#include "queue"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<vector<int> > mat;
int main()
{
int n;
cin >> n;
vec... | ALGO | 0.999966 | 3.476841 |
2a24a6e3-8308-4d2d-af6d-30fb51bd00b4 | kalininei/HybMesh | src/libs/bgeom2d/bgeom3d.cpp | #include "bgeom3d.h"
#include "hmcompute.hpp"
double Point3::sdist_plane(const Point3& p, const Point3& plane1, const Point3& plane2, const Point3& plane3){
Vect3 n = right_normal(plane1, plane2, plane3);
return vecDot(n, p-plane1);
}
namespace{
int pos1D(double x, double a, double b){
if (ISLOWER(x, a)) return -... | ALGO | 0.999212 | 6.279446 |
02002500-431f-49be-995d-8311255cd0a1 | finlay-liu/OJ | Lintcode/longest-words.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> longestWords(vector<string> &dictionary) {
vector<string> v;
int length = 0;
for (vector<string>::iterator i = dictionary.begin(); i != dictionary.end(); ++i)
if(length < (*i).size() )
... | CONFIG | 0.9982 | 4.450767 |
58cc5340-03f2-42b4-b26b-7fc3addfd855 | nader-grt/Problemsolvingwithcpp | level03/index37.cpp | #include <iostream>
#include <cmath>
#include <string>
#include <limits>
using namespace std ;
struct StBiggyBanckContent {
int Pinnes , Nickles ,Dimes ,Quarter ,Dollars ;
} ;
StBiggyBanckContent ReadBiggyBanckContent()
{
StBiggyBanckContent BiggyBanckContent ;
cout<<"\n Enter PlZ the number of P... | ALGO | 0.86309 | 3.866448 |
95ef76f3-a910-4a8c-aeee-2f85a1c9f89e | ishandutta2007/codeforces | shatovoleg/normal/1637/E.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define len(v) ((int)(v).size())
#define pb push_back
#define kek pop_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#defi... | ALGO | 0.999951 | 4.197131 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.