uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
759a2963-4c45-462a-b069-a375c1309c5e | Ghar777/PublicWork | Laba3_3b_kurakov/main.cpp | #include <iostream>
#include <list>
#include <time.h>
using namespace std;
double summ(list<double> &l,int n)
{
auto first = l.begin();
auto last = l.end();
last--;
int x1;
int x2;
int x3;
int sum = 0;
while (last != l.begin())
{
x1 = *first;
first++;
x2 = *f... | ALGO | 0.99973 | 3.106508 |
af862ecb-caa8-4788-acd0-9ea9c0bca1fa | sarvex/leetcode-chicken | solution/1900-1999/1964.Find the Longest Valid Obstacle Course at Each Position/Solution.cpp | class BinaryIndexedTree {
public:
int n;
vector<int> c;
BinaryIndexedTree(int _n)
: n(_n)
, c(_n + 1) {}
void update(int x, int val) {
while (x <= n) {
c[x] = max(c[x], val);
x += lowbit(x);
}
}
int query(int x) {
int s = 0;
... | ALGO | 0.999951 | 6.021292 |
23a95d6e-4e12-447d-ba08-aaea981bd228 | PritamMakwana/BCA-sem-3 | C++ my programs/A19_default_arg.cpp | // #include<iostream.h>
// #include<conio.h>
#include<iostream>
using namespace std;
void sum(int a, int b, int c=0,int d=0);
void mul(int a,int b,int c=1);
int main(){
//clrscr();
sum(10,20,30,40);
sum(30,40,50);
sum(100,200);
mul(2,3,4);
mul(4,5);
//getch();
}
void sum(int a,int b,int ... | TOOL | 0.866736 | 3.094377 |
1edce49d-2582-4bbf-9f62-dd82800ca4dc | youdaous/standoffTracking | srmpc_pkg/src/testCasadi.cpp | #include <iostream>
#include <string>
#include <casadi/casadi.hpp>
int main(){
// create a symbolic vector
casadi::SX q = casadi::SX::sym("q", 7);
std::cout << "q: " << q << std::endl;
casadi::SX q2 = casadi::SX::sym("q2", 7);
std::cout << "q2: " << q2 << std::endl;
// horizontally stack
... | TOOL | 0.975133 | 6.010334 |
3d9e18fe-d0da-427f-b553-b65831aea69d | XiaoXiaoLui/LeetCode | Count_of_Range_Sum.cpp | /******************************************************************************************
Count of Range Sum
******************************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define mp make_pair
#define INIT_UNORDER(... | ALGO | 0.99998 | 5.254278 |
aaf8b28d-0c20-45fd-8d89-b32422a9d400 | Artelnics/opennn | eigen/test/sparse_permutations.cpp | static long int nb_transposed_copies;
#define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;}
#define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\
nb_transposed_copies = 0; \
XPR; \
if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \
VERIFY( (#XPR... | TEST | 0.858247 | 6.328657 |
708402c0-3d37-4cf3-8069-d31406cfee26 | Lucas-Naal/-Aplicaciones_de_Wearables | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
5c82fec7-9a1c-4fd3-8442-24333282d71d | saurav2000/pagerank | mr-pr-cpp.cpp | //Standard Libs
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
# pragma warning(disable: 4127)
// turn off checked iterators to avoid performance hit
# if !defined(__SGI_STL_PORT) && !defined(_DEBUG)
# define _SECU... | ALGO | 0.998045 | 4.328062 |
c6e5e3dc-161b-4f29-a996-49a8171aaf37 | P0L3NARUBA/roblox-2016-source-code | Contribs/boost_1_56_0/libs/graph/example/matching_example.cpp | #include <boost/graph/max_cardinality_matching.hpp>
using namespace boost;
typedef adjacency_list<vecS, vecS, undirectedS> my_graph;
int main()
{
// Create the following graph: (it'll look better when output
// to the terminal in a fixed width font...)
const int n_vertices = 18;
std::vector<std::string> ... | ALGO | 0.998617 | 6.273976 |
58807140-b804-4235-af95-0a2f53f01c9d | deogenesj/programming_education | C and Cpp/questao2_cartografica.cpp | /*questao 2 da prova de cartográfica*/
#include <iostream>
using namespace std;
int main (){
int n, soma;
cout << "Digite um numero: " << endl;
cin >> n;
soma = 0;
while (n != 0 && soma <= n){
soma = soma + n;
cout << "Digite um outro numero: " << endl;
cin >> numero;
}
if(n != 0){
cout << "A so... | ALGO | 0.985637 | 3.192395 |
33dbc90e-c6ce-46f7-a198-a4b3298b53cd | ishandutta2007/codeforces | yfhuang/normal/883/B.cpp | #include <iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
using namespace std;
const int N=410000;
int r[N],x[N]={0},mxx[N];
int du[N],n;
vector<int>nex[N],pre[N];
queue<int>q;
pair<int, int >p[N],j;
priority_queue<pair<int,int>>q2;
int app[N],len=0,K;
int mx(... | ALGO | 0.999995 | 3.755437 |
c94e6542-61ec-47d7-8e50-db13688ec717 | mortezasojodi/persian_time_selector | example/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.998905 | 6.785645 |
a58f1043-dc89-46d7-b6f0-1f6a2583e548 | zzHtCzz/CODE_Student | OPENCV/opencv-master/3rdparty/carotene/src/bitwise.cpp | #include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
struct BitwiseAnd
{
typedef u8 type;
void operator() (const uint8x16_t & v_src0, const uint8x16_t & v_src1,
uint8x16_t & v_dst) const
{
v_dst = vandq_u8(v_src0, v_src1);
}
v... | TOOL | 0.992384 | 6.675715 |
c6a46eb3-1e8f-41a1-94db-05c1ea6c4767 | u-wyh/luogu-code | P1141.cpp | #include<bits/stdc++.h>
using namespace std;
int n,m,ans[100002],x,y,f[1002][1002];
char s[1002][1002];
void dfs(int r,int c,int z,int lll){
if (r<0 || r>=n || c<0 || c>=n || f[r][c]!=-1 || s[r][c]-'0'!=z)
return;
f[r][c]=lll;
ans[lll]++;
dfs(r-1,c,!z,lll);
dfs(r+1,c,!z,lll);
dfs(r,c-1... | ALGO | 0.999871 | 3.86268 |
50f718b7-b1f0-41a3-bde2-cd8b63b29804 | llv22/pytorch-macOS-cuda | aten/src/ATen/native/sparse/cuda/SparseBlas.cpp | #define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/ExpandUtils.h>
#include <ATen/SparseCsrTensorUtils.h>
#include <ATen/native/Resize.h>
#include <ATen/native/sparse/cuda/SparseBlasImpl.h>
#include <ATen/native/sparse/SparseBlas.h>
#include <ATen/native/sparse/SparseCsrTensorMath.h>... | TOOL | 0.863803 | 6.337826 |
41c22aa5-5edb-479d-b2b7-1dd3844e68b0 | mwashief/step | Codeforces/1251-1500/1475/1475B.cpp | /*
Washief Hossain Mugdho
25 January 2021
697Div3 B
*/
#ifndef DEBUG
#pragma GCC optimize("O2")
#endif
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define fastio ios_base::sync_with_stdio(0)
#define untie cin.tie(0)
#define rep(i, n) for (int i = 0... | ALGO | 0.999067 | 4.330166 |
f92b5110-1ae8-4d78-8b3c-9a6acc7441a1 | Lee-Sunho/Algorithm-Study | Baekjoon/1436.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
int n;
cin >> n;
string key = "666";
int cnt = 1;
int num = 666;
while(cnt < n){
num++;
string str = to_string(num);
if(str.find(key) != -1){
cnt++;
}
}
cout << num;
}
| ALGO | 0.999477 | 3.370151 |
9f0ae080-66cc-46ff-b87b-b0b0ab56fd9a | julimonte03/ALGO3 | Guia2/ej1.cpp | #include <iostream>
#include <vector>
using namespace std;
bool dominLeft(vector<int> nums){
int top = nums.size();
int mid = nums.size()/2;
while (top > 1){
int leftSum = 0, rightSum = 0;
for(int i = 0; i < mid; i++){
leftSum += nums[i];
}
for... | ALGO | 0.999984 | 5.581286 |
afc63a7a-9916-4b24-8d11-551e32914ef4 | educatedpolarbear/Rep3 | DuongDiDFSVoiDoThiVoHuong.cpp | #include <bits/stdc++.h>
using namespace std;
bool check[1001];
bool checking;
vector<vector<int> > C;
int a, b, c, d;
void Try(int x, vector<int> K)
{
if (checking) return;
if (check[x]) return;
check[x] = 1;
K.push_back(x);
// cout<<x<<' ';
if (x == d)
{
for (int i = 1; i < K.size(); i++) cout<<K[i]<<' ';
... | ALGO | 0.999308 | 3.872178 |
876a7cec-bf46-426e-9d2a-83d63d135fbd | khoadangtgfit/file_cpp | phuongan.cpp |
#include<iostream>
using namespace std;
void PhuongAn()
{
for(int z=0;z<=40;z++)
{
for(int y=0;y<=100;y++)
{
for(int x=0;x<=200;x++)
if(x+2*y+5*z==200)
cout<<x<<" "<<y<<" "<<z<<endl;
}
}
}
int main()
{
PhuongAn();
}
| ALGO | 0.997243 | 3.088158 |
b1ca1a51-43d2-45bf-9b29-2ae9b41d7ae5 | ishandutta2007/codeforces | alireza_kaviani/normal/437/B.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
typedef long long ll;
typedef long double ld;
typedef pai... | ALGO | 0.999952 | 3.955488 |
cbd929a6-1c63-4f22-91eb-267aeb9203f1 | ishandutta2007/codeforces | 12tqian/normal/1399/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve_case(){
int n; cin >> n;
string s; cin >> s;
int zero = 0;
int one = 0;
for(int i = 0; i < n; i++){
if(s[i] == '0') zero++;
else one++;
}
if(one == n || one == 0){
cout << n << '\n';
... | ALGO | 0.999981 | 4.73508 |
b088b762-cad7-4890-8518-010e97f3b9e5 | ishandutta2007/codeforces | .tx/normal/1217/A.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
template <typename K, typename V = __gnu_pbds::null_type>
using tree = __gnu_pbds::tree<K, V, less<K>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
using llong = long ... | ALGO | 0.999812 | 4.33441 |
c10c3138-f946-4293-a3ce-8315c9d3a33f | DocRAID/boj | 8393.cpp | #include<iostream>
int main()
{
int a,result=0;
std::cin>>a;
for(int i=0;i<=a;i++){
result+=i;
}
std::cout<<result;
} | ALGO | 0.99928 | 3.801509 |
92cbaa63-ca2e-46a1-901e-c2bda755953f | ishandutta2007/codeforces | qwerasdfzxcl/normal/1326/A.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
int t;
scanf("%d", &t);
while(t--){
int n;
scanf("%d", &n);
if (n==1){
printf("-1\n");
continue;
}
if (n==2){
printf("43\n");
continue;
... | ALGO | 0.999481 | 3.923842 |
2f2202f0-a37f-4b52-a271-ea4a884123a9 | aryan-0069/CPP_basics | c++/z_random/diif_0fsum_btw_evenoddplaces.cpp | #include <iostream>
using namespace std;
int main(){
int array[]={1,2,3,4,5,6};
int oddsum=0;
int evensum=0;
for(int i=0;i<6;i++){
if(i%2==0 || i==0){
evensum=evensum + array[i];
}
else{
oddsum = oddsum + array[i];
}
}
cout<<"diff"<<evensu... | ALGO | 0.999969 | 4.634212 |
def6de59-e27d-4568-9432-42ee7185e39d | firiexp/contest_log | yukicoder/591.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;
template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
int main() {
char a, b;... | ALGO | 0.992994 | 4.193954 |
81225aa2-223e-4371-b3b2-b00f3320436a | UCM-FDI-DISIA/EDEN | dependencies/Bullet/src/test/Bullet2/Source/Tests/Test_maxdot.cpp | #include "LinearMath/btScalar.h"
#if defined(BT_USE_SSE_IN_API) || defined(BT_USE_NEON)
#include "Test_maxdot.h"
#include "vector.h"
#include "Utils.h"
#include "main.h"
#include <math.h>
#include <string.h>
#include <LinearMath/btVector3.h>
// reference code for testing purposes
static long maxdot_ref(const btSimdF... | TEST | 0.892868 | 6.718423 |
edba3eab-d5c6-4c50-a5e3-a789beec8580 | ishandutta2007/codeforces | popovicirobert/normal/1041/B.cpp | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
// 217
// 44
using namespace std;
int main() {
//ifstream cin("A.in");
//ofstream cout("A.out");
//int ;
ll a, b, x, y;
ios::sync_with_stdio(false);
cin >> a >> b >> x >> y;
ll g = __gcd(... | ALGO | 0.999059 | 3.867545 |
d6b7f863-7d56-4b13-9d10-a43579c14ff3 | N1SSLA/Laboratornaya | Лабы/№ 3/Laba/Laba/Laba.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
const int k = 100;
int main()
{
setlocale(LC_ALL, "Russian");
int n;
int a[k];
cout << "Введите колличество чисел в массиве: ";
cin >> n;
for (int i = 0; i < n; ++i)
{
cin >> a[i]; // Создание массива длиной n
}
for... | ALGO | 0.999874 | 4.06902 |
a24707f8-3489-4f6e-8211-2a73f3a98f4e | ishandutta2007/codeforces | denisson/normal/997/D.cpp | #include <bits/stdc++.h>
#define ll long long
#define db long double
#define ull unsigned long long
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
using namespace std;
#define pper(a) cout << #a << " = " << a << endl;
void per() { cout << endl; }
templ... | ALGO | 0.999969 | 3.856032 |
dab02fa6-49db-4f59-8d30-1b62f2690f79 | selarabila/Kuliah | SDA/Tugas Stack dengan Linked List.cpp | #include <iostream>
#include <conio.h>
using namespace std;
struct apa{
int data;
apa *next;
};
apa *head, *tail;
void push();
void view();
void pop();
void top();
void size();
void hapusStack();
int main(){
int pilih;
do{
cout<<"\t|-------------------------|"<<endl;
cout<<"\t|Program Stack Linked List|"... | ALGO | 0.983175 | 3.807485 |
42b5b2be-ad03-42c9-9f1f-88b5ea040458 | bpowers/boost | libs/graph/example/bfs-example2.cpp | #include <iostream>
using namespace boost;
template < typename TimeMap > class bfs_time_visitor:public default_bfs_visitor {
typedef typename property_traits < TimeMap >::value_type T;
public:
bfs_time_visitor(TimeMap tmap, T & t):m_timemap(tmap), m_time(t) { }
template < typename Vertex, typename Graph >
void... | ALGO | 0.999856 | 6.128194 |
ddb9b6cb-b15d-4e55-beec-7a32d6794f5c | kerwinzxc/BrontosaurusGore | Source/Physics/Source/GeomUtils/src/pcm/GuPCMContactSphereSphere.cpp | #include "GuGeometryUnion.h"
#include "GuContactBuffer.h"
#include "GuContactMethodImpl.h"
#include "PsVecTransform.h"
namespace physx
{
namespace Gu
{
bool pcmContactSphereSphere(GU_CONTACT_METHOD_ARGS)
{
PX_UNUSED(cache);
PX_UNUSED(renderOutput);
using namespace Ps::aos;
const PxSphereGeometry& shapeSphere0 = ... | ALGO | 0.969198 | 6.909424 |
27a6d690-2c02-4d78-8b44-580557b5202d | radekoziol/computational-methods | fourier-transform/fourier.cpp | //
// Created by radekkoziol on 31.10.18.
//
#include <iostream>
#include <vector>
#include <array>
#include <cmath>
#include <algorithm>
#include <memory>
#include <complex>
#include <functional>
#include <chrono>
using namespace std;
using namespace std::chrono;
/// <summary>
/// Template function used for clampin... | ALGO | 0.999355 | 5.375988 |
11d5f122-fac4-4427-b201-6922dcec2050 | zzm99/Algorithm-and-data-structure | Datastructure/数据结构练习题/链表/旋转链表.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* rotateRight(ListNode* head, int k) {
if(head == NULL) return head;
int N = 1;
ListNode* tail = hea... | ALGO | 0.999996 | 5.749421 |
0f4ac373-62c0-4533-8b67-00f7c619e623 | yjq349825834/DataStructureAndAlgorithms | zh-hant/codes/cpp/chapter_hashing/hash_map.cpp | /**
* File: hash_map.cpp
* Created Time: 2022-12-14
* Author: msk397 (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Driver Code */
int main() {
/* 初始化雜湊表 */
unordered_map<int, string> map;
/* 新增操作 */
// 在雜湊表中新增鍵值對 (key, value)
map[12836] = "小哈";
map[15937] = "小囉";
map[16750] = "小算";
... | TOOL | 0.905041 | 5.405406 |
e7c79698-6ffd-4cd7-a216-f71156dfa91c | dbadaya1/MazeSolver | src/gbfs.cpp | #include "include/Maze.h"
#include "include/Node.h"
#include <queue>
using namespace std;
class mycomparison
{
public:
bool operator() (Node* &lhs, Node* &rhs)
{
return lhs->h > rhs->h;
}
};
bool gbfs(Maze &maze) {
std::priority_queue<Node *, std::vector<Node *>, mycomparison> frontier;
Node *current = nullp... | ALGO | 0.999937 | 3.329244 |
1bde9abf-4b33-4b00-a6fd-5c2a9299f1d3 | hayashi-ryo/atcoder | docker/problems/cpp/ABC/abc314/a/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, x) for (int i = 0; i < (x); i++)
const string pi = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679";
int main()
{
int N;
cin >> N;
string ans = "3.";
for (int i = 0; i < ... | ALGO | 0.999592 | 3.698019 |
9c09bc0d-d47b-4224-8260-8b93f23cf109 | M45UDrana/DS-Algo-Problem-Solving | codeforces/812C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, m;
ll cal(ll x)
{
ll ans = 0;
for(ll i = 1; i <= x and ans <= m; i++)
ans += (x*i);
if(ans > m)
return (ll) 1e10;
return ans;
}
int main()
{
cin >> n >> m;
ll a[n];
for(int i = 0; i < n; i++)
c... | ALGO | 0.999984 | 4.397409 |
2386ee3c-d4e0-4772-b561-73b224fe3735 | sagardnshah/cs_coursework | parallel-and-distributed-computing/4_openmp-loop/mergesort_seq.cpp | #include <omp.h>
#include <stdio.h>
#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <algorithm>
#include <chrono>
#ifdef __cplusplus
extern "C" {
#endif
void generateMergeSortData (int* arr, size_t n);
void checkMergeSortResult (int* arr, size_t n);... | ALGO | 0.999234 | 5.625436 |
d2900395-7550-4bf8-8b50-248a49aae269 | liana0555/Parallel-Monte-Carlo-Simulation-for-Pi-Calculation | Parallel_Version_Performance_Measurement.cpp | #include <iostream> // for std::cout
#include <random> // for std::mt19937 and std::uniform_real_distribution
#include <ctime> // for time()
#include <omp.h> // for OpenMP functions
// Function to calculate Pi using the Monte Carlo method with OpenMP
double calculatePi(int numPoints) {
int insideCircle = 0... | ALGO | 0.999928 | 7.277359 |
80016e8b-c889-4407-9ec5-a4fbb8dfd87d | prjsensei/DSA-Basic-Series-Problems | Day 11.cpp | // DAY 11
// POTD
// Approach is to use binary search through upper and lower bound functions using the value 0 i.e neither positive nor negetive
class Solution {
public:
int maximumCount(vector<int>& nums) {
vector<int>::iterator upper ;
vector<int>::iterator lower ;
upper = upper_... | ALGO | 0.999911 | 5.672992 |
2db09b82-87a1-4af8-b217-578b476840a4 | raincross7/code-similarity | codes/train_code/problem084/problem084_411.cpp | #include <bits/stdc++.h>
#include <cmath>
using namespace std;
typedef long long ll;
int main(){
int n;
ll hai[87];
cin >> n;
hai[0] = 2;
hai[1] = 1;
for(int i = 2; i<=n; i++){
hai[i] = hai[i - 2] + hai[i - 1];
}
cout << hai[n] << endl;
}
| ALGO | 0.999987 | 3.781775 |
89966516-08e4-48ad-ba8b-844d8a8427e7 | PBL-OS-COMPILER/compiler-simulator | semantic_main.cpp | #include <fstream>
#include <iostream>
#include <memory>
#include "parser.h"
#include "semantic.h"
int main() {
auto root = parseCode("Code.txt");
SemanticAnalyzer analyzer;
std::ofstream outfile("semantic.txt");
if (!outfile) {
std::cerr << "Error: Could not open semantic.txt for writing\n";
... | TOOL | 0.856507 | 5.581978 |
3a6c90de-ac90-46a2-a6a5-738e294bc00c | moshexx/CPP-Projects | cpp_fs/quizzes/list.cpp | // Implement Class List, that supports insert, remove & find methods
// Don't forget the likes
#include <iostream>
template <typename T>
class List
{
public:
struct Node
{
Node *m_next;
T m_data;
};
List();
~List();
void InsertBefore(const T value, Node *node);
T Re... | TOOL | 0.976942 | 4.511768 |
5a961408-dbaf-4840-b588-8823653726ab | emanlaicepsa/codes | cf1284C.cpp | #include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define fi first
#define se second
#define reset(n,k) memset((n),k,sizeof(n))
#define all(n) n.begin(),n.end()
#define pb push_back
using namespace std;
using ll=long long;
using pii=pair<int,int>;
ll mod,n;
ll permu[250000];
int main(){
cin>... | ALGO | 0.999996 | 4.69858 |
5f274281-850f-4044-a92e-0c9b8674702d | EnriqueSaracho/CPSC-1160 | labs/lab03/main.cpp | #include <iostream>
#include <vector>
int cheapPath(const std::vector<std::vector<int>> &matrix, int row = 0, int col = 0, int total = 0)
{
// If it goes outside the matrix:
if (row == matrix.size() || col == matrix[row].size())
{
return -1;
}
// If it reaches a 0:
if (matrix[row][col] ... | ALGO | 0.999961 | 5.405389 |
b2d2062a-3ba4-40a0-a894-f68f1643fc5b | sarvex/leetcode-odin | solution/0000-0099/0094.Binary Tree Inorder Traversal/Solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999997 | 6.70788 |
0a14943b-be66-46b4-b40e-c8a68e10b413 | eve-le-guillou/assignment2 | src/mergeSort.cpp | //
// Created by wall-e on 23/10/2019.
//
#include "mergeSort.h"
void mergeSort(std::vector <int>& toSort) {
if (toSort.size() < 1) {
throw "input array is too small, needs to be at least 1 items long";
}
mergeSort(toSort, 0, toSort.size() - 1);
}
void mergeSort(std::vector <int>& toSort, std::ve... | ALGO | 0.99983 | 6.133641 |
765e87b8-3ca6-48e3-8c87-82f6045b907c | mohak1523/DS-FILE-MOHAK- | EXP-6(b).cpp | #include<iostream>
#include<string.h>
using namespace std;
int stack[20];
int top=-1;
void push(int x)
{
stack[++top] = x;
}
int pop()
{
return stack[top--];
}
int main()
{
char exp[20],*e;
int num,n1,n2,n3;
cout<<"Enter the string";
cin>>exp;
e=exp;
while(*e!='\0')
{
if(isdigit(*e))
{
... | ALGO | 0.99994 | 3.472772 |
e9226002-1049-47d4-8f79-54b17096ae29 | xbtan/ndnLibdash | ndn-cxx-ndn-cxx-0.5.0/src/security/transform/signer-filter.cpp | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "signer-filter.hpp"
#include "../../encoding/buffer.hpp"
#include "../detail/openssl.hpp"
namespace ndn {
namespace security {
namespace transform {
class SignerFilter::Impl
{
public:
Impl(const PrivateKey& key)
: m_key(key)
, m_md(... | TOOL | 0.895703 | 6.986311 |
c184f7d4-57cc-404b-92e7-7a9eaccb3c5d | skeleton625/BOJ | others/11575/main.cpp | #include <iostream>
#include <string>
using namespace std;
int t, a, b;
string str;
int main() {
ios::sync_with_stdio(false);
cin >> t;
while (t--) {
cin >> a >> b >> str;
for (int i = 0; i < str.size(); i++) str[i] = (a*(str[i] - 'A') + b) % 26 + 'A';
cout << str << endl;
}
return 0;
} | ALGO | 0.999734 | 4.290183 |
278aa5b2-27c6-40e9-a3cb-0c72fed30c47 | qhoa256/PTIT-CODE-CPP | CPP0122.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll x, ll y)
{
if (y == 0)
return x;
else
return gcd(y, x % y);
}
ll lcm(ll x, ll y)
{
return x / gcd(x, y) * y;
}
ll solve(ll n)
{
ll result = 1;
for (ll i = 2; i <= n; i++)
{
result = lcm(resul... | ALGO | 0.999953 | 5.835706 |
2333bb33-5cd1-4273-bb9b-8e5d1624f5df | RonaldoQuang/Codeptit-TRR2 | TRR3004-3.4 Chu trinh Euler.cpp | #include <bits/stdc++.h>
using namespace std;
int a[101][101], b[101][101], n;
int chuaxet[101];
int BFS(int i){
queue<int> q;
q.push(i);
vector<int> v;
v.push_back(i);
chuaxet[i]=0;
while(!q.empty()){
int s=q.front();
q.pop();
for(int j=1;j<=n;j++){
if(b[s][j]==1&&chuaxet[j]==1){
b[j][s]=0;
chua... | ALGO | 0.999852 | 4.030367 |
ad1cde9e-4a81-4539-9e14-f92a8020c886 | varun2001-vit/OOPS | vpropel.cpp | #include<iostream>
using namespace std;
class customer
{
public:
char name[20];
char mob[20];
char id[20];
int n;
int bill[30];
public:
void get()
{
cin>>name>>mob>>id>>n;
for(int i=0;i<n;i++)
{
cin>>bill[i];
}
}
int calc_Total()
... | ALGO | 0.938478 | 3.234783 |
f6d3436d-bb3e-401d-a5a9-1a274a45d40d | iamrajee/competitive | atcoder/AtCoderBeginnerContest136/s/a.cpp | #include<bits/stdc++.h>
using namespace std;
int n,m,q,T;
int i,j,k,flag,counter;
int a,b,t;
long long int sum;
char c;
string s;
vector <int> v;
set <int> st;
multiset <int> ms;
map <int,int> mp;
int main(){
cin>>n;
for(i=0;i<n;i++){
cin>>t;
v.push_back(t);
}
return 0;
} | ALGO | 0.999529 | 3.150388 |
973e7245-ebf9-4ab1-a9fa-8f69a36dc3bb | lfmiranda/ProgrammingQuestions | dynamicProgramming/editDistance.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
* - Problem:
* Edit distance
*
* - Problem description:
* Given two words A and B, find the minimum number of steps required to convert A to B (each operation is counted as 1
* step).
* You have the following 3 operations permitted on a word:
* In... | ALGO | 0.999978 | 5.884206 |
b40a03f4-fb0d-4753-9fb7-6ae520048cef | AbhaySrivastava26/cpp | linkedlist/linkedlist/extractionofdigits.cpp | #include<iostream>
#include<climits>
#include <bits/stdc++.h>
using namespace std;
void extraction(int n){
int count =0;
while(n>0){
int last_digit=n%10;
count+=1;
n=n/10;
}
cout<<count<<endl;
}
void revnum(int n){
int rev=0;
while(n>0){
int last_digit=n%10;
n=n/10;
rev=(rev*10)+last_digit;
}
... | ALGO | 0.998107 | 4.302783 |
00ec69c9-93ac-4d52-89db-f8c1c3189ed2 | heejun9909/HJLeetcode | 0042-trapping-rain-water/0042-trapping-rain-water.cpp | class Solution {
public:
int trap(vector<int>& height) {
// We have 2 solutions for this problem
// Both solutions will have time complexity of O(n)
// The first solution will have space complexity of O(n)
// The second solution will have space complexity of O(1)
// The firs... | ALGO | 0.999996 | 6.943535 |
82640e71-dc01-409f-9503-6c404b2de79f | flow-J/Exercise | garbage/Algorithm_in_c++/test12.7.cpp | class
{
private:
Item searchR(int l, int r, Key v)
{
if (l > r)
return nullItem;
int m = (l+r)/2;
if (v == st[m].key()) return st[m];
if (l == r) return nullItem;
if (v < st[m].key())
return searchR(l, m-1, v);
else
return searc... | ALGO | 0.999949 | 4.057117 |
ec4930be-9d23-4546-9e2c-a5ce88b9f81f | Shrey-ansh10/.cpp | patterns/invertedPyramid.cpp | #include <bits/stdc++.h>
using namespace std;
//Q. inverted praymid with num
int main() {
int n = 4;
// char ch = 'A';
for(int i=0; i<n; i++){ //outer loop
for(int j=0; j<i; j++){ //first inner loop for spaces
cout << " ";
}
for(int j=0; j<n-i; j++){ // l... | ALGO | 0.999985 | 3.84884 |
9ed53305-d070-4de1-866d-38ccdb5cd543 | nathan-dlr/LeetCode-practice | 334-increasing-triplet-subsequence/increasing-triplet-subsequence.cpp | class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int size = nums.size();
int min1 = pow(2,31) - 1;
int min2 = min1;
for (int i = 0; i < size; i++) {
if (nums[i] < min1) {
min1 = nums[i];
}
else if (nums[i] < min... | ALGO | 0.999969 | 5.926346 |
29fa209c-090b-4c03-bdd5-92490bb4ff08 | Kashad55/DSA-Zone | Array/TripletSum.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
// The provided findTriplets function
vector<vector<int>> findTriplets(vector<int> arr, int n, int K) {
vector<vector<int>> ans;
sort(arr.begin(), arr.end());
for (int i = 0; i < n - 2; i++) {
// Skip duplicates for... | ALGO | 0.999826 | 6.169542 |
7a32da88-ffca-4431-b0b7-4a4dd454952e | MoOo2mini/SSUalgo | 이소현/1463.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n;
cin>>n;
while(n--){
int dp[12]={0,};
int x;
cin>>x;
dp[0]=0;
dp[1]=1;
dp[2]=2;
dp[3]=4;//111 21 3 12
for(int i=4;i<=x;i++){
dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
}
cout<<dp[x]<<endl;
}
}
int... | ALGO | 0.999868 | 4.008125 |
eecd58c3-f2cd-475c-9bed-bf4192d63988 | 1998at/Self-Driving-Car-Projects | project_11_path_planning/src/Eigen-3.3/bench/product_threshold.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
#define END 9
template<int S> struct map_size { enum { ret = S }; };
template<> struct map_size<10> { enum { ret = 20 }; };
template<> struct map_size<11> { enum { ret = 50 }; };
template<> struct ... | TOOL | 0.953882 | 5.102006 |
0d8115b2-b9fb-4455-b463-d54df344f3a6 | cuongnv-ict/NinjaJump | Wall 2/cocos2d/cocos/math/MathUtil.cpp | #include "MathUtil.h"
#include "base/ccMacros.h"
NS_CC_MATH_BEGIN
void MathUtil::smooth(float* x, float target, float elapsedTime, float responseTime)
{
GP_ASSERT(x);
if (elapsedTime > 0)
{
*x += (target - *x) * elapsedTime / (elapsedTime + responseTime);
}
}
void MathUtil::smooth(float* x, ... | TOOL | 0.964591 | 6.296041 |
115efd47-9109-47dd-a260-38a4a611fcaf | jcheng1103/USACO-practice | 63/63/main.cpp | #include <iostream>
#include <algorithm>
using namespace std;
struct segment{
int a, b;
};
bool compare (segment a, segment b){
return a.a < b.a;
}
int main() {
int n, l, r;
cin >> n >> l >> r;
segment a[100000];
for (int i = 0; i < n; i++){
cin >> a[i].a >> a[i].b;
}
sort(a, ... | ALGO | 0.999982 | 3.948531 |
997823e9-7a93-4203-b2fa-bfe74cc4156f | Pratham-Sharda/LEETCODE_SOLN | 0994-rotting-oranges/0994-rotting-oranges.cpp | class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
int n=grid.size();
int m=grid[0].size();
vector<vector<int>> visited(n,vector<int>(m,0));
queue<pair<int ,int> >q;
for(int i=0;i<n;i++){
for (int j=0;j<m;j++){
if(grid[i][j]=... | ALGO | 0.999977 | 6.129469 |
a2c1deb1-f1f6-41d7-900f-6bb2bfa61c67 | batman-rises/Striver-s-A-to-Z-DSA-SHEET- | ARRAYS/left_rotate_by_1place.cpp | func(arr, n)
{
int temp = arr[0];
for (int i = 1; i < n; i++)
{
arr[i - 1] = arr[i];
}
arr[n - 1] = temp;
return arr;
} | ALGO | 0.999223 | 3.559813 |
070f5c3f-8e82-4fa7-9c05-fc96e5b820b1 | MinPika/DSA-Essentials- | ex3.cpp | #include <iostream>
#include <vector>
using namespace std;
int lowerbound(vector<int> arr,int val)
{
/*bruteforce
int n=arr.size();
int store = -1;
int mini=1000;
int minim=1000;
for(int i=0;i<n;i++)
{
if(arr[i]==val)
{
mini=val;
break;
}
... | ALGO | 0.999993 | 4.280488 |
57ac170e-35d4-44b9-a19e-8e7137b4bcdc | tomasdaveiga/Advent-of-code | 2015/7/main.cpp | #include <iostream>
#include <map>
#include <vector>
#include <string>
#include <cctype>
#include <fstream>
class Circuit{
public:
Circuit();
void signal(const std::string& input, const std::string& target);
void and_operator(const std::string& input1, const std::string& input2, const std::string& target);... | ALGO | 0.998583 | 5.521411 |
e0accce4-7d21-40be-b4e7-d218076944e8 | ishandutta2007/codeforces | leinad3/normal/1537/D.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
int t, n, i, j, k, a, b, A[200010];
main()
{
for(scanf("%lld", &t);t--;)
{
scanf("%lld", &n);
a=2;
while(a<n)a*=4;
if(a==n)puts("Bob");
else if(n%2==1)puts("Bob");
else puts("Alice");
}
} | ALGO | 0.999924 | 3.837629 |
52f9480f-aa32-4df1-a275-efbd7ad420d0 | Yogeshwaran09102019/DS | Ex7/AVLApp.cpp | // APP
#include"AVLHeader.h"
int main()
{
int ch;
bool a;
AVL t;
Travel T,T1;
Node *temp;
do
{
cout<<"Enter"<<endl;
cout<<" 1:Check for empty"<<endl;
cout<<" 2:Insert a TravelPoint"<<endl;
cout<<" 3:Display a TravelPoint by Inorder"<<endl;
cout<<" 4:Display a TravelPoint by Preorder"<<endl;
cout<... | ALGO | 0.998641 | 3.472207 |
c80f7b29-8b36-43db-8360-aa93e49b6efc | Rafi-Rifat/Graph | dijkstra_set.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int INF = 1e9 + 10;
vector<pair<int, int>> g[N];
vector<int> vis(N, 0);
vector<int> dist(N, INF);
void dijkstra(int source)
{
set<pair<int, int>> st;
st.insert({0, source});
dist[source] = 0;
while (!st.empty())
{
au... | ALGO | 0.999976 | 5.008156 |
fecd5157-68ef-44e1-abd2-620de2a1d6d2 | Yashraghuvans/DataStructureAndAlgorithm | Leetcode/Binary Search/Medium/search_in_rotatedSortedArray.cpp.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
//linear search solution (brute force solution)
int search(vector<int>& nums, int target) {
for(int i=0;i<nums.size();i++){
if(nums[i]==target){
return i;
}
}
return -1;
}
... | ALGO | 0.999834 | 5.783589 |
b86952e1-afd8-4d21-81c2-6453697a4b99 | mohitmcanitt/Programming-Code | DP/05. Minimum number of moves to reach nth stairs,, given allowed jumps at each steps.cpp |
// input : 10
// jumps array : 3 3 0 2 1 2 4 2 0 0
// dp array : 4 4 -1 3 3 2 1 -1 -1 -1 0
// output: 4 minimum four jumps required to reach top stairs
// if jumps allowed from any stairs is 0 assigned -1 in dp array
#include <iostream>
#include<climits>
using namespace std;
int main() {
int n;
cin>>n;
in... | ALGO | 0.999992 | 3.774393 |
da561fc8-5098-4c8a-8cfb-70a035c883df | ThuHome27/nam_4_ki_2 | samsung/0318/dfs.cpp | /*input
7 6
1 4
1 6
2 5
3 4
3 6
4 6
*/
#include <stdio.h>
#include <iostream>
#include <vector>
#define MAXN 10
using namespace std;
vector<int> ke[MAXN];
bool duyet[MAXN];
int n, m;
void dfs(int u) {
duyet[u] = true;
// cout << u <<' ';
for (int i = 0; i < ke[u].size(); ++i) {
int v = ke[u][i];
if (!duyet[v... | ALGO | 0.999393 | 4.964546 |
0f34dd16-2a01-4cf5-b3c9-97bc8508d040 | north-h/Match_code | 2024/牛客周赛 Round 34/A.cpp | // #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define PII pair<int, int>
#define endl '\n'
#define debug1(a) cout << #a << '=' << a << endl
#define debug2(a, b) cout << #a << '=' << a << ' ' << #b << '=' << b << endl
#define lf(x) fixed << setprecision... | ALGO | 0.999882 | 4.121524 |
aa8ff406-0a6a-47ab-bdce-d41afb8e1d66 | llm-db/understanding-gpu-architecture-implications-on-llm-serving-workloads | kernels/gemm/pkg/gemm_unified/csrc/semi/gemm_11_amd.cpp | #include <cuda_runtime.h>
#include <torch/extension.h>
#include <cstdio>
#include <rocwmma/rocwmma.hpp>
#include <rocwmma/rocwmma_coop.hpp>
#include <rocwmma/rocwmma_transforms.hpp>
#include "rocwmma/internal/types.hpp"
namespace gemm_unified {
using namespace rocwmma;
__global__ void finegemm_11_kernel(int M, int ... | TOOL | 0.970602 | 6.174316 |
d0819ea6-c3e0-4c7c-86eb-629a4d0e92d2 | ZPZhou-lab/MathematicalModeling | 2018 CUMCM-B/Code/problem1.cpp | #include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<algorithm>
#include<fstream>
#include<map>
using namespace std;
#define WAIT0 0 // ûϵĵȴ
#define WAIT1 1 // cncһ
#define PROC 2
#define REPAIR 3
int mes; // ȴrgvcncĸҲǰrgvյϢ
struct CNC{
int id;... | ALGO | 0.997557 | 3.021349 |
52abf7d3-a29f-4dd9-8be7-8e4b9e97a446 | DanielLangr/abhsf | spmv/orig/morton.cpp | #include <algorithm>
#include <cstdint>
#include <cassert>
#include <iostream>
#include <map>
#include <string>
#include <stdexcept>
#include <tuple>
#include <vector>
#include <abhsf/utils/colors.h>
#include <abhsf/utils/math.h>
#include <abhsf/utils/matrix_properties.h>
#include <abhsf/utils/matrix_market_reader.h>
... | DATA | 0.971247 | 4.598869 |
1e8ab757-58e6-4536-96a8-4e0b45da189b | aadityaverma2011/leet150 | lt76.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.999972 | 6.252284 |
a0f53e44-8392-4071-bc8a-6330efc7c481 | michelanthony/CloneSiconosMaster | kernel/src/modelingTools/NewtonEulerDS.cpp | #include "CxxStd.hpp"
#include "NewtonEulerDS.hpp"
#include "BlockVector.hpp"
#include "BlockMatrix.hpp"
#include <boost/math/quaternion.hpp>
#include <iostream>
//#define DEBUG_NOCOLOR
//#define DEBUG_BEGIN_END_ONLY
// #define DEBUG_STDOUT
// #define DEBUG_MESSAGES
#include <debug.h>
void computeRotationMatrix(doub... | ALGO | 0.999699 | 4.263377 |
662e7770-bd62-458f-bf98-ce9293fa79d3 | zhangqhjy/gtsam-develop | gtsam/3rdparty/GeographicLib/src/PolarStereographic.cpp | #include <GeographicLib/PolarStereographic.hpp>
namespace GeographicLib {
using namespace std;
PolarStereographic::PolarStereographic(real a, real f, real k0)
: _a(a)
, _f(f)
, _e2(_f * (2 - _f))
, _es((_f < 0 ? -1 : 1) * sqrt(abs(_e2)))
, _e2m(1 - _e2)
, _c( (1 - _f) * exp(Math::eatanhe(... | TOOL | 0.970429 | 6.786496 |
cd76e112-7313-45fb-87a3-d293d679fb9a | huseyinnates/OpenSceneGraphWithCDBSupport | src/osg/ComputeBoundsVisitor.cpp | #include <osg/ComputeBoundsVisitor>
#include <osg/Transform>
#include <osg/Drawable>
#include <osg/Geode>
using namespace osg;
ComputeBoundsVisitor::ComputeBoundsVisitor(TraversalMode traversalMode):
osg::NodeVisitor(traversalMode)
{
}
void ComputeBoundsVisitor::reset()
{
_matrixStack.clear();
_bb.init()... | TOOL | 0.944776 | 6.543984 |
58312263-d80b-4c4c-8a8b-315f8bd098db | roy-sourov/LeetCode-Solution | Competition/BiWeeklyContest5/parallel-courses.cpp | //https://leetcode.com/contest/biweekly-contest-5/problems/parallel-courses/
class Solution {
public:
int minimumSemesters(int N, vector<vector<int>>& relations) {
vector<int> prereq_num(N+1,0);
int ans=0;
vector<vector<int>> can_do(N+1);
for(auto x : relations){
can_do[... | ALGO | 0.99998 | 5.65067 |
7031e81b-b979-4750-9a08-e5ecd6dad372 | kazi-nayeem/Programming-Problems-Solutions | codeforces/584/B.cpp | //#include <bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
#define MX 100005
#define inf 100000000
typedef l... | ALGO | 0.999966 | 3.821245 |
9fbf60d2-b403-4bfc-baac-2b3f2238b906 | kawsarkk1/Codes | codeforece/div4 D.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll t,n,x,y,i,j,m,k,h,z,b,c,d;
cin>>t;
while(t--)
{
cin>>n>>m;k=0;
queue<ll>q;
q.push(n);
x=q.front();
while(!q.empty())
{
if(x==m)
{
k=1;
... | ALGO | 0.999838 | 3.441349 |
06dc88e7-997e-490d-8482-e66f9f113407 | actian-geospatial/ogr-ingres | 1.8.1/port/cpl_hash_set.cpp | #include "cpl_conv.h"
#include "cpl_hash_set.h"
#include "cpl_list.h"
struct _CPLHashSet
{
CPLHashSetHashFunc fnHashFunc;
CPLHashSetEqualFunc fnEqualFunc;
CPLHashSetFreeEltFunc fnFreeEltFunc;
CPLList** tabList;
int nSize;
int nIndiceAllocated... | ALGO | 0.97801 | 5.836484 |
36655626-57fe-4b3a-aa8d-d8db442d4231 | Aman-Manwani/MY-LEETCODE-DAILY-SUBMISSIONS | 1679-max-number-of-k-sum-pairs/1679-max-number-of-k-sum-pairs.cpp | class Solution {
public:
int maxOperations(vector<int>& nums, int k)
{
sort(nums.begin(),nums.end());
int i=0;
int j=nums.size()-1;
int count=0;
while(i<j)
{
if(nums[i]+nums[j]==k)
{
count++;
i++;
... | ALGO | 0.999962 | 5.932649 |
dab1de8d-8fe9-4734-afdc-916b8f67273a | raincross7/code-similarity | codes/train_code/problem018/problem018_226.cpp | #include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long int
using namespace std;
int mod = 1e9 + 7;
int32_t main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
fastio;
string s;
cin >>... | ALGO | 0.999702 | 4.082034 |
b06b8dfd-9fee-4243-affa-23976ff41bc1 | JoeHadley/Sharpe | Sharpe_v2.cpp | #include <iostream>
#include <fstream>
#include <random>
#include <vector>
#include <cmath>
#include <ctime>
//#include "weapon.h"
//#include "target.h"
using namespace std;
const double g = 9.81;
mt19937 initializeRandomGenerator() {
unsigned seed = static_cast<unsigned>(time(nullptr));
mt19937 rng(seed);
... | ALGO | 0.970046 | 4.606825 |
80bf1e5d-43a3-4a4f-b4a5-cfbf7b7fe046 | baiyangbupt/POJ | poj1032.cpp | #include<iostream>
#include<string>
using namespace std;
int n;
int mutate(string &s, int p){
if(p>=n)
return 0;
if(s[p]<='Z'&&s[p]>='A'){
int mut = mutate(s,p+1);
s[p] = mut%10+'0';
return mut+1;
}
else i... | ALGO | 0.99403 | 3.27961 |
661721be-40a8-4664-aee5-d18b4bd2949f | edge555/Online-Judge-Solves | Codeforces/Gym/101147 (2016-2017 ACM-ICPC, Egyptian Collegiate Programming Contest (ECPC 16))/D. Popcorn.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pf printf
#define sc scanf
#define sf(n) scanf("%d",&n)
#define sff(n1,n2) scanf("%d %d",&n1,&n2)
#define sfff(n1,n2,n3) scanf("%d %d %d",&n1,&n2,&n3)
#define sl(n) scanf("%lld",&n)
#define... | ALGO | 0.999755 | 3.867311 |
1817775f-7aa0-4b59-9b8a-3c7ed3e5d659 | daid/SeriousProton2 | extlibs/Box2D/Dynamics/Joints/b2FrictionJoint.cpp | #include <Box2D/Dynamics/Joints/b2FrictionJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Point-to-point constraint
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i + rx j)
//... | ALGO | 0.983946 | 7.570709 |
b61cdfb5-aa11-42da-8def-a708066fdbd8 | EslamAsHhraf/Codeforces-practice | C1/483C - Diverse Permutation.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve()
{
ll n, k;
cin >> n >> k;
int i = 1, j = n;
bool flag = 0;
if (k % 2 == 0)
flag = 1;
while (k >1) {
cout << i<<" ";
k--;
i++;
if ( k!=1)
{
cout << j << " "... | ALGO | 0.999997 | 3.656008 |
f6e6133d-2416-4ce3-bbf1-3243e34a67f8 | Month7/hduOj | CC的神奇背包/CC的神奇背包/源.cpp | //#include <stdio.h>
//#include <iostream>
//#include <algorithm>
//using namespace std;
//#define ll long long
//#define PI 3.14159
//int t;
//int n, k;
//struct node
//{
// int x, y;
//}a[10000];
//int cmp(node a, node b)
//{
// return a.x<b.x; //Сȷ
// return a.y>b.y; //ݴȷ
//}
//int f = 1;
//int main()
//{
// scanf("... | ALGO | 0.999964 | 4.552992 |
81a38e97-86c6-4c3f-b448-694f4e512e66 | ishandutta2007/codeforces | tute7627/normal/1699/C.cpp | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end())
#define spa << " " <<
#define fi first
#... | ALGO | 0.999925 | 3.64012 |
a6be8fe6-5b92-41b7-8131-273be78dcfe3 | the-future-codemaster/DSA-LAB-AMRUT | amrut dsa lab files/lab 8/binarytree.cpp | //Menu driven program to implement tree ADT using a character binary tree.
#include <iostream>
using namespace std;
class Tree {
private:
struct Node {
char data;
Node *left, *right;
};
Node *root;
void preorderTraversal(Node* node);
void inorderTraversal(Node* node);
void pos... | ALGO | 0.999854 | 6.216612 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.