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 |
|---|---|---|---|---|---|---|
17e71304-8e8d-4310-a0e3-534eb22ec953 | yysskk/Training | AtCoder/abc015_a.cpp | // SeeAlso:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MAX 100000
#define NIL -1
#define MOD 1000000007
typedef int _loop_int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR... | ALGO | 0.999698 | 3.393305 |
0c6cb737-50d6-4fa2-bdd1-73a112b53a5e | Giusgarus/SPM_24-25 | Code/spmcode12/jacobi_1d_blk.cpp | /*
* jacobi_1d_blk.cpp
*
* 1D Jacobi iteration with blocking halo exchange
*
* Description:
* - The global 2D grid (rows * cols) is partitioned into contiguous row-blocks
* via MPI_Scatterv (each process gets myRows * cols elements)
* - At each iteration, each process exchanges its top and bottom "halo"... | ALGO | 0.9996 | 4.786461 |
9b4040dc-4532-41bb-82e4-4a44ea959eab | enfuego27826/new-cpp | DP/edit_distance.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define forn(i,j) for(ll i = 0; i < j; i++)
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define p push
#define f first
#define s second
#define all(x) x.begin, x.end()
#define eb emplace_back
#d... | ALGO | 0.999996 | 3.937347 |
1ccdc73b-ebb6-4c23-b8b9-89a2a0f1efab | abansal0310/Data-Structures-and-Algorithm | LinkedList/mergeWithoutNew.cpp | #include<iostream>
using namespace std;
struct Node{
Node *next;
int data;
Node(int x){
data=x;
next=NULL;
}
};
void push(Node *(&head), int data){
Node *temp = new Node(data);
if(head == NULL){
head=temp;
return;
}
Node *ptr = head;
while(ptr->next ... | ALGO | 0.999672 | 3.977605 |
c5207d90-4bef-402b-80d7-6553d1228484 | zhangdehao-lab/uClinux | user/p7zip/7zip/UI/Common/UpdatePair.cpp | // UpdatePair.cpp
#include "StdAfx.h"
#include <time.h>
#include "Common/Defs.h"
#include "Windows/Time.h"
#include "UpdatePair.h"
#include "SortUtils.h"
using namespace NWindows;
using namespace NTime;
static int MyCompareTime(NFileTimeType::EEnum fileTimeType,
const FILETIME &time1, const FILETIME &time2)
... | TOOL | 0.957734 | 6.361584 |
e594c927-81a2-4b2c-8325-c528dd9d8db4 | hjiang13/LLMs-in-IR | POJ-104/12/1224.cpp | #include <iostream>
using namespace std;
// ??-??.cpp : ??????????????
//2012.10.29
int main()
{
int m,n,a[15],x=0,i,y=0;
while(y!=1)
{
for (m=0; ; m++)
{
cin >> n;
if (n!=0 && n!=-1)
{
a[m]=n;
continue;
}
if (n==0)
{
break;
}
if (n==-1)
{
y=1;
break;
}
}
if (y==1)
{
break;
}
for (m=0; m<=15; m++)
{
for (i=0; i<=15; i+... | ALGO | 0.999503 | 3.718552 |
e2aaaf95-912c-4eb2-9cb3-1bd35afe6dae | NandishM0618/DSA | IMPORTANT QUESTIONS ON DSA/Hashing/Longest_Sub01.cpp | // Longest subarray with equal 0s and 1s
#include <bits/stdc++.h>
using namespace std;
int Longest01(int arr[], int n)
{
int res = 0;
for (int i = 0; i < n; i++)
{
int c0 = 0;
int c1 = 0;
for (int j = i; j < n; j++)
{
if (arr[j] == 0)
c0++;
... | ALGO | 0.999991 | 5.054944 |
9dca0384-1556-4c3c-993d-3bbebb23b99a | knknkn1162/ant_competitive_solution | 3.6.0/CGL_2_A.cpp | #include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstd... | ALGO | 0.999949 | 4.539164 |
79f17689-a926-44f0-af6e-07c4d8d8b78e | ishandutta2007/codeforces | antontrygubo_o/normal/1481/B.cpp | #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
using ld = long double;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_nod... | ALGO | 0.999948 | 4.696846 |
723ce037-06c6-47c3-b086-42cf475ed333 | Mulab11/cntt2016-hw1 | TC-SRM-598-div1-950/wyz.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "TPS.cpp"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=55;
class TPS{
int n;
vector<int> edg[maxn];
bool vis[maxn];
int dfs(int u){
vis[u]=1;
int ret=0,v,cnt=0,tmp;
for (int j=0;j<edg[u].size();++j)if (!vis[v=edg[u][j]]){
if ... | ALGO | 0.99976 | 4.668042 |
3f68d498-a112-497d-a96f-479f286e28f1 | bracinho2/flutter_desafio04_movie_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
48ce8bfa-a31f-4c8a-ad8f-31e11b6031a2 | naxsyambis/0163_Doublelinkedlist | 0163_Doublelinkedlist/0163_Doublelinkedlist.cpp | #include <iostream>
#include <string>
using namespace std;
struct Node
{
int noMhs;
string name;
Node* next;
Node* prev;
};
Node* START = NULL;
void addNode() {
Node* newNode = new Node(); // step 1 create new node
cout << "\nEnter the roll number of the student: ";
cin >> newNode->noMhs... | ALGO | 0.998587 | 4.108869 |
3914887d-150c-4e5b-80ed-91ee48c2ab38 | DaHuangQwQ/DaHuangQwQ.github.io | docs/public/c++/_test.cpp | #include <iostream>
using namespace std;
const int N = 1e5 + 10;
int root, n;
struct node {
int to, next, w;
}e[N<< 1], ne[N << 1];
int head[N];
void add(int u,int v, int w){
static int idx = 1;
e[++idx] = (node){v, head[u], w};
head[u] = idx;
}
int cnt = 0;
void dfs(int u){
for(int i = head[u];i;i ... | ALGO | 0.999911 | 3.603797 |
4d3b4da8-3477-453b-9b5f-9b5fabefc691 | COVESA/cdsp | cdsp/knowledge-layer/connector/utils/file_handler_impl.cpp | #include "file_handler_impl.h"
#include <filesystem>
#include <fstream>
#include <iostream>
#include <stdexcept>
/**
* @brief Reads the contents of a file and returns it as a string.
*
* @param file_path The path to the file to be read.
* @return A string containing the contents of the file.
* @throws std::runti... | TOOL | 0.958653 | 7.653505 |
bcf7c8b4-e096-4464-bbe3-95e670b92fc2 | manikanta2901/ubuntu | .history/SRM/placementPractice/HackerRank/insertionSort1_20201101131653.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.985041 | 3.039695 |
8be5cb1b-8ad2-40f9-b12c-67c4d2d4db92 | Lykos/libsquirrel | Crypto/aes_keyexpander.cpp | #include "aes_keyexpander.h"
#include "aes_constants.h"
#include "types.h"
#include "preconditionviolation.h"
#include <climits>
#include <stdexcept>
#include <string>
using namespace std;
namespace Crypto {
namespace AES {
number_size_t KeyExpander::expanded_length(number_size_t key_length)
{
retur... | ALGO | 0.993094 | 6.341865 |
6a77d711-67f6-471d-8c8c-a91cc0a4e7d2 | shivdevop/Coding-questions | shortest-path-in-binary-matrix/shortest-path-in-binary-matrix.cpp | class Solution {
public:
int shortestPathBinaryMatrix(vector<vector<int>>& grid)
{
if(grid[0][0]==1)
return -1;
//create a 2d distance vector
int m=grid.size(); //no. of rows
int n=grid[0].size();//no. of columns
const int INF=1e9;
vector<... | ALGO | 0.999995 | 6.061671 |
e9b30121-c7ea-4039-afab-bc81c6069612 | hoangcitizens/C-plus-plus | oop_c++/uneti_ki1nam2/tuan 4/bai3_tuan4.cpp | #include<iostream>
using namespace std;
#define max 20
int n;
class MaTran
{
private:
int mt[max][max];
public:
MaTran();
void inputmt();
void outputmt();
friend MaTran tich(MaTran a);
};
MaTran::MaTran()
{
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
mt[i][j] = 0;
}
}
}
void MaTran:... | ALGO | 0.999473 | 3.135324 |
f7d18bc7-0db4-48df-9db1-367246475edd | robinwersich/DTC-2021-iPregel | iPregel/src/graph_converters/graph_converter_ligra.cpp | /**
* @file graph_converter_ligra.cpp
* @copyright Copyright (C) 2019 Ludovic Capelli
* @par License
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License,... | ALGO | 0.961991 | 5.070422 |
9045bd03-cd85-4e82-bf80-a0c975a76efa | CompPhysics/ComputationalPhysics2 | doc/src/MCsummary/src/BM/src/TestCase/main.cpp | #include <iostream>
#include <random>
#include "../Eigen/Dense"
#include "gradient_descent.h"
using namespace std;
using namespace Eigen;
int main()
{
int P = 2; //Number of particles
int D = 2; //Number of dimensions
int N = 2; ... | ALGO | 0.999379 | 3.852609 |
61fab1e1-ec59-4edd-8b92-762ae8fc3313 | nocotan/algorithms | atcoder/Cpp/ABC/001/B.cpp | //#define _GRIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
// 基本テンプレート
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n... | ALGO | 0.999417 | 3.638968 |
f57d7524-c9d1-4f2d-9f11-8e1f311172f7 | Ilyusha-Novoselov/MPiA | Практическая 6 и 7/graph.cpp | #include "graph.h"
#include <stdexcept>
using namespace std;
Graph::Graph(initializer_list<tuple<int, int, double>> edges) {
for (const auto &e: edges) {
add_edge(get<0>(e), get<1>(e), get<2>(e));
}
}
double random(double min, double max)
{
return (double)(rand()) / RAND_MAX * (max -... | ALGO | 0.974815 | 5.277816 |
babc53ce-c3cc-430c-8604-c9222e756530 | emmef/speakerman | src/SpeakermanWebServer.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <speakerman/SpeakermanWebServer.hpp>
#include <speakerman/jack/SignalHandler.hpp>
#include <speakerman/utils/Config.hpp>
#include <sys/types.h>
#include <tdap/MemoryFence.hpp>
#include <unistd.h>
namespace speakerman {
static void create_command_and_fi... | WEB | 0.924145 | 5.716489 |
58773192-da39-4fa4-a5ad-b4159bf05fb5 | AishwaryaDoosa/Boost1.49 | libs/graph/test/metis_test.cpp | #include <boost/graph/breadth_first_search.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/metis.hpp>
#include <fstream>
#ifdef BOOST_NO_EXCEPTIONS
void
boost::throw_exception(std::exception const& ex)
{
std::cout << ex.what() << std::endl;
abort();
}
#endif
using namespace boost;
/* An ... | ALGO | 0.998327 | 5.490002 |
89ef577c-e640-4081-b262-8c6f867f280f | CamCompton/CUDA-DFrac | common/quaternion_utils.cpp | #include <glm/gtc/quaternion.hpp>
#include <glm/gtx/quaternion.hpp>
#include <glm/gtx/euler_angles.hpp>
#include <glm/gtx/norm.hpp>
using namespace glm;
#include "quaternion_utils.hpp"
// Returns a quaternion such that q*start = dest
quat RotationBetweenVectors(vec3 start, vec3 dest){
start = normalize(start);
dest... | TOOL | 0.900393 | 6.762732 |
508ed5ae-dcca-49d7-b216-dff73fc1c635 | ishandutta2007/codeforces | aid/normal/1054/B.cpp | #ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif
#define sz(x) ((int) (x).size())
#define TASK "text"
const int inf = (int) 1.01e9;
con... | ALGO | 0.999651 | 4.018487 |
6c925c4d-f5d7-4256-a46f-091ab2cf0b0e | haruboring/atcoder | abc360/c/main.cpp | #include "atcoder/all"
#include "bits/stdc++.h"
#define int long long
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repp(i, m, n) for (int i = m; i < (int)(n); i++)
#define debug(x) cerr << #x << ": " << x << endl
using namespace std;
signed main() {
int N;
cin ... | ALGO | 0.999968 | 3.946798 |
6ac5d5e0-493b-4c1b-bf68-8b69fc298f7e | QuanyshK/1semester | cpp/lab2/K.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
char d;
node*next;
node(){}
node(int n) {
this->d = n;
this->next = NULL;
}
};
int main() {
int n;
cin>>n;
while(n--){
node*head=NULL;
node*c = head;
map<char,int> maps;
int n;
... | ALGO | 0.99956 | 3.910074 |
6421041e-8e8a-46f6-925a-203e1b109b05 | cfeitong/ACM-problem-archive | implementation/4-cf791-C.cpp | #include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int n, k;
vector<string> ans;
vector<string> names;
void gen() {
for (int j = 0; j < 10; j++) {
stringstream ss;
ss << char('A' + j);
ss << char('a' + j);
names.push_b... | ALGO | 0.9998 | 3.180714 |
4cd38406-4364-4621-adab-c2b8fc7125c0 | LonxunQuantum/Lammps_for_PWMLFF | lammps_neigh_mlff_20230508/src/REPLICA/compute_pressure_alchemy.cpp | #include "compute_pressure_alchemy.h"
#include "domain.h"
#include "error.h"
#include "fix.h"
#include "modify.h"
#include "update.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputePressureAlchemy::ComputePressureAlchemy(LAMMPS *lmp, int narg, char **a... | ALGO | 0.980677 | 4.390196 |
bc7c3ae5-11e4-4d18-baa6-9bb2e8909184 | ronaldjuarez/garage | interview_questions/prog079_leetcode_2_add_two_numbers.cpp | #include <iostream>
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListNode* insert(ListNode* &l1, int value){
ListNode* n = new ListNode(value);
if (l1 == NULL) {
l1 = n;
return l1;
}
ListNode* temp = l1;
while (temp->next != N... | ALGO | 0.999872 | 5.48406 |
8312b5a8-3009-44e0-bc33-103dc4bcee4f | Sagar-1608/DSA-Problem-solving_1 | 1026_1346. Check If N and Its Double Exist.cpp | // 1346. Check If N and Its Double Exist
class Solution {
public:
bool checkIfExist(vector<int>& arr) {
int n = arr.size();
sort(arr.begin(),arr.end());
for( int i =0; i<arr.size();i++)
{
if(arr[i]==0 && arr[i+1]==0)
{
return true;
... | ALGO | 0.999709 | 5.625403 |
0a86d4aa-1761-4967-b918-94e7c11a14e1 | Surya00/Codeforces | spoj/xmax.cpp | #include<bits/stdc++.h>
#include<time.h>
using namespace std;
#define ll long long int
double time_taken;
clock_t start, end;
int main(int argc, char const *argv[])
{
ll i,j,k,n,m,s,t,l,count,mi,mv;
cin>>n;
start = clock();
ll A[n];
m=0;
for (l=0; l<n; l++)
{
cin>>A[l];
if(m<A[l]){
m=A... | ALGO | 0.999986 | 4.04129 |
9873d781-9d57-4f62-b0b2-c71a3e0e4edd | ishandutta2007/codeforces | zhouyuyang/normal/455/E.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define uint ungigned
#define db long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define vi vector<int>
#define vpi vector<pii >
#define IT iterator
#define PB push_back
#define MK make_pair
#define LB l... | ALGO | 0.999764 | 3.317395 |
eacfbbb3-4b05-4a80-a22d-8a2709a0af20 | nayan0402/CompetitiveCodes | MEX.cpp | //You can find the mex for any array using the following function
//k is the the number of times you want to find the mex of elements starting from the first element of a till k times.
??If you want to find the mex of the entire array k times, just multiply k by n while putting it in the function
vector <int> MEX(vecto... | ALGO | 0.999986 | 3.664547 |
acf4f77e-f8e7-4d62-9f79-805daf64a220 | yashasvi242/Searching-n-Sorting | binarySearch.cpp | #include <iostream>
using namespace std;
int binarySearch(int arr[], int arraySize , int elementToFind){
//these are indexes
int low,mid,high;
//there values will be fixed for the start
low = 0;
high = arraySize -1 ;
while(low<=high){
mid = (low+high)/2;
if(arr[mid]==elementT... | ALGO | 0.999439 | 5.755823 |
05b6a61d-4801-48db-bc45-c214f5397017 | ParticulateFlow/LIGGGHTS-PFM | lib/gpu/lal_mie.cpp | /***************************************************************************
mie.cpp
-------------------
Trung Dac Nguyen (ORNL)
Class for acceleration of the mie pair style.
________________________________________________... | ALGO | 0.98455 | 5.648039 |
2cfa0ed4-8a19-4eab-a386-5196576e7383 | balabit-deps/balabit-os-9-llvm-toolchain-12 | pstl/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14
// Tests for partial_sort_copy
#include "support/pstl_test_config.h"
#include <cmath>
#include <execution>
#include <algorithm>
#include "support/utils.h"
using namespace TestUtils;
template <typename T>
struct Num
{
T val;
Num() : val(0) {}
Num(T v) : val(v) {}
... | TEST | 0.965973 | 7.020692 |
523c4b29-c6ce-49bb-9fff-81f405bd064b | bevankoopman/GraphINferenceModel | retrieval/depth.cpp | #include <iostream>
#include <vector>
using namespace std;
void pv(vector<int> v)
{
for(vector<int>::iterator it = v.begin(); it != v.end(); it++)
{
cout << *it << " ";
}
cout << endl;
}
int main() {
int x = 10;
int y = 10;
int vx = --x;
int vy = y--;
vector<int> v;
... | ALGO | 0.997662 | 4.344995 |
72b7a822-9ffa-4ea6-94de-1cff0e4e711a | LukovVI/FEFU_informatics_tests | 1 семестр/2940(позиция на кольце через t часов).cpp | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
int v, t;
int res;
ifstream ifs ("input.txt");
ofstream ofs ("output.txt");
ifs >> v >> t;
res = (v*t)%109;
if (res<0){
res = 109 + res;
}
ofs << res;
return 0;
}
| ALGO | 0.999823 | 4.151772 |
a63a455f-08c9-411e-bc37-d5cf6ae5202f | iloveooz/podbelsky | 05/p5-18.cpp | //p5-18.cpp - перестановка указателей на одномерные массивы
#include <iostream>
using namespace std;
int main()
{ const int n = 5; // количество строк матрицы
const int m = 7; // количество столбцов матрицы
int i = 0, j = 0;
double array[n][m]; // основной массив (матрица)
//clrscr();
for (i = 0; i < n;... | ALGO | 0.999127 | 3.318063 |
6a5dc8a1-0327-4590-8e92-85a0d4a7cf2e | Rexx0801/codeptit_c_cpp | xaunhiphantruoc.cpp | #include<string>
#include<iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
int j = s.size() - 1;
while (s[j] == '0' && j >= 0) {
s[j] = '1';
j--;
}
if (j == -1) {
cout << string(s.size(), '1');
}
else {
s[j] = '0';
for (int i = 0; i < s.siz... | ALGO | 0.999965 | 3.927111 |
5138719f-d94d-43c5-85c0-f97ca75083c5 | madhur3u/DSA-Questions | LeetCode/5_longest_palindromic_substring.cpp | // https://leetcode.com/problems/longest-palindromic-substring/
class Solution {
public:
string longestPalindrome(string s) {
// ans will hold the longest palindrome substr
// temp will hold palindromes in each iteration
string ans = "", temp;
// logic is to take e... | ALGO | 0.999798 | 6.418214 |
115c4f53-1a2f-4502-b94b-fec172ab22f7 | atomickashyap/Problem-Set-DSA | 0056-merge-intervals/0056-merge-intervals.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
vector<vector<int>> ans;
if(intervals.size()==0)
return ans;
int flag = 1;
sort(intervals.begin(),intervals.end());
vector<int> temp = intervals[0];
for(auto it:intervals)... | ALGO | 0.999998 | 5.667584 |
a28f2057-846d-4eb8-8f9b-cc9c0891f24c | ishandutta2007/codeforces | akulyat/normal/984/B.cpp | #include <bits/stdc++.h>
using namespace std;
string s[200];
long p[200][200];
long n,m,i,j;
void cc(long x, long y)
{
if (x>=0&&y>=0&&x<n&&y<m)
p[x][y]++;
}
int main()
{
cin>>n>>m;
getline(cin, s[0]);
for (i=0; i<n; i++)
{
getline(cin, s[i]);
}
for (i=0; i<n; i++)
{
for (j=0; j<m; j++)
{
if (s[... | ALGO | 0.999926 | 3.381176 |
78f21952-c005-431c-b934-bc33bff897f3 | sumitanand027/Leetcode-Problem-solved | 485-max-consecutive-ones/485-max-consecutive-ones.cpp | class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int cnt = 0, maxCnt = 0;
for( int i = 0; i < nums.size(); i++ ) {
if( nums[i] == 0 )
cnt = 0;
else {
cnt++;
maxCnt = max( maxCnt , cnt );
}
... | ALGO | 0.999958 | 6.122129 |
79764d89-4ddc-4919-8206-eac331df5b31 | xjs-js/leetcode | 0795.Number.of.Subarrays.with.Bounded.Maximum/sol.cpp |
/**
* @date: 2021-04-10 22:10 Sat
* @name: 区间子数组个数
* @url: https://leetcode-cn.com/problems/number-of-subarrays-with-bounded-maximum/
* @note: 动态规划
*/
class Solution {
public:
/**
* 从后向前使用动态规划
*
* 1. if (A[i] > R) => dp[i] = 0;
* 2. if (L <= A[i] <= R) => if (A[i+1] >= L) ... | ALGO | 0.999964 | 5.845506 |
7440acc8-59a9-4354-9863-a73f9063617d | Shubh08am/Leetcode_DSA_Problems-Solutions | 1657. Determine if Two Strings Are Close.cpp | class Solution {
public:
bool closeStrings(string word1, string word2) {
map<char,int>m1,m2;
vector<int>v1,v2;
for(auto it : word1) m1[it]++;
for(auto it : word2) m2[it]++;
if(word1.size()!=word2.size()) return false;
//v1 contains frequency of all character of m1
f... | ALGO | 0.999972 | 5.919639 |
db8fce13-0863-4880-9a67-43af640146b4 | anwar-arif/acm-code | spoj/PIE - Pie.cpp | #include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
#... | ALGO | 0.99979 | 3.630385 |
427ab33f-1957-446c-96bb-5eae3b23c247 | lauratrain99/First-steps-C- | References & pointers/pointers.cpp | #include <iostream>
int main() {
int power = 9000;
// Create pointer
int* ptr = &power;
// Print ptr
std::cout << ptr;
} | TOOL | 0.963523 | 4.160819 |
5563dc55-8b99-4c04-adec-d5edeeed98b4 | Glasspham/DSA-28Tech | Vector-Pair/lesson_8.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n; cin >> n;
for(int i = 0; i < n; ++i) {
int x, y, z;
cin >> x >> y >> z;
cout << x + y + z << ' ';
}
return 0;
} | ALGO | 0.996588 | 4.760289 |
a8a73e49-d2af-4844-a02e-0c7ae8e8458c | yangcd-bupt/Coder-Coding-Code | 01背包/decimal_0-1bag.cpp | #include<stdio.h>
#include<vector>
#define MAX_NUM 5
#define max(a,b) ( ((a)>(b)) ? (a):(b) )
using namespace std;
typedef vector<pair<double,int> > jumpingPoint;
int maxCapacity;
void init(){
maxCapacity=10;
}
void solution(){
init();
double weight[MAX_NUM]={2.1,2.2,6.3,5.4,4.5};
int value[MAX_NUM]... | ALGO | 0.999636 | 3.005167 |
72217fa1-58ed-468f-be81-9447557862ad | alesondepano/Data-Structures-and-Algorithms | SAMPLE15.CPP | #include<iostream>
#include<string>
#include<queue>
using namespace std;
typedef struct COORDINATES {
int x;
int y;
string name;
}POINT;
int main(){
queue<POINT> queueofpoints;
cout << queueofpoints.size() << endl;
POINT temp;
temp.name = "First Coordinate";
temp.x = 10;
... | TOOL | 0.897231 | 3.544596 |
e5e5fc1b-2109-44aa-afb4-a44b440b0ca5 | thedyingkai/ACM-Repository | Contests/LeetCode/W-436/A.cpp | //
// Created by ASUS on 2025/2/9.
//
class Solution {
public:
vector<vector<int>> sortMatrix(vector<vector<int>>& grid) {
int x[30][20],cnt[20],n=grid[0].size();
memset(cnt,0,sizeof(cnt));
vector<vector<int>> res(n, vector<int>(n));
for(int i=n-1;i>=0;i--) for(int j=0;j<n;j++) x[n-i... | ALGO | 0.999998 | 5.695675 |
60258d52-9cb9-4245-a7d3-1a22cf5edf06 | Uxna/emergency_response_graph | Vertex.cpp | #ifndef VERTEX_CPP
#define VERTEX_CPP
#include "Edge.cpp"
#include <string>
#include <limits>
using namespace std;
class Vertex{
private:
int key;
int* adjVertices;
int currentSize;
int listSize;
double timeFromSource;
Vertex* predecessor;
public:
... | ALGO | 0.995751 | 4.276628 |
aabeb2f0-6987-41b9-9197-b237f1f017cc | oeddyo/algorithm | tc/srm573/500.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999983 | 4.406766 |
851ecfef-bbaf-404f-b831-90173823ee8d | PRACHI0088/Array_Programs | Kadanes_Algorithm.cpp | // finding the maximum sum of subarray. Using KADANE'S ALGORITHM
#include<iostream>
using namespace std;
int main()
{ int a[50],n,sum=0,maxi;
cout<<"enter the size of the array: \n";
cin>>n;
cout<<"enter the array elements in SORTED manner:\n";
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++... | ALGO | 0.999983 | 4.255083 |
c72498bc-e5f0-4d9c-9d22-67e0719e21d8 | soyamaguchi/AtCoder-past-problems | 2020/ABC/167/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;
string T;
cin >> S >> T;
bool s = (S.size() + 1) == T.size();
T.pop_back();
bool n = S == T;
string ans = (s && n) ? "Yes" : "No";
cout << ans << endl;
}
| ALGO | 0.99999 | 5.397183 |
cd8e547b-74c8-4b72-bd20-023d1c485680 | bingsfan/myleetcode | 图论二刷/24.bellmanford.cpp | #include <bits/stdc++.h>
using namespace std;
void bellmanFord(){
int n,m,s,t,k;
vector<vector<int>> graph;
cin>>n>>m;
while (m--)
{
cin>>s>>t>>k;
graph.push_back({s,t,k});
}
vector<int> mindist(n+1,INT_MAX);
int start = 1;
int end = n;
mindist[start]=0;
for(i... | ALGO | 0.999117 | 5.029013 |
de98f44f-5167-4424-bdbc-a2975fdc29b8 | SCR01/-CrackYourPlacement | Trees/InvertBT.cpp | class Solution {
public:
int height(TreeNode* root, int &diameter){
if(!root) return 0;
int lh=height(root->left, diameter);
int rh=height(root->right, diameter);
diameter=max(diameter,lh+rh);
return 1+max(lh, rh);
}
int diameterOfBinaryTree(TreeNode* root) {
... | ALGO | 0.999926 | 6.695408 |
bf1387bb-ba9f-4538-bd88-5696ac065d25 | zariijutt/C-practice | !=opreator.cpp | #include<iostream>
using namespace std;
int main()
{
string s1,s2;
cout<<"Enter the first number: ";
getline(cin,s1);
cout<<"Enter the second number: ";
getline(cin,s2);
if(s1!=s2)
{
cout<<"Both strings are not equal.";
}
else
{
cout<<"Both strings are equal.";
... | TOOL | 0.998298 | 3.303108 |
98683ab1-2810-48c4-8e22-cdc10c9f3054 | lyr316/practices | src/Binary_Search_Recursive.cpp | /*
* Binary_Search_Recursive.cpp
*
* Created on: 2014105
* Author: Yanren
*/
int binarySearchRecursive(int A[], int start, int end, int target)
{
if (start == end && A[start] != target)
return -1;
int mid = start + (end - start)/2;
if (A[mid] < target)
return binarySearchRecursive(A, mid + 1, end, ... | ALGO | 0.999881 | 5.688622 |
e853cda3-68f5-4072-b80c-10dae2b57bca | oxygen-hunter/Flashboom | data/leetcode_cpp/longest-ideal-subsequence.cpp | // Time: O(n)
// Space: O(1)
// dp
class Solution {
public:
int longestIdealString(string s, int k) {
vector<int> dp(26);
for (const auto& c : s) {
const int x = c - 'a';
dp[x] = *max_element(cbegin(dp) + max(x - k, 0), cbegin(dp) + min(x + k + 1, 26)) + 1;
}
... | ALGO | 0.999895 | 6.098647 |
c0b644ae-ec33-46ea-a2b2-5d5bb711d71a | RobotLocomotion/eigen-mirror | unsupported/doc/examples/MatrixLogarithm.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
using std::sqrt;
MatrixXd A(3,3);
A << 0.5*sqrt(2), -0.5*sqrt(2), 0,
0.5*sqrt(2), 0.5*sqrt(2), 0,
0, 0, 1;
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "... | ALGO | 0.9995 | 3.621207 |
19542b65-d7ee-4918-811a-f03000548424 | fojleR/Competitive-Programming-Code | Decorating_Christmas_Tree.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define PI acos(-1.0)
#define MEM(a,x) memset(a,x,sizeof(a))
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const int mx = 200005;
const int mod = 1e9 +... | ALGO | 0.999928 | 3.847996 |
09a27302-9143-4256-9cab-ef5ab105b4db | Gradnos/CP_concepts | graphs/bridges.cpp | #include<iostream>
#include "vector"
#include <queue>
using namespace std;
#define ll long long
#define rep(i,a,b) for(ll i = (a); i <= (b); i++)
#define per(i,a,b) for(ll i = (a); i >= (b); i--)
#define vec vector
const ll N = 2e5;
const ll M = 1e9+7;
void storeBridge(ll x, ll y){
// store how you want
}
void... | ALGO | 0.999698 | 4.839157 |
a0332e09-09e0-4319-ae08-ad42c919ba2b | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5586_211.cpp | #include <bits/stdc++.h>
using namespace std;
int main() { cout << "Odd"; }
| ALGO | 0.995534 | 3.299085 |
235dd96c-d839-4402-abcb-45e064143aa4 | wishForget/MiniMineCraft | MineCraftDemo/HelloOpenGL_00/includes/Bullet3OpenCL/NarrowphaseCollision/b3StridingMeshInterface.cpp | #include "b3StridingMeshInterface.h"
b3StridingMeshInterface::~b3StridingMeshInterface()
{
}
void b3StridingMeshInterface::InternalProcessAllTriangles(b3InternalTriangleIndexCallback* callback, const b3Vector3& aabbMin, const b3Vector3& aabbMax) const
{
(void)aabbMin;
(void)aabbMax;
int numtotalphysicsverts = 0;
... | ALGO | 0.852659 | 6.462245 |
d9d6b32a-7e41-43ab-98ff-35ac3ce21bc8 | yousef201x/Problem-Solving | 1.Linked Lists/3.Remove Duplicates from Sorted List/Remove Duplicates from Sorted List.cpp | class Solution
{
public:
ListNode *deleteDuplicates(ListNode *head)
{
if (head == nullptr)
{
return nullptr;
}
auto itr = head;
while (itr->next != nullptr)
{
while (itr->next != nullptr)
{
if (itr->val == itr... | ALGO | 0.999292 | 6.186893 |
30709d0e-a269-4cf3-8c85-dfa642c0e1d4 | bufistov/epi | 6.8.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int find_set(vector<int> &set, const int &x) {
if (set[x] != x)
set[x] = find_set(set, set[x]);
return set[x];
}
void union_set(vector<int> &set, int x, int y) {
int x_root=find_set(set, x);
int y_root = find_set(... | ALGO | 0.999988 | 4.603646 |
4a9a0dcf-0716-4d0b-9ff0-c5e4dd806a54 | mushfiq-906/cp__training | CMP302-Fall2020/CMP302-Fall2020-HW5/Family Tree 7.cpp | // Author : Abdallah Hemdan
// For Hassanosama, ICPC next year ISA.
#include <bits/stdc++.h>
#define endl '\n'
#define sz size()
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define all(v) ((v).begin()), ((v).end())
#define rall(v) ((v).rbegin()), ((v).rend())
#define... | ALGO | 0.999942 | 4.275871 |
0d3845e7-38c2-4b3a-a6d6-dbc9647ad0fe | dwdjjj/BOJ | DP/BAEKJOON_4781_CandyStore/BAEKJOON_4781_CandyStore/main.cpp | #include <string.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
using namespace std;
const int MAX_N = 10000 +3;
pair<int, int> Candy[MAX_N/2];
int n;
double m;
int cache[MAX_N];
// cost원으로 사탕을 사가면서(쪼개기X, 여러개O) 가지고 있는 돈 m만큼으로 살 수 있는 칼로리합 최대값 구하기.
int f(int cost) {
if (cost == 0) {
... | ALGO | 0.999907 | 4.081131 |
07ee29db-1dcd-44fc-85d8-5bf80bf5a717 | ansansaram/boj | Bronze IV/1712_손익분기점.cpp | #include<iostream>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
int bep; // BREAK-EVEN POINT(손익분기점)
if (B>=C)
{
cout << "-1";
return 0;
}
bep = A / (C - B) + 1;
cout << bep;
return 0;
} | ALGO | 0.999901 | 3.67641 |
adbab142-ec2a-43d9-8c6f-f0f05024f3a4 | jzitelli/ode | ode/demo/demo_plane2d.cpp | // Test my Plane2D constraint.
// Uses ode-0.35 collision API.
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
# include <ode/ode.h>
# include <drawstuff/drawstuff.h>
#include "texturepath.h"
# define drand48() ((double) (((double) rand()) / ((double) RAND_MAX)))
# define... | ALGO | 0.91782 | 4.791623 |
c2d79502-16f3-4362-af29-3fcdd5dcd1c3 | ishandutta2007/codeforces | froggyzhang/normal/1458/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 1010
typedef long long ll;
inline ll read(){
ll x=0,f=1;
char c=getchar();
while(c<'0'||c>'9'){
if(c=='-')f=-1;
c=getchar();
}
while(c>='0'&&c<='9'){
x=(x<<1)+(x<<3)+c-'0';
c=getchar();
}
return x*f;
}
int T,a[N][N],n,m,b[N][N];
char s[N];
void Solve... | ALGO | 0.999903 | 3.490944 |
e16dad91-f766-4ed7-88bf-40b28bd5b309 | sahilkadiyan/my_leetcode_gfg | Value equal to index value - GFG/value-equal-to-index-value.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
vector<int> valueEqualToIndex(int arr[], int n) {
// code here
vector<int> v;
for(int i=0;i<n;i++){
if(i+1==arr[i])
v.push_back(arr[i]... | ALGO | 0.999574 | 5.379325 |
c66e32a1-7514-4097-aec5-94707076f32f | Sifathislam/PhitronAllPrograms | DSA/DATA STRUCTURE/MAIN CONCEPTS SERIAL/Doubly Linked List/Doubly_linked_list.cpp | #include<bits/stdc++.h>
using namespace std;
// Create node
class Node {
public:
int val;
Node* prev;
Node *next;
// Create an constructor
Node(int val) {
this->val = val;
this->prev = NULL;
this->next = NULL;
}
};
// Take input of forward
void Print_Node_values_Forward(Node* Head){
// Poin... | ALGO | 0.999855 | 4.681201 |
d766c40f-fc87-4ea4-b103-d6364830eaa3 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3693_8.cpp | #include <bits/stdc++.h>
using namespace std;
char s[210];
int n, K, p, dp[210][210][210], g[210];
struct mat {
int a[310][310];
} r, ans;
mat mul(mat& x, mat& y) {
mat ret;
memset(&ret, 0, sizeof(ret));
for (int i = 0; i <= p; i++)
for (int j = i; j <= p; j++)
for (int k = i; k <= j; k++)
(re... | ALGO | 0.999957 | 4.128343 |
c77dfdf3-a553-4b32-8b83-e124261ee687 | GauravN0910/codeforces-cpc | FalseAlarm.cpp | #include<bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
void solve(){
int n, x;
cin>>n>>x;
vector<int> nums(n);
int lastOne = 0;
for(int i=0;i<n;i++){
cin>>nums[i];
if(nums[i]==1){
lastOne = i;
}
}
int firstOne = 0;
for(int i=0;i<n;i++... | ALGO | 0.999881 | 4.583747 |
015626ed-f106-4e6f-aa27-eec5d99b78a4 | DanielBS28/Salesianos-Santo-Domingo-Savio | 2023-2024/Programación/Ejercicios C/ejerciciosumatorio.cpp | #include <stdlib.h>
#include <stdio.h>
int main(int argc, char const *argv[])
{
int numero;
int resultado =0;
printf("Dime un numero y realizaremos su sumatorio\n");
scanf("%i",&numero);
for (int i=1; i<=numero; i++)
resultado = resultado + i;
printf("El resultado es: %i", resultado);
... | ALGO | 0.931626 | 3.91071 |
fc2bfc5f-8ede-4fa6-a415-093b18cebdc0 | ans2568/codingtest | backjoon/11659.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int find_accumulate(vector<int> data, int end) {
int accumulate = 0;
for (int i = 0; i < end; i++)
accumulate += data[i];
return accumulate;
}
int main() {
// 데이터 개수, 반복 횟수 입력
int N, M;
cin >> N >> M;
// 데이터 입력
vector... | ALGO | 0.999963 | 5.000858 |
29b4b97e-942a-407c-a4b2-226fbcd0e56a | AkashPatel95/CPP_Programming | More Programs/string1.cpp | //program to print string in reverse
#include<iostream>
#include<string>
using namespace std;
int main() {
string str;
char temp;
int length;
cout<<"enter a string: ";
getline(cin,str);
length=str.length();
for(int i=0;i<length/2;i++) {
temp=str[i];
str[i]=str[length-i-1];... | ALGO | 0.984974 | 3.872653 |
944083a7-06c6-4cf7-9a7f-c61380ed98b3 | mazino3/gradient_engine | source/Math/Math/GaussianHelper.cpp | #include <Math/GaussianHelper.h>
#include <math.h>
static float gaussianDensity(float x, float sigma)
{
static float PI = 3.1415926536;
return 1.0f / (sqrtf(2 * PI) * sigma) * expf(-x * x / (2 * sigma * sigma));
}
std::vector<float> GaussianHelper::computeGaussianKernel(float sigma)
{
std::vector<float> result;
i... | ALGO | 0.999376 | 6.823592 |
0cfe3bc1-426c-485e-a21c-681d4f986029 | ishandutta2007/codeforces | adalbert/normal/864/E.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <string>
#include <cmath>
#include <algorithm>
#include <assert.h>
#include <memory.h>
#include <string.h>
#include <complex>
#include <queue>
#include <cstdlib>
#include <ctime>
#include<bits/stdc++.... | ALGO | 0.999988 | 3.397532 |
82aeac79-8328-4c00-ab8a-3576b0545a9c | Kanyelings/p1-25-coding-challenges-ds | KajiAime/Ex23.cpp | #include <iostream>
using namespace std;
int main()
{
int rev[100];
string word = "naM eldI";
cout << sizeof word<< "\n";
for(int i=0; i<sizeof word/4; i++){
rev[i] = word[(sizeof word/4)-i-1];
}
for(int i=0; i<sizeof word/4; i++){
word[i] = rev[i];
}
// Display
... | ALGO | 0.968293 | 3.220333 |
4ad86f10-2868-4459-894c-e5cdc2b64b0f | pratishtha-gupta/leetcode | 0907-koko-eating-bananas/0907-koko-eating-bananas.cpp | class Solution {
bool check(int mid, vector<int> &piles, int h) {
long long time = 0;
for (int i = 0; i < piles.size(); i++) {
time += (piles[i] + mid - 1LL) / mid; // Ceiling division
if (time > h) return false;
}
return time <= h;
}
public:
int min... | ALGO | 0.999971 | 6.382551 |
efd1643f-f1b2-4566-ab58-6ff89e495187 | quynh410/ss8-java | ss8/Bai1.cpp | #include<stdio.h>
#include<stdlib.h>
typedef struct Node{
int data;
struct Node* left;
struct Node* right;
}Node;
// tao ra 1 node
Node* createNode(int data){
// cap phat bo nho
Node* newNode = (Node*) malloc(sizeof(Node));
newNode->data = data;
newNode->left = NULL;
newNode->right = NULL;
return newNode;
}
... | ALGO | 0.999897 | 4.352145 |
04cdb735-ca24-4452-a105-1984909ffd52 | yujinrobot/yujin_lidar_v2 | driver_ros2_foxy_ubuntu2004/yrl3_v2_ros2_package/eigen-3.3.7/doc/snippets/JacobiSVD_basic.cpp | MatrixXf m = MatrixXf::Random(3,2);
cout << "Here is the matrix m:" << endl << m << endl;
JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);
cout << "Its singular values are:" << endl << svd.singularValues() << endl;
cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU(... | ALGO | 0.999823 | 3.463409 |
172720b8-42d6-4cfc-8757-03a08fc94e8d | neoscent/firstSteps | BinaryTree.cpp | #include <iostream>
using namespace std;
struct node{
int dato;
node * L;
node * R;
};
node* enterData(node *A, int x);
int contarNodo(node * A);
void inorden(node *A);
void preorden(node *A);
void postorden(node *A);
int esta (node *A, int x);
node* eliminar(node* A, int x);
int main(){
int i=0, no[... | ALGO | 0.999817 | 3.92713 |
8132cf71-6951-4e1e-a78b-7115b75d4c12 | MarcWong/notes | leetcode/14.LongestCommonPrefix.cpp | // Write a function to find the longest common prefix string amongst an array of strings.
// If there is no common prefix, return an empty string "".
// Example 1:
// Input: ["flower","flow","flight"]
// Output: "fl"
// Example 2:
// Input: ["dog","racecar","car"]
// Output: ""
// Explanation: There is no common pr... | ALGO | 0.999821 | 6.403529 |
11f23344-3eeb-46f2-a6d0-a4b5e47e10e1 | sumit58591/Leetcode-POTD | Leetcode_2894.cpp | #include <bits/stdc++.h>
using namespace std;
int differenceOfSums(int n, int m) {
int num1 = 0, num2 = 0;
for(int i = 1; i <= n; i++) {
if(i % m != 0) num1 += i;
else num2 += i;
}
return num1 - num2;
}
int main() {
int n, m;
cin >> n >> m;
int differenceOfSumsOutput = dif... | ALGO | 0.999974 | 4.631627 |
f74352a3-b1c8-4084-937a-ad3e196b920a | UDSH111/Ultra-Dash | src/bip38.cpp | #include "bip38.h"
#include "base58.h"
#include "hash.h"
#include "pubkey.h"
#include "util.h"
#include "utilstrencodings.h"
#include "random.h"
#include <openssl/aes.h>
#include <openssl/sha.h>
#include <secp256k1.h>
#include <string>
/** 39 bytes - 78 characters
* 1) Prefix - 2 bytes - 4 chars - strKey[0..3]
* 2)... | ALGO | 0.995843 | 7.3343 |
1b541fd9-9ef5-434e-97a5-78a435d3e32c | phines/acsimsep | ThirdParty/Coin-Bonmin/Cbc/examples/modify.cpp | /*
This example shows the creation of a model from arrays, solution
and then changes to objective and adding a row
*/
#include "CbcModel.hpp"
// Using as solver
#include "OsiClpSolverInterface.hpp"
int main (int argc, const char *argv[])
{
// model is as exmip1.mps from Data/samples
int numberRows=5;
int n... | ALGO | 0.993987 | 5.373438 |
2137a188-6f68-4b67-aaf8-97d74f99bc6a | Park-youngjun/BAEKJOON | 3단계/3_1.cpp | #include<stdio.h>
int main() {
int n, i;
scanf_s("%d", &n);
for (i = 1; i < 10; i++) {
printf("%d * %d = %d\n", n, i, n*i);
}
return 0;
} | ALGO | 0.998944 | 3.672855 |
a1a34201-bd4f-470d-b6c9-564a876b4950 | Mulab11/cntt2016-hw1 | TC-SRM-594-div1-250/HalfSummer11.cpp | #line 2 "AstronomicalRecords.cpp"
#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cst... | ALGO | 0.99989 | 4.254734 |
425354d1-5b96-4ac5-bd9b-24171eff6230 | osmansajid/Contest-Problems | UVA/11965/9625083_AC_10ms_0kB.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t,tc=0;
cin>>t;
while(t--){
if(tc) cout<<endl;
int n;
cin>>n;
getchar();
string t[n+2];
for(int i=0;i<n;i++){
string s;
getline(cin,s);
t[i].push_back(s[0]);
... | ALGO | 0.993034 | 3.851167 |
564b0efc-beee-411a-b58b-b81d5362474a | SlivkaSadovka/spbspu-labs-2023-aap-a | zakozhurnikova.kristina/P1/sequence_counter.cpp | #include "sequence_counter.hpp"
#include <limits>
#include <stdexcept>
zakozhurnikova::SequenceAfterMaximum::SequenceAfterMaximum():
count_(0),
max_(std::numeric_limits< int >::min())
{}
void zakozhurnikova::SequenceAfterMaximum::operator()(int number)
{
size_t max_size = std::numeric_limits< size_t >::max();
... | TOOL | 0.874781 | 5.863681 |
11e256a3-26e4-4e8d-a37e-e93bb94b4bf2 | pesimov/playground-cpp | test_Morse/morseCodeComparison/morseCodeComparison/main.cpp | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
//......-...-..---.-----.-..-..-.. 5 HELL HELLO OWORLD WORLD TEST
const std::map<char, std::string> morse = {
{'A', ".-"}, {'B', "-..."},{'C', "-.-."},{'D', "-.."},
{'E', "."}, {'F', "..-."},{'G', "--."}, {'H', "...."},
{'I', ".."... | ALGO | 0.999101 | 4.699429 |
c56ba9b5-6bfc-4fe9-ae13-df7f43f1e327 | AnnaLebedeva1001/MAI | PPO/1sem/3lab/z1.cpp | /* C1,C2,...,Cm: ,
, , 1*/
#include <iostream>
#include <cstdlib>
using namespace std;
int min_element(int *arr, int n)
{
int i, min, i_min;
min = arr[0];
for (i = 0; i < n; ++i)
{
if (arr[i] < min)
{
min = arr[i];
i_min = i;
}
... | ALGO | 0.999992 | 3.226903 |
cb0bf4e3-0a8c-40c3-b1d4-966c2134a1bc | ishandutta2007/codeforces | gawry/normal/7/A.cpp | #include<cstdio>
#include<algorithm>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<numeric>
#include<cmath>
using namespace std;
#define ALL(t) t.begin(),t.end()
#define FOR(i,n) for (int i=0; i<(int)(n); i++)
#define FOREACH(i,t) for (typeof(t.begin()) i=t... | ALGO | 0.999574 | 3.802893 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.