uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
8de64275-7d53-4b72-975f-e196a2474540 | Csiddhart/Supreme-DSA | love-bhaiya's-notes/queue class 2 codes/Stack 4 COdes/Stack 4 COdes/main (25).cpp | class Solution {
public:
int longestValidParentheses(string s) {
stack<int> st;
st.push(-1);
int maxLen = 0;
for(int i=0; i<s.length(); i++) {
char ch = s[i];
if(ch == '(') {
st.push(i);
}
else {
... | ALGO | 0.999958 | 5.906143 |
35cf06db-1d94-4ccf-9bf5-4c81475ded87 | Keyu-He/Enhancing-Debugging-Skills-of-LLMs-with-Prompt-Engineering | solutions_correct/algorithms/C/Coin Change II/Coin Change II.cpp | class Solution {
public:
int change(int amount, vector<int>& coins) {
vector<int> dp(amount + 1, 0);
dp[0] = 1; //there always 1 way to pay a amount of 0 that is => do not pay
for (int i = 0; i < coins.size(); i++) // taking one coin at a time to avoid the permutation
fo... | ALGO | 0.999956 | 6.082997 |
bd0d8a63-af95-433c-93ab-ea4e95a82afc | mateor/pdroid | android-2.3.4_r1/tags/1.2/frameworks/base/media/libstagefright/codecs/aacdec/mdst.cpp | /*
Filename: mdst.c
------------------------------------------------------------------------------
REVISION HISTORY
Who: Date: MM/DD/YYYY
Description:
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Int32 x ... | ALGO | 0.99952 | 5.990614 |
d6c85825-79a3-4ee9-bd10-feb3cbb844f6 | sach4008/Practice_cpp_dsa_cp | Code Forces/C_Inversion_Graph.cpp | #include<bits/stdc++.h>
#define mod 1000000007
#define ll long long
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
void solve(){
order... | ALGO | 0.999899 | 4.735184 |
beb3500f-e7e9-48ae-9b28-4fc0d71125c4 | zensen6/BOJ_350_solved-completed_code-partII | 25050_acm.cpp | #include<bits/stdc++.h>
#define INF 1000000000000000LL
using namespace std;
typedef long long ll;
int n,m;
ll d[5001], dist[2001][2001];
vector<pair<ll,ll>> adj[2001];
map<pair<int,int>,int> ma_;
bool dfs(int here, int start, int target){
if(here==target){
return true;
}
for(auto &p:adj[here]){
int nex... | ALGO | 0.999955 | 3.948926 |
d05c137d-706d-4b87-8f3f-ad582f3c4b64 | jackgao1540/dmoj-solutions | dwite07c2p1.cpp | #include <iostream>
#include <cmath>
using namespace std;
int isPrime[1005] = {0};
void findPrime(int n){
int d = sqrt(n) + 1;
for(int i = d; i > 1; i--){
if(n % i == 0){
isPrime[n] = 3;
return;
}
}
isPrime[n] = 1;
return;
}
void findSemiPrime(int n){
//have to see if is multiple of ... | ALGO | 0.999707 | 4.357751 |
88dc6e47-d19f-4abb-8640-549d2c6af251 | Hongweihuo-Lab/MSQ-Index | multiQuery.cpp | #include "multiQSTree.h"
int main(int argc, char *argv[])
{
if(argc < 5){cout << "parameter error: prefix query threshold k" << endl; return 0;}
string prefix = argv[1];
string query = argv[2];
int d = atoi(argv[3]);
int k = atoi(argv[4]);
struct timeval start,end;
float timeuse;
//suggestion: k = d/2;
k... | ALGO | 0.995252 | 3.419717 |
168c0b10-fd00-4a94-870c-49f46773670e | lingganh/thctdlgt | thctdlgtbai06.cpp | #include<bits/stdc++.h>
using namespace std ;
int nhap(vector<vector<int> >&array,int m,int n,string& filename){
fstream fp;
fp.open(filename.c_str(),ios::in);//c_str() de chuyen doi con tro
array.resize(m,vector<int>(n));
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
fp>>array[i][j]... | ALGO | 0.998793 | 3.297794 |
caadc05c-dc9f-4312-80da-4ea9d18ca87c | TallerDeLenguajes1/tpn2-MartinezMatiasMaximiliano | TP2_4.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
//declarar tipo de estructura "PC"
typedef struct{
int velocidad;
int anio;
int cantidad;
char *tipo_cpu;
}PC;
char tipos[6][10] = {"Intel", "AMD", "Celeron", "Athlon", "Core", "Pentium"};
//declarar funciones
void CargarPC(P... | TOOL | 0.852524 | 3.268974 |
7736aef7-cd24-48bd-af68-7face59d39b7 | jamperezmondragon/Selectivo-PES-2024-Marzo | pesSanta24p2/test validator/validator.cpp | #include<bits/stdc++.h>
using namespace std;
void terminate_program(){
int x = 0;
while(true){
x++;
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int N, T;
cin>> N>> T;
if(N < 1 || N > 2e5){
terminate_program();
}
if(T < 0 || T >... | ALGO | 0.999651 | 3.394444 |
f0a2981f-4284-4992-8d4f-36af574dded8 | KienPT0610/COPEPTIT | DSA/MuaLuongThuc.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef double db;
using namespace std;
//JohnBelus//
int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL); cout.tie(NULL);
int t; cin >> t;
while(t--){
int n, s, m; cin >> n >> s >> m;
if(n < m || 6*n < 7*m) {
// n < m -> s*... | ALGO | 0.999712 | 4.345174 |
dcf75e31-6c60-4190-bdf4-ef63e48f3cc4 | blcksec/oneAPI-samples | DirectProgramming/DPC++/Jupyter/oneapi-essentials-training/08_DPCPP_Reduction/src/multiple_reductions_buffers.cpp | using namespace sycl;
static constexpr size_t N = 1024; // global size
static constexpr size_t B = 128; // work-group size
int main() {
queue q;
std::cout << "Device : " << q.get_device().get_info<info::device::name>() << "\n";
//# initialize inputs and outputs
std::vector<int> data(N);
for (int i = 0; i <... | ALGO | 0.999171 | 4.128214 |
61bb9972-bacd-482f-bd4b-2a4244be9100 | Ryb7532/AtCoder | submissions/abc018/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0; i<(n); i++)
#define reps(i,s,n) for (int i=(s); i<(n); i++)
#define rep1(i,n) for (int i=1; i<=(n); i++)
#define print(a) cout << (a) << endl;
#define all(v) v.begin(), v.end()
int main() {
int A[3];
cin >> A[0] >> A... | ALGO | 0.999386 | 3.862916 |
536836fb-ee41-41ec-99ea-e400bdf07bcb | zhupailiangx/opencv4.8 | samples/cpp/tutorial_code/video/optical_flow/optical_flow.cpp | #include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/video.hpp>
using namespace cv;
using namespace std;
int main(int argc, char **argv)
{
const string about =
"This sample demonstrates Lucas-Kanade O... | ALGO | 0.9715 | 6.242239 |
45f694c6-3e35-411f-8c6c-1410c1c81503 | VipulChauhan89/CodeChef-Practice-Problems | Difficulty-rating-wise/500-difficulty-rating/Chef-and-Masks/masks.cpp | #include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int T,X,Y;
cin>>T;
while(T--)
{
cin>>X>>Y;
X*=100;
Y*=10;
cout<<((X<Y)?"Disposable":"Cloth")<<endl;
}
return 0;
} | ALGO | 0.976468 | 3.758451 |
6d03341a-4a0f-49d4-8a06-175f79bcd958 | XZeusJ/Leetcode | 538.convert-bst-to-greater-tree.cpp | /*
* @lc app=leetcode id=538 lang=cpp
*
* [538] Convert BST to Greater Tree
*
* https://leetcode.com/problems/convert-bst-to-greater-tree/description/
*
* algorithms
* Easy (52.41%)
* Likes: 1650
* Dislikes: 106
* Total Accepted: 105.4K
* Total Submissions: 196.7K
* Testcase Example: '[5,2,13]'
*
... | ALGO | 0.999954 | 6.593363 |
d00c351b-0d19-4c48-a223-6bb1313e80ed | martbudr/Olimpiada-Informatyczna | 4oi_rez.cpp | #include <bits/stdc++.h>
using namespace std;
void szybkie_sort(int lewy, int prawy, vector<pair<int,int>>& przedzialy)
// sortowanie przedzialow po koncach
{
if(lewy == prawy) return;
int i=lewy, j=prawy,
pivot = przedzialy[(lewy+prawy)/2].second;
do{
while(przedzialy[i].second < piv... | ALGO | 0.99991 | 5.388195 |
12aa30c1-5c98-4fda-b8a4-67aa9fb3138b | MrDonaldoWorking/big_integer | big_integer.cpp | #include "big_integer.h"
#include <cstring>
#include <algorithm>
#include <assert.h>
const uint32_t LOG2_BASE = 32;
// Removes redundant digits in data
void refresh(big_integer &a) {
while (a.data.size() > 1 && a.data.back() == 0) {
a.data.pop_back();
}
if (a.data.size() == 1 && a.data[0] == 0) ... | ALGO | 0.987252 | 5.597099 |
9178bfe0-c86d-4755-956d-b4ca2ae2b67b | HuntingSHEEP/TIO_merged | src/SIGK/GeneticAlgorithm.cpp | #include "SIGK/GeneticAlgorithm.h"
#include "GraphicsEngine/GetPointMatrix.h"
#include <random>
#include <ctime>
GeneticAlgorithm::GeneticAlgorithm(VulkanEngine* vkEngine, GeneticAlgorithmParams params){
srand(static_cast<unsigned int>(time(nullptr)));
this->params = params;
currentGeneration = 0;
//... | ALGO | 0.998104 | 4.438813 |
a5349344-508e-415d-ace7-9177bd9a6cd6 | anzeglusic/RIS | exercise6/src/planes.cpp | /**
* Makes all the non-planar things green, publishes the final result on the /planes topic.
*/
#include <iostream>
#include <ros/ros.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/ModelCoefficients.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#inclu... | ALGO | 0.9114 | 6.850778 |
92d07cec-ca91-4d65-882b-6102e8247fce | SuchanaNag002/Codeforces-and-Codechef | 1619_C.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll t,n,k,i,ans;
string s;
cin>>t;
while(t--)
{
cin>>n>>k;
cin>>s;
ans=0;
for(i=n-1;i>=0;i--)
{
if(s[i]=='1')
{
if(n-i-1<=k)
{... | ALGO | 0.99965 | 3.505466 |
4d1b8583-a5b2-4291-8546-f54226a375fb | Brent-rb/University | bachelor/operating-systems/5_2_FAC.cpp | #include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <list>
#include <stdlib.h>
void* fac(void *arg) {
int* ptr = (int*) arg;
int number = (*ptr);
int i;
unsigned long long total = 1;
for(i = 1; i <= number; i++) {
total *= i;
//Anders is het algoritme veel te fucking snel.
usleep(100000);
... | ALGO | 0.98948 | 4.127527 |
f8bd2e54-c348-4569-b71e-e6803f752e0e | ssashish21/Data-Structure-Algorithms | level1/12.Dynamic Programming/15count_encoding.cpp | #include<iostream>
using namespace std;
int main(){
string str;
cin>>str;
int n = str.length();
int dp[n+1] = {0};
dp[0] = dp[1] = 1;
//invalid
if(str[0]=='0') return 0;
for(int i = 2 ; i <= n; i++){
if(str[i-1] > '0')
dp[i] = dp[i-1];
if(s... | ALGO | 0.99987 | 3.88917 |
563ef15b-9721-4325-9563-4c1b97ae2fb3 | Abhiram-108/leetcode | 0237-delete-node-in-a-linked-list/0237-delete-node-in-a-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
void deleteNode(ListNode* node) {
node->val=node->next->val;
node->next=node->next->next;
}
}; | ALGO | 0.999834 | 5.407223 |
c8b72cc7-4e6e-4c92-bd20-f130369fbd09 | mayurpai/Coding | Bottomline_Technologies_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
int evenCount = 0;
int oddCount = 0;
cin >> N;
int j;
if (N % 2 == 0)
{
evenCount = 1;
}
else
{
oddCount = 1;
}
for (j = 1; j <= (N / 2); j++)
{
if (N % j == 0)
{
... | ALGO | 0.999913 | 4.835358 |
fcb993de-c43c-478c-801c-38d9d545ab7f | SinghRajan41/code | my_codeforces_solutions/singh_rajan41/normal/1823/A.cpp | #include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
using namespace std;
void solve();
ll add_mod_m(ll a, ll b, ll m);
ll sub_mod_m(ll a, ll b, ll m);
ll mul_mod_m(ll a, ll b, ll m);
ll div_mod_m(ll a, ll b, ll m);
ll extended_euclid(ll a, ll b, ll *x, ll *y);
ll binExp_Mod_M(ll a, ll b... | ALGO | 0.999945 | 3.711666 |
3d6d57f2-d880-4d77-bdc7-aeea8a2b6531 | haastregt/occlusion_tracking | occlusion_package/CGAL-5.5.2/examples/Surface_mesh_simplification/edge_collapse_envelope.cpp | #include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h>
#include <CGAL... | ALGO | 0.992859 | 5.227864 |
8a7796cb-befa-451d-9837-041cdc5d6a36 | ChoiKangwoo/BaekJoon_Problem | 분할 정복/BJ_분할 정복_1780_종이의 개수.cpp | #include <iostream>
#include <vector>
using namespace std;
int square_m1 = 0; //-1 簢
int square_0 = 0; //0 簢
int square_1 = 0; //1 簢
void cut(vector<vector<int>> &v, int start_r, int start_c, int size);
int main()
{
cin.tie(NULL);
int N;
cin >> N; // ũ
vector<vector<int>> v(N, vector<int>(N)); //int ... | ALGO | 0.99984 | 3.470049 |
7c8afd5a-9357-4ad5-9099-1c63bc2bc314 | jwseph/competitive-programming | cses/1702.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int val;
Node *left = nullptr, *right = nullptr;
};
const int N = 1e5+5;
int n;
int pre[N], idx[N];
stack<pair<int, Node*>> s;
void dfs(Node* node) {
if (!node) return;
dfs(node->left);
dfs(node->right);
cout << node->val << ' ';
}
... | ALGO | 0.999997 | 4.27815 |
fbb11ee5-5aa2-4e3c-8993-a1138938e7b1 | RexxarCHL/UR5_Plays_Jenga | jenga_calibrate/src/tower_location_broadcaster.cpp | /**
* Tower Location Broadcaster
* Infer the pose of the tower by averaging the pose of four AR markers.
* Author: Chia-Hung Lin (clin110[AT]jhu[DOT]edu)
* Date Created: 04/26/2018
*/
#include <ros/ros.h>
#include <tf/transform_listener.h>
#include <tf/transform_broadcaster.h>
#include <visualization_msgs/Marker.h... | TOOL | 0.963418 | 5.402587 |
77794451-7306-4355-935e-fe94a39f02e4 | yymin1022/Algorithm_Study | BOJ/1388.cpp | #include <bits/stdc++.h>
using namespace std;
bool isVisit[51][51];
char room[51][51];
int main(){
cin.tie(NULL);
cout.tie(NULL);
ios_base::sync_with_stdio(false);
int N, M;
cin >> N >> M;
for(int i = 0; i < N; i++){
string S;
cin >> S;
for(int j = 0; j < S.size(); ... | ALGO | 0.999871 | 4.903543 |
8112f488-8f53-4f2f-a60a-ac71852df82e | valderyaya/Competitive-Programming | TIOJ/1008.cpp | //#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#include<bits/stdc++.h>
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define F first
#define S second
#define REP(i,n) for(register int i=0;i<(n);++i)
#define REP1(i,a,b) for(register int i=(a... | ALGO | 0.999938 | 3.002781 |
e3231e19-32a9-4c28-818c-bd6cd0bc3f12 | starpiens/PS | BOJ/3644.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <fstream>
#include <random>... | ALGO | 0.999871 | 3.693784 |
33eb5209-13ec-4d73-b16f-8b6a25cac2b9 | pemesteves/AdventOfCode2020 | Day1/part1.cpp | #include <fstream>
#include <iostream>
#include <vector>
using namespace std;
int main() {
ifstream f;
f.open("input.txt");
vector<bool> v(2020, false);
int n;
while(!f.eof()) {
f >> n;
if(v[2020-n]) {
cout << n * (2020 - n) << endl;
break;
}
... | ALGO | 0.999512 | 4.903012 |
4d57c635-f790-4f15-9c08-c364aafa510f | makio93/competitive-othersites | LeetCode/Problems/DCC/2021/Jun/W2/D13/main0-2.cpp | #include <bits/stdc++.h>
using namespace std;
// 自力AC
using ll = long long;
class Solution {
public:
vector<vector<int>> palindromePairs(vector<string>& words) {
int n = words.size();
vector<string> strs = words, rstrs = strs;
for (int i=0; i<n; ++i) reverse(rstrs[i].begin(), rstrs[i].end(... | ALGO | 0.999745 | 5.694536 |
1c05d113-f727-44de-b3da-2f809de1f194 | algprasad/localization_boat_assisted | ThirdParty/Eigen/unsupported/doc/examples/MatrixPower_optimal.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
Matrix4cd A = Matrix4cd::Random();
MatrixPower<Matrix4cd> Apow(A);
std::cout << "The matrix A is:\n" << A << "\n\n"
"A^3.1 is:\n" << Apow(3.1) << "\n\n"
"A^3.3 is:\n" << Apow(3.3) << "\n\n"
... | ALGO | 0.998649 | 3.396939 |
a293657f-efc3-45f0-9f73-6c2ecc526872 | shernshiou/CarND | Term2/05-CarND-MPC-Project/src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,4);
Eigen::VectorXf v(2);
m << 1, 23, 6, 9,
3, 11, 7, 2;
v << 2,
3;
MatrixXf::Index index;
// find nearest neighbour
(m.colwise() - v).colwise().squaredNorm()... | ALGO | 0.999911 | 4.138078 |
48219427-8889-4903-a237-b4e5f62d0010 | nis/Numerical-Methods--RB-NUM6-U2-1-F12- | Code/Tools/NR_C301/legacy/nr2/CPP_211/recipes/rkdumb.cpp | #include "nr.h"
extern Vec_DP *xx_p;
extern Mat_DP *y_p;
void NR::rkdumb(Vec_I_DP &vstart, const DP x1, const DP x2,
void derivs(const DP, Vec_I_DP &, Vec_O_DP &))
{
int i,k;
DP x,h;
Vec_DP &xx=*xx_p;
Mat_DP &y=*y_p;
int nvar=y.nrows();
int nstep=y.ncols()-1;
Vec_DP v(nvar),vout(nvar),dv(nvar);
for (i=0;i<n... | ALGO | 0.999981 | 4.244332 |
ac6b76a4-1f42-4149-b9d6-e8f384c3ab07 | ishandutta2007/codeforces | sohsoh/normal/1271/C.cpp | /*
Soheil Mohammadkhani
I will change this text here when i've got "Expert" :)
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
#define all(x) (x).begin(),(x).end()
#define Sort(x) ... | ALGO | 0.999928 | 3.939036 |
26302db5-14e3-40dc-91e8-a5df2e5ecca5 | zilinli0130/leetcode_algorithm_solution | BFS/Basics/433. Minimum Genetic Mutation/433. Minimum Genetic Mutation.cpp | class Solution {
public:
int minMutation(string start, string end, vector<string>& bank) {
if (bank.size() == 0) {
if (start == end) {
return 0;
} else {
return -1;
}
}
unordered_set<string> visited;
... | ALGO | 0.999821 | 5.871448 |
98faf726-a50a-43f4-a318-3f9b8bfe44c5 | mateuszlewko/codeforces | contests/1023/d.cpp | #pragma region Template
#include <bits/stdc++.h>
using namespace std;
#define For(i, n) for (int i = 0; i < (n); i++)
#define ForD(i, n) for (int i = (n) - 1; i >= 0; i--)
#define SORT(x) sort(begin(x), end(x))
#define REP(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (e... | ALGO | 0.999996 | 3.491022 |
f39de232-ffef-49ed-983b-e5eb724a68ab | voucher-coin/voucher-coin | src/bloom.cpp | #include "bloom.h"
#include "hash.h"
#include "primitives/transaction.h"
#include "script/script.h"
#include "script/standard.h"
#include "streams.h"
#include <math.h>
#include <stdlib.h>
#include <boost/foreach.hpp>
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
#define LN2 0.69314718055... | ALGO | 0.963078 | 6.897142 |
c8923543-0c17-4411-ad11-22f102a38bc9 | Shashi8637/c-- | array/loopvector.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
vector<int>v;
v.push_back(10);
v.push_back(11);
v.push_back(12);
v.push_back(13);
v.push_back(10);
v.push_back(16);
int x=10;
int idx =-1;
for(int i=v.size()-1; i>=0; i--){
if(x==v[i]){
idx =i;
break;
}
}
cout<<idx<<" ";
... | ALGO | 0.999409 | 4.131161 |
50031e0c-357d-4f20-9f37-ec8c8e498dfb | TobiasWasheim/practical_programming_and_numerical_methods | Matrix/matrix.cpp | #include<iostream>
#include<cassert>
#include<vector>
#include<cmath>
#include"matrix.h"
/* Vector class methods */
const int vector::size() {
return elements.size();
}
void vector::print() {
for (int i = 0; i < elements.size(); i++) {
std::cout << elements.at(i) << "\n";
}
}
dou... | TOOL | 0.988759 | 5.159889 |
1d0f0895-140d-43b3-b23d-1a475b526cbd | rishabhjha05/CodeStruct | Module_20/Assignment_2/Ques_2.cpp | /*Q2. Reverse Pairs (Leetcode Problem) : Given an integer array nums, return the number of reverse
pairs in the array.
A reverse pair is a pair (i, j) where:
0 <= i < j < nums.length and
nums[i] > 2 * nums[j].
*/
#include <iostream>
#include <vector>
using namespace std;
string suffix(int i)
{
switch (i % 10)
... | ALGO | 0.999725 | 4.50217 |
ba47295e-dde8-47e7-9161-c31dede5f98b | nagisaShiyoto/cheatBlackJack | BlackJackCheat/BlackJack/dealer.cpp | #include "dealer.h"
#include "simulations.h"
#include <string>
#define LIMIT 21
#define TO_PRECENT 100
void dealer::gameUser()
/*
user playing the game
input:none
output:none
*/
{
int money = 100;
int bettingAmount = 0;
bool con = this->options(START, money);
int userSum = 0;
int dealerSum = 0;
while (con && mon... | ALGO | 0.937421 | 3.551483 |
f0bf0125-45bd-4427-b565-b96a11b6cb37 | vaibhavkrishanyadav/6Companies30Days | Company: Adobe/4.Partition_Equal_Subset_Sum.cpp | //4.Partition Equal Subset Sum
//https://practice.geeksforgeeks.org/problems/subset-sum-problem2014/1
class Solution{
public:
int equalPartition(int N, int arr[])
{
// code here
int sum = 0;
for(int i=0; i<N; i++){
sum+=arr[i];
}
if(sum%2 != 0){
r... | ALGO | 0.999972 | 4.947581 |
f1a63506-b0c4-45c8-837a-2880fa79033b | z1968579/csci241 | Assign2/hanoi.cpp | //***************************************************************************
//
// hanoi.cpp
// CSCI 241 Assignment 2
//
// Created by Jacob Rudawski z1968579
//
//***************************************************************************
#include <iostream>
#include <cstdlib>
#include <cctype>
#include <string>
... | ALGO | 0.9943 | 5.568041 |
7fa7bd97-ad34-4f31-a2f8-32db8fa7cabc | maqin/SRM | srm-157-div-2/GuessTheNumber.cpp | #include<iostream>
using namespace std;
class GuessTheNumber{
public:
int noGuesses(int upper, int answer){
int lower = 1;
int res = 0;
while(true){
res ++;
int mid = (lower+upper)/2;
if(mid == answer)
break;
if(mid > answer)
... | ALGO | 0.999437 | 4.283462 |
d12cbcb2-39d3-431c-9f84-a71789cb6181 | evertonmj/cpp_activities | binary_search.cpp | //binary_search.cpp
//http://www.spoj.com/problems/BSEARCH1/
// #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
int main() {
int n_elements, n_queries, number;
vector<int> elements;
scanf("%d%d", &n_elements, &n_queries);
for(int i = 0; i < ... | ALGO | 0.999928 | 5.783409 |
4f6a9012-a874-47ee-abbe-2dd21adde5bb | lauleehong/kattis | whatdoesthefoxsay.cpp | #include <bits/stdc++.h>
using namespace std;
/*
1
toot woof wa ow ow ow pa blub blub pa toot pa blub pa pa ow pow toot
dog goes woof
fish goes blub
elephant goes toot
seal goes ow
what does the fox say?
*/
int main() {
int num_TC;
string speech;
// freopen("test_input.txt", "r", stdin);
cin >> num_TC;
getline(... | ALGO | 0.98335 | 3.591471 |
c473f6a3-f6b7-4468-9de5-ccc62e6aa721 | rajveer-09/HustlerWorkspaceLeetcode | 3277-find-the-number-of-ways-to-place-people-ii/find-the-number-of-ways-to-place-people-ii.cpp | class Solution {
public:
int numberOfPairs(vector<vector<int>>& points) {
sort(begin(points), end(points), [](const auto& a, const auto& b) {
return a[0] != b[0] ? a[0] < b[0] : a[1] > b[1];
});
int result = 0;
for (int i = 0; i < size(points); ++i) {
for (in... | ALGO | 0.999833 | 5.98918 |
735d37b2-8589-47c8-8d23-30096028a423 | RainPPR/oi-archive | 20230225 CSP-J 模拟赛 3/T280910 水果.cpp | #include <cstdio>
#include <cmath>
using namespace std;
typedef long long ll;
int main()
{
ll n, c = 1, k;
scanf("%lld %lld", &n, &k);
ll d, cnt = 0;
while (n > 0)
{
d = ceil(n / (k * 2.0));
n -= d * k;
cnt += c * d;
c <<= 1;
}
printf("%lld", cnt);
return 0;
}
| ALGO | 0.999856 | 3.304288 |
7acb1ed7-9622-45be-b1d8-bed6d02a6b07 | abhi2666/Advance-Graph-C--- | camelcase.cpp | int camelcase(string s) {
int totalWords = 1;
for(char ch : s)
{
if(isUpper(ch)) totalWords++;
}
return totalWords;
} | ALGO | 0.996535 | 4.803452 |
fed92c9b-2957-4b81-848a-ef8bfe11f482 | KeweiQ/Computer-Graphics | a4/libigl/tutorial/712_DataSmoothing/main.cpp | #include <igl/read_triangle_mesh.h>
#include <igl/hessian_energy.h>
#include <igl/curved_hessian_energy.h>
#include <igl/massmatrix.h>
#include <igl/cotmatrix.h>
#include <igl/isolines_map.h>
#include <igl/parula.h>
#include <igl/vertex_components.h>
#include <igl/remove_unreferenced.h>
#include <igl/opengl/glfw/Viewer... | ALGO | 0.997594 | 6.513573 |
f34231f3-689d-4c41-abf8-102f3634470c | Sudhanwa11/Data-Structures-And-Algorithms-In-cpp | Linked List/Merge Sort Linked List/merge sort linked list.cpp |
Node *merge(Node *list1, Node *list2) {
if (list1 == nullptr) {
return list2;
}
if (list2 == nullptr) {
return list1;
}
Node *dummy = new Node(0);
Node *mergedList = dummy;
while (list1 != nullptr && list2 != nullptr) {
if (list1->data <= list2->data) {
... | ALGO | 0.999993 | 5.789784 |
c0627aee-dbb5-4e52-86ec-d181a233a0f9 | Javeria-ali/Program9-VS2019 | Program9-VS2019/Source.cpp | #include <iostream>
using namespace std;
void checkEvenOdd(int n) {
if (n % 2 == 0)
cout << n << " is Even" << endl;
else
cout << n << " is Odd" << endl;
}
int main() {
cout << "JAVERIA ALI" << endl << "BCY243018" << endl;
int num;
cout << "Enter number= ";
cin >> num;
checkE... | ALGO | 0.996485 | 4.761698 |
a8a372f7-e19e-46b8-b7f0-f448ca86a47a | mai-806/Delivery.Backend | deli-main/third_party/userver/shared/src/crypto/hash.cpp | #include <userver/crypto/hash.hpp>
#include <array>
#include <cryptopp/base64.h>
#ifndef USERVER_NO_CRYPTOPP_BLAKE2
#include <cryptopp/blake2.h>
#endif
#include <cryptopp/filters.h>
#include <cryptopp/hex.h>
#include <cryptopp/hmac.h>
#include <cryptopp/sha.h>
#include <userver/crypto/exception.hpp>
#include <crypt... | TOOL | 0.93025 | 7.680451 |
645ff031-5014-4471-8fef-3e9df8c0abbe | GreatFusion/Leetcode | code/detectCycle.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution{
bool isValidInput(ListNode *head)
{
if (!head)
return false;
else
return true;
}
public:
ListNode *detectCycle(ListNode *head) {
if (!isValidIn... | ALGO | 0.999828 | 5.058455 |
f6fdef97-7f03-4b0b-ae69-89c82f5101ea | alifalhasan/CP-code-vault | CodeChef/Practice/TREDIFF - Tree difference/33521308.cpp | #include<bits/stdc++.h>
using namespace std;
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
vector<vector<int> >up;
vector<int>adj[200005];
int l,timer,parent[200005],tin[200005],tout[200005],val[200005];
void dfs(int node,int par)
{
parent[node]=par;
tin[node]=++timer;
up[node... | ALGO | 0.999973 | 4.370098 |
8c4e4374-71f0-4144-ae8b-1a607b4a1959 | lanzheng1113/cpp | ds/TrieTree/testDrive.cpp | /*
* testDrive.cpp
*
* Created on: 2015年5月25日
* Author: wangdq
*/
#include <iostream>
#include <string>
#include "trie_array.h"
#include "trie_array.cpp"
int main() {
TrieTree<int> trie;
std::string keys[] = {"amy", "ann","emma", "rob", "roger"};
int values[] = {56,15,30,27,52};
for(int i=0;i < sizeof(v... | TEST | 0.974051 | 3.993706 |
1bb88b9c-78f4-44f0-b1f4-fbc8181ce323 | BhomikTomar/CP-DSA | 1000/monsters.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, k;
cin >> n >> k;
vector<int> arr(n);
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
vector<pair<int, int>> ans;
for (int i = 0; i < n; i+... | ALGO | 0.999872 | 3.570158 |
8805aba4-18f4-483d-bc6e-b0afa4168bf4 | anjaekwang/SW-Algorithm | An/완전탐색1/1107_리모컨.cpp | /*#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <math.h>
#include <algorithm>
#include <limits.h>
using namespace std;
int N, M, broken[10] = {0,};
int possible(int C)
{
int len = 0;
if (C == 0)
{
if (broken[C])return 0;
else return 1;
}
else
{
while (C > 0)
{
if (broken[C % 10])... | ALGO | 0.999851 | 3.431585 |
f6e6d0b3-51d6-4077-b283-957727a89e65 | fafa1899/BuildCppDependency | Source/boost-1.86.0/libs/compute/perf/perf_stl_unique.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | ALGO | 0.95229 | 5.888813 |
7dcd0057-8eed-4dd7-82ae-238baa5065d6 | mrdinesh-kushwaha/DSA | DSA'24/LinkedList/demo.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node* next;
// constructor default ->used to initialized the value
node()
{
this->data=0;
this->next=NULL;
}
// parameterazed constructor:
node(int data)
{
this->data=data;
... | TOOL | 0.970562 | 4.245887 |
955378db-1aa1-4d6e-adb5-3577c06cf888 | ishandutta2007/codeforces | littlebeetle/normal/1077/A.cpp | #include<cstdio>
int t,a,b,k;
int main(){
scanf("%d",&t);
while(t--){
scanf("%d%d%d",&a,&b,&k);
printf("%I64d\n",1ll*a*((k+1)/2)-1ll*b*(k/2));
}
return 0;
} | ALGO | 0.999662 | 3.59919 |
87391887-2375-4527-969f-33f5ad8ae2fe | ebubechi/learning_flutterhooks | 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 |
39d6a47c-cf2d-44c8-b741-957871456f1e | TKira4/Neutral-Network-and-Machine-Learning | Assignment2/Code/src/ann/functions.cpp | #include "ann/functions.h"
#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <limits>
xt::xarray<double> softmax(xt::xarray<double> X, int axis){
xt::svector<unsigned long> shape = X.shape();
axis = positive_index(axis, shape.size());
shape[axis] = 1;
xt::xarray<double> Xmax = xt:... | ALGO | 0.995286 | 6.073982 |
cd616762-1c26-4ce6-b067-bbb844002d8a | ishandutta2007/codeforces | peltorator/normal/997/C.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <queue>
#include <unordered_set>
#include <complex>
#include <unordered_map>
#include <bitset>
#include <ctime>
#include <cassert>
#include <random>
... | ALGO | 0.999972 | 4.356763 |
016f9863-df33-46b2-8b64-5e46719287eb | yogesh584/Data-Structures-and-Algorithm | Dynamic Programming/Youtube/questions/Combination Sum 4/Approach1.cpp | #include <iostream>
#include <vector>
using namespace std;
int solve(vector<int> &num, int tar)
{
if (tar == 0)
{
return 1;
}
if (tar < 0)
{
return 0;
}
int ans = 0;
for (int i = 0; i < num.size(); i++)
{
ans += solve(num, tar - num[i]);
}
return ans;... | ALGO | 0.999978 | 4.883544 |
42c1c10b-6817-4a89-a4bc-9f1d0ee2592e | kevmano/CS106A | BoggleWithExtensions/lib/StanfordCPPLib/dawglexicon.cpp | /*
* File: dawglexicon.cpp
* ---------------------
* A lexicon is a word list. This lexicon is backed by two separate data
* structures for storing the words in the list:
*
* 1) a DAWG (directed acyclic word graph)
* 2) a Set<string> of other words.
*
* Typically the DAWG is used for a large list read from a f... | TOOL | 0.9519 | 6.90251 |
96bf9919-1e4a-42c4-9167-290ef985b2d3 | azhangwei/leetcoe_one | Letter Combinations of a Phone Number.cpp | //#include <iostream>
//#include <string>
//#include <vector>
//
//using namespace std;
//
//vector<string> letterCombinations(string digits);
//void letter(string digits,vector<int>wei,int len,vector<string> phone,vector<string> &op);
//
//int main()
//{
// string aa="23";
// vector<string> n=letterCombinations(aa);
/... | ALGO | 0.999687 | 5.650365 |
3f61ff9a-e07f-469c-a795-903d7cf35556 | GabrielRibeiroRodrigues/Maratona | maratonas/codeforces/A. Medium Number.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define d(x) cout<<#x<<" = "<<x<<endl;
#define pb push_back
#define pf push_front
#define mp make_pair
#define f first
#define s second
#define r(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;... | ALGO | 0.999928 | 3.522662 |
fa4b2364-f5db-4496-8131-289e34fa69bd | AKASHCS50/C-CPP-Practice | Dynamic Programming/ugly_numbers.cpp | // https://www.geeksforgeeks.org/ugly-numbers/
#include<stdio.h>
int main()
{
int n, i, i2 = 0, i3 = 0, i5 = 0, count = 1, n2, n3, n5, next;
printf("Enter the number ");
scanf("%d", &n);
int ugly[n];
ugly[0] = 1;
while(count < n)
{
n2 = ugly[i2] * 2;
n3 ... | ALGO | 0.999921 | 3.696301 |
cd69159e-3177-4e98-a4f9-2ef7a7476b5f | JorgeA-OlivaresQ/ExamenCPAR_GPUs | DirectProgramming/C++SYCL/Jupyter/oneapi-essentials-training/01_oneAPI_Intro/lab/simple.cpp | using namespace sycl;
static const int N = 16;
int main(){
//# define queue which has default device associated for offload
queue q;
std::cout << "Device: " << q.get_device().get_info<info::device::name>() << "\n";
//# Unified Shared Memory Allocation enables data access on host and device
int *data = malloc... | ALGO | 0.93436 | 3.886199 |
f8faa449-cdd2-4f01-9077-4e0ec6e040ce | areian13/PS_BOJ | 3. Gold/Gold 4/[G4] 12786 INHA SUIT.cpp | #include <iostream>
#include <vector>
#include <climits>
#include <queue>
#include <algorithm>
#define FastIO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
using namespace std;
#define MAX_HEIGHT 20
struct Pos
{
int y, x, t;
};
int dy(int y, int i)
{
if (i == 0)
return y;
... | ALGO | 0.999686 | 4.522921 |
863d8b0c-6172-4ba3-8cbf-d7d53d83fd2c | sheiwangwo/stca_weekly_code | Week30/148.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* cut(ListNode* head, int n){
ListNode* p = head;
while(p && --n){
p = p->next;
}
... | ALGO | 0.999999 | 5.580715 |
65c138c8-4960-4bed-90ac-371da9fe9538 | titi-rex/42-cursus | webserv/src/parsing/parsing_utils.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parsing_utils.cpp :+: :+: :+: ... | TOOL | 0.955264 | 4.359422 |
37ccacdd-bb0d-4bf1-ae98-cf236a17380b | yhhno/XCSeries | 03MongoDb系列/03.Capped Collections介绍及生产环境之疲劳度过滤,日志应用/mongo-master/src/mongo/db/query/index_tag.cpp | #include "mongo/db/query/index_tag.h"
#include "mongo/db/query/indexability.h"
#include <algorithm>
#include <limits>
namespace mongo {
// TODO: Move out of the enumerator and into the planner.
const size_t IndexTag::kNoIndex = std::numeric_limits<size_t>::max();
void tagForSort(MatchExpression* tree) {
if (!... | ALGO | 0.992072 | 7.509814 |
ebfbf8e6-1b68-4086-ba79-eeb237b29c2c | PritamSarbajna/Coding-platforms-Solution | Codeforces/Soldier and Bananas/soldier_bananas.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int k, n, w;
cin >> k >> n >> w;
int total = 0;
for(int i=1; i<=w; i++){
total += (i*k);
}
if(total <= n){
cout << 0 << endl;
}
else{
cout << total-n << endl;
}
return 0;
}
| ALGO | 0.999917 | 3.511066 |
2ce37b2d-91c8-41d5-b005-abb8fbb88ea6 | Eastplanet/Problem-Solving | boj/2660.cpp | #include <iostream>
#include <cstring>
#include <vector>
#include<algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
int** arr = new int* [n + 1];
for (int i = 0; i < n + 1; i++) {
arr[i] = new int[n + 1];
... | ALGO | 0.999767 | 3.298433 |
2d0c85ce-9ec9-4248-807a-a43657dcc4a6 | xieqi1/VINS-Mono-noted | pose_graph/src/ThirdParty/DBoW/FBrief.cpp | #include <vector>
#include <string>
#include <sstream>
#include "FBrief.h"
using namespace std;
namespace DBoW2 {
// --------------------------------------------------------------------------
void FBrief::meanValue(const std::vector<FBrief::pDescriptor> &descriptors,
FBrief::TDescriptor &mean)
{
mean.reset();... | ALGO | 0.993433 | 6.432082 |
f609d163-8fc0-4b20-95cb-18538298b3bc | lilexuan/codeup | 100000580I.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char s[500];
while (scanf("%s", s) != EOF) {
int flag = 1;
for (int i = 0; i < strlen(s) /2; i++) {
if (s[i] != s[strlen(s) - 1 - i])
flag = 0;
}
if (flag)
printf("YES... | ALGO | 0.999723 | 3.911903 |
c4eb9319-c612-43ff-ba38-817e35dbc3f4 | MostafaAshraf98/Problem-Solving | DP/Leetcode/5. Longest Palindromic Substring.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define sf(n) scanf("%d", &n)
#define sff(n, m) scanf("%d%d", &n, &m)
#define sfl(n) scanf("%I64d", &n)
#define sffl(n, m) scanf("%I64d%I64d", &n, &m)
#define sfs(s) scanf("%... | ALGO | 0.999973 | 5.248359 |
72d87a20-6408-4d47-825b-63400bce06d2 | cjvoigt/327RogueLike | rlg327-1.07/path.cpp | #include "path.h"
#include "dungeon.h"
/* Ugly hack: There is no way to pass a pointer to the dungeon into the *
* heap's comparitor funtion without modifying the heap. Copying the *
* pc_distance array is a possible solution, but that doubles the *
* bandwidth requirements for dijkstra, which would also b... | ALGO | 0.999583 | 3.170713 |
7b487121-ac12-47c3-9e13-23e8bd9c9323 | MarcWong/SemanticSfM | SemanticSfM/software/SfM/main_ComputeStructureFromKnownPoses.cpp | #include "i23dSFM/sfm/sfm.hpp"
#include "i23dSFM/system/timer.hpp"
#include "i23dSFM/image/image.hpp"
#include "third_party/cmdLine/cmdLine.h"
#include "third_party/stlplus3/filesystemSimplified/file_system.hpp"
using namespace i23dSFM;
using namespace i23dSFM::sfm;
using namespace i23dSFM::image;
/// Build a list o... | TOOL | 0.914712 | 6.106373 |
a9a32463-de14-4efd-b0bd-ad4107964425 | poojan010/CodeForces | B_Phone_Numbers.cpp | #include <bits/stdc++.h>
using namespace std;
bool isTaxi(string phone_num){
char ch = phone_num[0];
for(int i=1; i<=7; i++){
if(i == 2 || i == 5) continue;
if(phone_num[i] != ch) return false;
}
return true;
}
bool isPizza(string phone_num){
char ch = phone_num[0];
for(int i=1... | ALGO | 0.999328 | 4.257099 |
17a35d22-20de-44e4-b9d5-1b10003b270e | XiangyuSu611/TMT | src/thirdparty/siftflow/mexDiscreteFlow/main.cpp | #include <QtGui/QApplication>
#include <QtCore/QCoreApplication>
#include "Image.h"
#include "BPFlow.h"
#include "stdio.h"
#include "time.h"
int main(int argc, char *argv[])
{
time_t start,end;
double dif;
QCoreApplication a(argc, argv);
time (&start);
BiImage im1,im2,Im1,Im2;
if(!im1.imread("sflowg.00.jpg")... | ALGO | 0.972219 | 3.771006 |
e474c4bc-e5ff-48f2-ae54-a0770192dee0 | manikanta2901/ubuntu | .history/imp/cpp/DataStructures/SegTree/Example_20200713171051.cpp | #include<bits/stdc++.h>
using namespace std;
int n, a[n],seg[4 * n];
void build(int index,int low,int high){
if(low == high){
seg[index] = a[low];
}
int mid = (low + high)/ 2;
build(2 * index + 1,low,mid);
build(2 * indec + 2,mid + 1,high);
}
int query(int index,int low ,int high,int l,int... | ALGO | 0.999982 | 5.145594 |
818e5adc-c2e4-42ad-aef0-17dd5e7f4d90 | MahinAshraful/CodeWatch_Data | sample-data/p00005/s186408099.cpp | #include <iostream>
#include <utility>
using namespace std;
int main() {
int a, b;
while (cin >> a >> b) {
if (a > b) swap(a, b);
int A = a, B = b;
while ((a % A != 0) || (b % A != 0)) {
--A;
}
while ((B % a != 0) || (B % b != 0)) {
B += A;
... | ALGO | 0.999914 | 4.738549 |
6580ddc0-1774-4516-bd42-a1e815ce251f | ArtSvi1/cpsc2376-barnett | practice/practice04/practice04_2a/problem2a.cpp | #include <iostream>
#include <string>
#include <limits>
template <typename T>
T calculate(T num1, T num2, char operation) {
if (operation == '+') {
return num1 + num2;
}
else if (operation == '-') {
return num1 - num2;
}
else if (operation == '*') {
return num1 * num2;
}
... | TOOL | 0.964794 | 5.806722 |
3b7d0206-6ad6-4554-b2f0-ad4199f6750e | nethsara-rahiru/University_Projects | 1st Semestor/IT1134 ( C++ )/Day 09/ICA1/Q1/File.cpp | #include<iostream>
using namespace std;
int main()
{
int a, b, c;
cout << "Please enter your first number : ";
cin >> a;
cout << "Please enter your second number : ";
cin >> b;
cout << "Please enter your third number : ";
cin >> c;
if ( a > b)
{
if ( a > c)
{
... | ALGO | 0.998513 | 3.298589 |
b2fe121c-26a8-4bd9-b168-8e1e41f78faa | raincross7/code-similarity | codes/train_code/problem253/problem253_151.cpp | #include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>
using ll = long long;
using namespace std;
constexpr int MOD = 1e9 + 7;
constexpr ll ... | ALGO | 0.999995 | 3.73901 |
c6c26592-7b29-43ff-9a5e-7b809c8da037 | JackLee2111/data-structure-algorithm1 | code/Lab4-BBST/code/RB3.cpp | #include <iostream>
#include <vector>
#include <string>
#include <stdlib.h>
#include <time.h>
using namespace std;
#define RED 0 //红色结点
#define BLACK 1 //黑色结点
template <typename T, typename V>
class RBtree
{
private:
class Node
{
private:
pair<T, V> p;
int s;
bool color; // 0红1黑
... | ALGO | 0.999707 | 3.961203 |
5133f31f-1227-4a16-b225-a55f4853785f | otavioon/COLA-2022-Tools | datasets/src/optz/poj/0/24_1.cpp | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <iomanip>
using namespace std;
#define LEN 100
#define ASCII 100
#define MAX_N 100
#define MAX_M 100
#define MAX 100
#define ASC 100
#define null 0
#define Len 100
#define SUM 100
#define NUMBER 100
#define SIZE 1... | ALGO | 0.999834 | 3.68938 |
7d07b45e-06a5-46ac-95ee-7dcd06b0696e | minato225/5-sem | RIPS/Паралельные сети/3/Lab3/Source.cpp | #include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <chrono>
std::map<std::string, int> linnear(std::vector<std::string>& files_names, std::string& word) {
std::string tmp;
std::map<std::string, int>result;
for (auto x : files_names) {
int count = 0;
std::ifstream f(x);
while (f >... | ALGO | 0.9573 | 4.989707 |
370a1c4e-22c7-4687-bc4e-5d4a180e52f8 | ishandutta2007/codeforces | monogon/normal/1296/E2.cpp |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5 + 5;
int n;
string s;
char c[N];
int color[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> s;
int k = 0;
for(int i = 0; i < n; i++) {
int j = 0;
for(; ; j++) {
i... | ALGO | 0.999985 | 4.54285 |
3ffd0780-06d2-43b4-9b76-26df2ea5c32b | dominatorVJ/LeetCode_GFG_Daily_Ques | Shortest path in Undirected Graph having unit distance - GFG/shortest-path-in-undirected-graph-having-unit-distance.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
vector<int> shortestPath(vector<vector<int>>& edges, int n,int m, int src){
vector<int> adj[n];
for(auto it:edges){
... | ALGO | 0.999956 | 6.074566 |
323ab3d5-f9b4-408d-a2cb-e30bb64e3c88 | Rifat-rh/code-forces | Digits_Summation.cpp | /*
Didit sumation :Given two numbers N and M. Print the summation of their last digits.
Input
Only one line containing two numbers N,M (0≤N,M≤1018).
Output
Print the answer of the problem.
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
long long int n,m;
cin>>n>>m;
long long int x,y;
x=n%... | ALGO | 0.99986 | 3.798985 |
54c44497-534c-4b51-b77b-61b99e5cca18 | Amulya-coder/DSA-All-In-One | Linked Lists/Break_a_Palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
string breakPalindrome(string s)
{
// aaaaab
int ptr2 = 0;
string temp = "";
for (int i = 0; i < s.length(); i++)
{
temp += 'a';
}
string ans = "";
if (s.length(... | ALGO | 0.999552 | 4.378382 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.