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 |
|---|---|---|---|---|---|---|
7e7fd1f8-6edf-4848-aeea-1fcf95abbfcd | vikramgurjar2/cpp-practice | graph_intro.cpp | #include <iostream>
#include <unordered_map>
#include <list>
#include <bits/stdc++.h>
using namespace std;
class graph
{
public:
unordered_map<int, list<pair<int, int>>> adj;
void addedges(int u, int v, int distance)
{
pair<int, int> p = make_pair(v, distance);
adj[u].push_back(p);
}
... | ALGO | 0.999965 | 4.569157 |
db9f097c-ebc2-4361-bd02-72ef41f86357 | prince-aethelred/python-like-print-for-cpp | test2.cpp | #ifdef __GNUC__
// This block will only be included when using g++, since __GNUC__ is defined by GCC.
#include <bits/stdc++.h>
#endif
#ifdef __clang__
// This block will only be included when using clang++, since __clang__ is defined by Clang.
// Include your individual headers here
#include <iostream>
#include <vecto... | TOOL | 0.991575 | 5.447362 |
d4adfc49-0154-4503-95d0-710de6555302 | Hyunsdb/Algorithm_Cpp | boj/backtracking/14888.cpp | #include <iostream>
using namespace std;
int oper[4] = { 0, };
int arr[11] = { 0, };
int N;
int result;
int MAX = -1000000001;
int MIN = 1000000001;
void gogo(int result,int idx) {
if (idx == N) {
if (result > MAX) MAX = result;
if (result < MIN) MIN = result;
return;
}
for (int i = 0; i < 4; i++) {
if (op... | ALGO | 0.999969 | 3.726164 |
b004dff5-5067-4d79-9b60-b8346b984d0d | dsorvq/cses-solutions | graph-algorithms/1666-building-roads-dsu.cpp | #include <bits/stdc++.h>
#include <numeric>
using namespace std;
class dsu {
public:
dsu(int v) : size(v, 1), link(v) {
iota(begin(link), end(link), 0);
}
int find(int x) {
while (link[x] != x) {
x = link[x];
}
return x;
}
void unite(int a, int b) {
a = find(a);
b = find(b)... | ALGO | 0.999992 | 4.39423 |
c4b07942-ed7f-4ca5-b548-5aef3d0b865f | swatantra150/For_CP | STL/MonotoneDeque.cpp | #include<iostream>
#include<vector>
#include<cmath>
#include<set>
#include<map>
#include<deque>
using namespace std;
class monotoneDeque{
public:
deque<int>dq;
void insert(int x){
while(!dq.empty() and dq.back()>x){
dq.pop_back();
}
dq.push_back(x);
}
void remove(int x){
if(dq.front()==x){
dq.po... | ALGO | 0.999998 | 3.499296 |
98cb1c4c-f7cc-493c-a084-d654642a459c | VFEUVRAY/TrainingCPP | set_match.cpp | /*
** ETNA PROJECT, 16/05/2021 by feuvra_v
** set_match
** File description:
** set_match
*/
#include <vector>
#include <iostream>
#include <map>
#include <unordered_map>
#include <unordered_set>
using namespace std;
bool set_et_match(std::vector<int> numbers, int n)
{
std::unordered_map<int,bool> nummap(nu... | ALGO | 0.996785 | 5.27515 |
f5ea5ec5-f70b-491f-bf63-ae9a2c419d5d | circle-oo/PS | BOJ/13352/13352.cpp | #include<bits/stdc++.h>
using namespace std;
using lld = long long int;
using lf = long double;
using uint = unsigned int;
using ulld = unsigned long long int;
using pii = pair<int, int>;
using pll = pair<lld, lld>;
int N;
vector<pii> A;
bool rst = false;
bool inLine(int px, int py, int dx, int dy) {
if (dx ==... | ALGO | 0.999996 | 4.324255 |
e1d30b02-5bd0-4e9e-b1bc-9f01439c652c | KitsuneDev/Blender | extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorldMt.cpp | #include "btDiscreteDynamicsWorldMt.h"
//collision detection
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
#include "BulletCollision/CollisionShapes/btCollisi... | ALGO | 0.99235 | 3.223687 |
d8dd741a-6ac0-47ab-9f28-b25fd3114e64 | SteinVandenbroeke/TranspilerMB | tokenizer/ENFA.cpp | //
// Created by jens on 8/12/22.
//
#include "ENFA.h"
//ENFA_State
const std::string &ENFA_State::getName() const {
return name;
}
void ENFA_State::setName(const std::string &naam) {
ENFA_State::name = naam;
}
std::vector<ENFA_State *> ENFA_State::getNextState(const char s){
if(nextState.find(s) == nex... | ALGO | 0.995387 | 4.494487 |
d03397c1-a703-44c4-a34d-3fb842fe0fb2 | dubeyayushi/Competitive-Programming | Strivers A2Z DSA Sheet/Step-16: Dynamic Programming/Lec-3: 2D-3D DP and DP on Grids/07_chocolates_pickup.cpp | // https://www.geeksforgeeks.org/problems/chocolates-pickup/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=chocolates-pickup
class Solution {
public:
int dp[70][70][70];
int helper(int i, int j1, int j2, vector<vector<int>>&grid){
if (i<0 || i>=grid.size() || j1<0 || j2<0 |... | ALGO | 0.999728 | 5.919463 |
0d7f4247-4144-4e5b-8a14-2b6b0a54accc | adikul30/competitive-programming | codechef/MIXCOLOR.cpp | /*
* adikul30
* Aditya Kulkarni <<EMAIL>>
*/
#include <bits/stdc++.h>
using namespace std;
#define INF 1e9
#define EPS 1e-9
#define REP(i, a, b) for(ll i = a; i < b; ++i)
#define REPR(i, a, b) for(int i = a; i >= b; --i)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define what_is(... | ALGO | 0.999924 | 4.118746 |
ff1e48f9-f9b9-40a5-be1f-f5f90c98378f | Tri11Paragon/Advent-Of-Code-2024 | src/day9.cpp | #include <days.h>
#include <blt/math/log_util.h>
#include <vector>
#include <limits>
#include <algorithm>
#include <blt/fs/loader.h>
#include <blt/iterator/enumerate.h>
#include <blt/iterator/iterator.h>
#include <blt/iterator/zip.h>
#include <blt/std/hashmap.h>
#include <blt/math/vectors.h>
#include <blt/std/assert.h>... | ALGO | 0.990219 | 4.835896 |
18e44ef7-54d9-4182-a523-ec2068d62127 | de-cryptor/Company-Wise-Coding-Questions | Amazon/how_many_x.cpp | /*
@Author - Jatin Goel
@Institute - IIIT Allahabad
Hardwork definitely pays off.
There is no substitute of hardwork.
There is no shortcut to success.
*/
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define F first
#define S second
#define PII pair<int,int>
int countDigits(int n,int x)
{... | ALGO | 0.999289 | 4.239243 |
d4c8c4b0-b728-4f0f-a8db-099c2a11eee9 | raincross7/code-similarity | codes/train_code/problem070/problem070_206.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
int main()
{
ll x, a, b;
cin >> x >> a >> b;
if (b - a <= 0)
{
cout << "delicious" << endl;
}
else if (b - a <= x)
{
cout << "safe" << endl;
... | ALGO | 0.997764 | 3.844708 |
10b3c2d1-125e-4aeb-94a9-7b0fce55d6ef | KumkumMalhotra/DSA-ProblemSolving | cpp/11-Arrays/Questions/ReverseArray.cpp | #include<iostream>
using namespace std;
void ReverseArray(int arr[],int size){
int start=0,end=size-1;
while(start<=end){
if(start==end){
arr[start]=arr[end];
}else{
int temp;
arr[start] =arr[start] ^ arr[end];
arr[end]=arr[start] ^ arr[end];
arr[sta... | ALGO | 0.999942 | 4.693289 |
c3d5efed-3585-414e-87c7-7dc3eefc7aa0 | PrakharM9/coding | DSA/bfs graph.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int>bfsGraph(int V,vector<int>adj[]){
int vis[V]={0};
vis[0]=1;
vector<int>bfs;
queue<int>q;
q.push(0);
while(!q.empty()){
int node=q.front();
q.pop();
bfs.push_back(node);
for(auto it:adj[node]){
if(... | ALGO | 0.999995 | 4.828505 |
99101e2c-ccd7-407d-99b1-ff9eab1b46b3 | RobertRosolek/programming_contests | codejam/2014/round_3/C/C.cpp | #include <iomanip>
#include <iostream>
#include <utility>
#include <algorithm>
#include <cassert>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <boost/range/irange.hpp>
using namespace std;
using namespace boost;
/* CHECKLIST
* 1) long longs
* 2) lower_bound etc - out of bound
* */
c... | ALGO | 0.999318 | 3.519187 |
0743a513-5fb6-4e7c-85b8-20084ea9d4dc | charneykaye/om-ios-experiments | monkeyjump/0-BaseProject/MonkeyJump/MonkeyJump/libs/Box2D/Collision/b2DynamicTree.cpp | #include <Box2D/Collision/b2DynamicTree.h>
#include <cstring>
#include <cfloat>
b2DynamicTree::b2DynamicTree()
{
m_root = b2_nullNode;
m_nodeCapacity = 16;
m_nodeCount = 0;
m_nodes = (b2DynamicTreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2DynamicTreeNode));
memset(m_nodes, 0, m_nodeCapacity * sizeof(b2DynamicTreeN... | ALGO | 0.994162 | 7.670779 |
49793844-662a-4f52-b454-8499427f8939 | avernethy/CarND-MPC-Project | src/Eigen-3.3/bench/bench_gemm.cpp |
// g++-4.4 bench_gemm.cpp -I .. -O2 -DNDEBUG -lrt -fopenmp && OMP_NUM_THREADS=2 ./a.out
// icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp && OMP_NUM_THREADS=2 ./a.out
// Compilation options:
//
// -DSCALAR=std::complex<double>
// -DSCALARA=double or -DSCALARB=double
// -DHAVE_BLAS
// -DDECOUPLED
//
#include... | TOOL | 0.938023 | 5.829477 |
0a213aa3-9a12-4820-b6c3-604780102b12 | ishandutta2007/codeforces | eureka/normal/314/C.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#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.999967 | 3.815083 |
ddd7d6cb-f60c-4ff7-8b1b-9a465e009290 | brunsky/WS171-system-core | libpixelflinger/tinyutils/VectorImpl.cpp | #define LOG_TAG "Vector"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <cutils/log.h>
#include "tinyutils/SharedBuffer.h"
#include "tinyutils/VectorImpl.h"
/*****************************************************************************/
namespace android {
enum {
NO_ERR... | TOOL | 0.974081 | 7.176424 |
f8c543fe-aab8-4c61-9d64-effa8f7157ce | jdjdnt/Tutoriais | 18. Graph/q2_noOfIslands.cpp | class Solution
{
public:
int dfs(vector<vector<char>> &grid, int i, int j)
{
if (i < 0 || i >= grid.size() || j < 0 || j >= grid[i].size() || grid[i][j] == '0')
return 0;
grid[i][j] = '0';
dfs(grid, i - 1, j);
dfs(grid, i, j - 1);
dfs(grid, i, j + 1);
... | ALGO | 0.999943 | 6.677221 |
b355a943-405b-4fae-886e-f8b2edf7c584 | r3zakalhor/Post-Duplication-Fate-Framework | Edited Aevol/src/libaevol/raevol/Protein_R.cpp | // =================================================================
// Libraries
// =================================================================
// =================================================================
// Project Files
// =======================... | TOOL | 0.991571 | 4.526314 |
5b4d71a5-fd10-4089-ad0b-008dae880b08 | nduong18/DSA_CODE.PTIT_nduong18 | DSA03005 - CHIA MẢNG THÀNH HAI MẢNG CON CÓ TỔNG LỚN NHẤT.cpp | #include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
//Github: nduong18
int main() {
int t; cin >> t;
while (t--)
{
ll n,k; cin >> n >> k;
ll a[n];
for (ll i = 0; i < n; i++) cin >> a[i];
sort(a,a+n);
ll sum1 = 0, sum2 = 0;
... | ALGO | 0.999916 | 4.349769 |
096f19d5-47f0-4872-b60c-2491cd95626e | rupali-12/Leetcode-Problems | 0023-merge-k-sorted-lists/0023-merge-k-sorted-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
class compare{
pu... | ALGO | 0.999976 | 5.781985 |
d21737f7-6d57-4b60-8f23-0d86452470ab | nginH/CP-codeforce | Others/CSES Problem Trailing Zeros/CSES Problem Trailing Zeros/main.cpp | //
// main.cpp
// CSES Problem Trailing Zeros
//
// Created by Harsh Anand on 09/10/2023.
//
#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#define H_A code by Harsh Anand
#define Inf 2147483647
#define Pi acos(-1.0)
#define pb(x) push_back(x)
#define sc(x) cin>>x;
#define pt(x) cout<<x<<... | ALGO | 0.999859 | 5.303259 |
5486e584-9f26-4694-ae9b-30d742437808 | jamcar23/FreeImage-Android | jni/freeimage/Source/FreeImage/WuQuantizer.cpp | ///////////////////////////////////////////////////////////////////////
// C Implementation of Wu's Color Quantizer (v. 2)
// (see Graphics Gems vol. II, pp. 126-133)
//
// Author: Xiaolin Wu
// Dept. of Computer Science
// Univ. of Western Ontario
// London, Ontario N6A 5B7
// <EMAIL>
//
// Algorithm: Greedy ... | ALGO | 0.998277 | 4.654984 |
fea151cf-b091-4607-aecc-48146242bb96 | NicholasFan235/Codewars | N Queens Iterative Repair/main.cpp | #include "solution.h"
int main()
{
int N, x, y;
std::cin >> N >> x >> y;
std::string board = nQueens::solveNQueens(N, std::make_pair(x, y));
std::cout << board << std::endl;
}
| ALGO | 0.999845 | 5.101873 |
5c8d4533-3d1b-4548-90d1-5524d7a09b20 | bafranco10/CPU-Scheduler- | PCB_Class.cpp | // FILE: PCB_Class.cpp
// A Bautista, B Franco, E Mora
// OS, Fall 2023, Transy U
//
// Implementation for PCB_Class that contains all functions needed to access PCBs and queues of PCBs
//
#include "PCB_Class.h"
#include <iostream>
#include <queue>
#include <strings.h>
using namespace std;
PCB_Class::PCB_Class(){
}
... | ALGO | 0.965273 | 5.099064 |
d4978fe1-8ae0-40ac-8f36-123808a4c347 | danmiltenberger/Mechatronics_alarmath | RGB-Matrix-P3-64x64-Demo/RGB-Matrix-P3-64x64-Demo/ESP32/AuroraDemo/libraries/FastLED/src/noise.cpp | #define FASTLED_INTERNAL
#include "FastLED.h"
#include <string.h>
FASTLED_NAMESPACE_BEGIN
#define P(x) FL_PGM_READ_BYTE_NEAR(p + x)
FL_PROGMEM static uint8_t const p[] = {
151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225,
140, 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 1... | ALGO | 0.992103 | 5.949927 |
ab7e9311-bdfa-4e87-9bda-3008861b617e | Kabir-Shah-29/HackerRank | Tutorials/10 Days of Statistics/Day 4/Binomial_Distribution_I.cpp | /*
Binomial Distribution I
link : https://www.hackerrank.com/challenges/s10-binomial-distribution-1/problem?isFullScreen=true
*/
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
int fact(int n){
if(n == 1 || n == 0)
ret... | ALGO | 0.999375 | 3.734157 |
2bb9f5f9-ca58-40f5-8df1-91f1e73a675a | ttdyce/Dynamic-embedding-labeller | selected-data/328.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#include "../StateIntercept.cpp"
#include <string.h>
using namespace std;
Intercept<int> Divide(Intercept<int> a, Intercept<int> b);
int main()
{
Intercept<int> intercepts[] = {Intercept<int>(0, 2), Intercept<int>(0, 4), Intercept<int>(0, 4)};
StateIntercep... | ALGO | 0.999834 | 3.369652 |
0b067360-28d9-4eb5-b537-460cd1e52619 | RobertWilkins/VilnoDataTransformation | vilno_source/engine/joinbyengine.cpp | string2 jbyNULLs ;
int2 jbyNULLi ;
float2 jbyNULLf ;
int MERGEBY_NOTUNIQUEROW=0 ;
void joinbyengine(const insholder1 & h, row & readrow, bool allinclusive,
long numstrbylist, long numintbylist, long numflobylist,
const vector< vector<long> > & readmapstr,
cons... | DATA | 0.94497 | 4.168226 |
7b850a94-b26d-4d38-a62a-5cedb4816155 | donlk/ImageStackToolbox | src/imagestack/PetteriAimonenFocusImageStacker.cpp | #include "../../inc/imagestack/PetteriAimonenFocusImageStacker.h"
#include "../../inc/util/Timer.h"
#include <options.hh>
#include <focusstack.hh>
#include <opencv2/core.hpp>
#include <string>
#include <vector>
#include <cmath>
#include <iostream>
using namespace std;
using namespace focusstack;
PetteriAimonenFocus... | TOOL | 0.939636 | 5.728561 |
764c68b5-e1f2-427f-9b23-d884b0e9dae0 | raincross7/code-similarity | codes/train_code/problem279/problem279_487.cpp | #include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
const ll INF = 1LL<<62;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> i... | ALGO | 0.99995 | 4.182393 |
359aab1b-c3b1-47a0-9d5b-9b95844e9eda | harsh6754/DSA-Problems | Codeforces/1B.cpp | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
string toAlphabetic(int col) {
string result = "";
while (col > 0) {
col--; // To convert from 1-indexed to 0-indexed for easier processing
result = char('A' + col % 26) + result;
col /= 26;
}
return ... | ALGO | 0.988551 | 5.38458 |
96027c1e-2a7a-4376-b415-cf33c997394e | Gemini284/POO | act3.4/MyGraph1.cpp | #include <iostream>
#include "MyGraph.h"
#include <vector>
#include <stack>
#include <queue>
using namespace std;
MyGraph::MyGraph(vector<vector<int>>& matriz){
loadGraph(matriz);
}
void MyGraph::loadGraph(vector<vector<int>>& matriz){
this->matriz = matriz;
}
void MyGraph::BFS(){
int N = matriz.size();
... | ALGO | 0.999799 | 4.74707 |
2319f6ed-fe2a-4cb1-926d-6a305d5d58de | NatanielMarques14/Data_Structure_UFC | Part1/Aula4/aula4ex1.cpp | /*
Implementation of a limited set via unordered vector
*/
#include <iostream>
using namespace std;
struct Conjunto
{
static const int tam = 10;
int n; //Number of elements.
char vetor[tam];
};
void inicializar (Conjunto &C)
{
C.n = 0;
}
bool cheia (Conjunto &C)
{
return (C.n == C.tam);
}
bool ... | ALGO | 0.997251 | 5.119951 |
0c88ae3a-1e05-462a-94eb-8b2e7df475a5 | fallenfallen/nanogui-sdl2 | ext/eigen/unsupported/doc/examples/FFT.cpp | // To use the simple FFT implementation
// g++ -o demofft -I.. -Wall -O3 FFT.cpp
// To use the FFTW implementation
// g++ -o demofft -I.. -DUSE_FFTW -Wall -O3 FFT.cpp -lfftw3 -lfftw3f -lfftw3l
#ifdef USE_FFTW
#include <fftw3.h>
#endif
#include <vector>
#include <complex>
#include <algorithm>
#include <iterator>... | ALGO | 0.993361 | 6.121914 |
d3fcb3d0-7427-423f-8721-bb012b822c5d | MouradMahgoub/LeetCode-Problems | 1538-maximum-points-you-can-obtain-from-cards/1538-maximum-points-you-can-obtain-from-cards.cpp | class Solution {
public:
int maxScore(vector<int>& v, int k) {
int ans=0, sum=0;
for(int i=0; i<k; i++) sum += v[i];
ans = sum;
for(int i=0; i<k; i++){
sum += v[v.size()-1-i];
sum -= v[k-1-i];
ans = max(ans, sum);
}
return ans;
... | ALGO | 0.99998 | 5.561279 |
5c845528-7ed1-4e0e-ab26-997373e5c99c | notmyst33d/ahsg | thirdparty/bullet/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp | #include "btConvexPlaneCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btConvexShape.h"
#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
#include "BulletC... | ALGO | 0.999356 | 7.499608 |
31d71cf7-6cc3-45f2-a17e-313ec7bd380a | oneapi-src/SYCLomatic | clang/tools/clang-diff/ClangDiff.cpp | #include "clang/Tooling/ASTDiff/ASTDiff.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
using namespace clang;
using namespace clang::tooling;
static cl::OptionCategory ClangDiffCategory("clang-diff options");
static cl:... | TOOL | 0.953279 | 7.535722 |
84da1cf1-e1c4-4d8e-b233-ef8d2af9a343 | anidev/frc-simulator | frc-cpp-sim/WPILib-2013/RobotDrive.cpp | /*----------------------------------------------------------------------------*/
/* Open Source Software - may be modified and shared by FRC teams. The code */
/*----------------------------------------------------------------------------*/
#include "RobotDrive.h"
#include "CANJaguar.h"
#include "GenericHID.h"
#i... | TOOL | 0.864665 | 7.255823 |
e57f0fc2-4d9c-4599-a6a6-6cc9b8053b8f | manikanta2901/ubuntu | .history/SRM/elab/DataStructures/Arrays/AR16_20200911145644.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int size,a;
cin >> size;
map<int,int> freq;
for(int i = 0; i < size; i++){
int a;
cin >> a;
freq[a]++;
}
bool flag = f... | ALGO | 0.999677 | 3.438216 |
39fbb4e6-6f66-40ad-9f0d-1600dbdbaf3d | abdirakhman/Olymp | Codeforces/471/B/main.cpp | /**
SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAj... | ALGO | 0.999996 | 3.713641 |
b79d612f-f33d-4bf2-819d-c722c54b661c | Tamorsz/Prog1 | week9/drill21_2nd_vector.cpp | #include "std_lib_facilities.h"
#include <numeric>
ostream& operator<<(ostream& pOutput, const vector<double>& pVec)
{
for (double d : pVec)
pOutput << d << ", ";
return pOutput;
}
struct LessThan
{
LessThan(double pD) : d(pD) {}
bool operator()(const double d1)
{
return d1 < d;
}
double d;
};
void Elj... | ALGO | 0.996351 | 5.193679 |
efa05e7a-612f-4a9e-8090-0a7fa8032237 | nxplatform/nx-mobile | thirdparty-cpp/boost_1_62_0/libs/compute/perf/perf_tbb_accumulate.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <tbb/blocked_range.h>
#include <tbb/parallel_reduce.h>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
template<class T>
struct Sum {
T value;
Sum() : value(0) {}
... | ALGO | 0.99686 | 5.924093 |
0d4a3d1d-6c8d-4c25-a51c-0bcb3f8dd72d | piyush9620/CP_solutions | codeforces/677_B.cpp | /*input
5 6 3
5 5 5 5 5
*/
#include<bits/stdc++.h>
#define endl "\n"
using namespace std;
int main() {
long long int n, h, k;
long long int zz=0;
cin>>n>>h>>k;
long long int a[n];
for(long long int i=0; i<n; i++) cin>>a[i];
long long int cur_hei=0;
//long long int m=n;
long long int i=0;
long long int c=0;
... | ALGO | 0.999882 | 3.302079 |
525819fe-f177-46c0-a1a0-4bccd87cb894 | XiaoyuanGuo/Leetcode | 1078/solution2.cpp | class Solution {
public:
vector<string> findOcurrences(string text, string first, string second) {
//parse the string first and then match the first and second words
vector<string> words;
vector<string> res;
string word = "";
for(auto c: text)
if(c == ' '){
... | ALGO | 0.999782 | 5.442042 |
877b3e67-23db-446d-b6ee-a9b396e542c3 | yjnnlee/Algorithm | math/9655 돌 게임.cpp | #include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int n;
cin >> n;
if (n % 2 == 1) cout << "SK"; //홀수면 SK
else if (n % 2 == 0) cout << "CY"; //짝수면 CY
//n=2일 때 SK가 3개 가져가면 이기는 건줄 알았는데 딱 맞게 가져가야 이기는 것 같다
}
| ALGO | 0.997434 | 3.264662 |
642fcea4-08e8-4c76-ae0a-d1fb459d8db5 | ronak9050/leetcodesub | 1497-design-a-stack-with-increment-operation/design-a-stack-with-increment-operation.cpp | class CustomStack {
vector<int> a;
int n,i=0;
public:
CustomStack(int maxSize) {
n=maxSize;
a.resize(n,-1);
}
void push(int x) {
if(i<n) {
a[i]=x;
i++;
}
}
int pop() {
if(i) {
i--;
return a[i];
... | ALGO | 0.999704 | 5.639349 |
dd1151e1-3620-43ef-8a4a-27b1698fd376 | jcheng1103/USACO-practice | 23/23/main.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, a[100000];
cin >> n;
for (int i = 0; i < n; i++){
cin >> a[i];
}
sort(a, a + n);
if (n % 2 == 0){
cout << a[n / 2] - a[n / 2 - 1] << endl;
cout << 'a' << endl;
}else{
cout << 0 <... | ALGO | 0.999903 | 3.803802 |
19a8663f-fb69-4005-a95c-487d436c1e75 | ExpoSEJS/Z3 | examples/tptp/tptp5.cpp | #include <string>
#include <cstring>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <signal.h>
#include <time.h>
#include <iostream>
#include <fstream>
#include <limits>
#include <string.h>
#include <cstdlib>
#include "z3++.h"
struct alloc_region {
std::list<char*> m_alloc;
void * al... | ALGO | 0.976044 | 3.65625 |
1c216830-b7e0-496f-8d4d-1c4bf0a92ede | mashenka2277/TRSPO-HWs | HW3/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <thread>
#include <atomic>
#include <functional>
#include <condition_variable>
#include <mutex>
#include <chrono>
class ThreadPool {
private:
std::vector<std::thread> work_threads; // Вектор з потоками
std::queue<std::function<void()>> tasks; // Ч... | ALGO | 0.999886 | 6.375787 |
bcaba9d5-c828-4f10-bfb6-c1d1ad44e61c | Merlin-chan43/Simple_CNN_model_by_cpp | relu.cpp | #ifndef _RELU_H_
#define _RELU_H_
#include"Matrix.h"
vector<vector<vector<float>>>& relu(vector<vector<vector<float>>>& pic)
{
int i,j,k;
for(k=0;k<pic.size();k++)
{
for(i=0;i<pic[0].size();i++)
{
for(j=0;j<pic[0][0].size();j++)
{
pic[k][i][j]=max(0.0f,pic[k][i][j]);
}
}
}
return pic;
}
#endif... | ALGO | 0.985786 | 3.474132 |
bf087e92-a6c4-43e4-a3d3-82497e7928d5 | Ri-Nai/CompetitionCode | OnlineJudge/HDU/HDU2665.cpp | #include<bits/stdc++.h>
using namespace std;
#define ls p<<1
#define rs p<<1|1
const int maxn=1e5+5;
struct node
{
int L,R;
vector<int>V;
}Tree[maxn<<2];
int A[maxn],n,m,mn,mx;
void Merge(int A,int B,int C)
{
Tree[A].V.clear();
int p=0,q=0,len1=Tree[B].V.size(),len2=Tree[C].V.size();
while(p<len1&&q<len2)... | ALGO | 0.999997 | 4.324552 |
8749bd18-5d21-45e7-b972-bf9b124f6b0c | nitgabriel/Linguagem-C | Beecrowd/beecrowd 1051.cpp | #include <stdio.h>
int main() {
double renda, taxa1 = 0.00, taxa2 = 0.00, taxa3 = 0.00, tt;
double asc1, asc2, asc3, renda1;
scanf("%lf", &renda);
if (renda <= 2000.00){
printf("Isento\n");
} else if (renda > 2000.00 && renda <= 3000.00) {
asc1 = renda - 2000.00;
taxa1 = asc... | ALGO | 0.998653 | 4.161312 |
75d66700-e9aa-43bb-b6bf-51a789cb66d0 | ishandutta2007/codeforces | andreysergunin/normal/526/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 3000000;
vector<int> prefix_function (string s) {
int n = (int) s.size();
vector<int> pi(n);
for (int i = 1; i < n; i++)
{
int j = pi[i - 1];
while (j > 0 && s[i] != s[j])
j = pi[j - 1];
if (s[i] == s[j]... | ALGO | 0.999894 | 3.354206 |
102b827e-b117-4f72-adf2-39bd016f5e6d | vivekko/labow | Codeforces/B_Pleasant_Pairs.cpp | #include <bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
voi... | ALGO | 0.998953 | 4.124271 |
04a0a109-d366-4c8e-ba86-4eea2ec86306 | AmrMagdyElmoogy/LeetCode_Problems | 107-binary-tree-level-order-traversal-ii/107-binary-tree-level-order-traversal-ii.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.999975 | 6.099574 |
b89eb86b-f2cd-490f-b910-2733a1f9a286 | Sofiullah-Iqbal-Kiron/CPP-Program-Files | Toph/Geometry/Dabbu the Entrepreneur.cpp | ///Accepted but taken help from Yeasin.
#include<iostream>
#include<cmath>
#define PI acos(-1)
using namespace std;
int main()
{
int T;
cin >> T;
while(T--)
{
double d=0.0, a=0;
cin >> d >> a;
cout << d*(1.0/sin((PI*a)/180) + 1.0/tan((PI*a)/180)) << endl;
}
}
| ALGO | 0.992535 | 3.591947 |
da0d044e-0e25-45a4-8fff-07cd4425055b | KHALMATOV-FARRUKH/nike_shoe_app_ui_2 | 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 |
fce810c7-5daa-4c52-aecd-deaaa76c612d | raincross7/code-similarity | codes/train_code/problem100/problem100_150.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main()
{
vector<vector<int>> a(3, vector<int>(3));
rep(i, 3) rep(j, 3) cin >> a[i][j];
int n;
cin >> n;
vector<int> b(n);
rep(i, n) cin >> b[i];
... | ALGO | 0.999983 | 3.751483 |
787174a7-554e-44c8-8f05-d230d87b50d0 | sarvex/leetcode-hack | solution/0200-0299/0295.Find Median from Data Stream/Solution.cpp | class MedianFinder {
public:
/** initialize your data structure here. */
MedianFinder() {
}
void addNum(int num) {
q1.push(num);
q2.push(q1.top());
q1.pop();
if (q2.size() - q1.size() > 1) {
q1.push(q2.top());
q2.pop();
}
}
double... | ALGO | 0.999992 | 6.45841 |
89c8615d-15fc-469f-a6d0-4b3114bc9123 | wsqyouth/algorithm_study | leetcode_algorithms/cpp/18_4Sum.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
// declare
void printVec(vector<int> vec);
class Solution
{
public:
// threeSum 时间复杂度n*n*nlog(n) = O(N3)
vector<vector<int>> fourSum(vector<int> &nums, int target)
{
//数组排序
sort(nums.begin(), num... | ALGO | 0.999948 | 5.530579 |
56b0c28a-eeca-4900-841d-4b08cc8125e6 | 2102ankit/Code | B_YetnotherrokenKeoard.cpp | #include <bits/stdc++.h>
// #include "debugging.h"
using namespace std;
#define dbg(v) \
cerr << "Line(" << __LINE__ << ") -> " << #v << " = " << (v) << endl;
#define fastio() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
typedef long l... | ALGO | 0.999101 | 4.903596 |
26f5440f-bf59-4070-8ec8-27c091c7e0e9 | ApRay0/my-codeforce-box | contests/div2/882/C.cpp | #include <bits/stdc++.h>
void sol() {
int n;
std::cin >> n;
std::vector<int> v(n + 1);
std::vector<int> sum(n + 1);
for (int i = 1; i <= n; i++) {
std::cin >> v[i];
sum[i] = v[i] ^ sum[i - 1];
// std::cout << sum[i];
}
int res = 0;
for (int i = 0; i < n; i++) {
... | ALGO | 0.999997 | 4.47997 |
50c3cf46-7fd5-4319-b5d5-c730170a6f73 | gyeongpunch/SSAFY-13th-Embedded-Algorithm-Study | JungMinWoo99/2025_03/week_4/BOJ-위대한_사기꾼.cpp | #include <iostream>
#define endl '\n';
#include <vector>
#include <limits>
#include <algorithm>
#include <cmath>
#include <deque>
using namespace std;
using ll = long long;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ll n, k;
cin >> n >> k;
vector<ll> di... | ALGO | 0.999962 | 3.855335 |
7dd0e1f4-db6b-4795-91f4-eada01589e00 | oliverpes/Tercer_Semestre | PROGRAMAS C++/funciones_ejemplo_recursividad.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
//declaramos las funciones
void pidedatos();
void sumadatos();
//declaramos las variables
int array[5];
int sumar, dato;
int main(){
pidedatos();
sumadatos();
}
void pidedatos(){
cout<<"ingrese 10 datos numerico"<<endl;
for (int i=0; i... | ALGO | 0.987339 | 3.478061 |
a6d3b7e2-faca-4edd-90bc-f6451070aab9 | ArielCoinOrg/arielcoin | src/cryptopp/luc.cpp | // luc.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "luc.h"
#include "asn.h"
#include "sha.h"
#include "integer.h"
#include "nbtheory.h"
#include "algparam.h"
NAMESPACE_BEGIN(CryptoPP)
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void LUC_TestInstantiatio... | ALGO | 0.98833 | 6.973131 |
320bb842-e97c-43e0-a787-f8219402301e | TrieuTX/Udacity_CPlusPlus_NanoDegree | Udacity_CPlusPlus_RoutePlanningProject/src/route_planner.cpp | #include "route_planner.h"
#include <algorithm>
RoutePlanner::RoutePlanner(RouteModel &model, float start_x, float start_y, float end_x, float end_y): m_Model(model) {
// Convert inputs to percentage:
start_x *= 0.01;
start_y *= 0.01;
end_x *= 0.01;
end_y *= 0.01;
// TODO 2: Use the m_Model.Fi... | ALGO | 0.93352 | 4.416927 |
a8fa831f-8417-49d6-894f-07a614097048 | rohan-goyal-1/CP | CodeForces/Problems/MixingWater.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <s... | ALGO | 0.998916 | 4.216099 |
f97f2389-8bc0-41aa-88a6-52128c4f04b9 | Obaid03/OOP_LAB | LAB_04/TASK_6.cpp | /*Scenario: A bank wants to develop a system for managing customer accounts. The system
should allow customers to:
1. Create a new account with an account number, owner’s name, and initial balance
(default balance is 0 if not provided).
2. Deposit money into their account.
3. Withdraw money from their account, ensuring... | TOOL | 0.902642 | 4.905507 |
10e23ede-b85c-4a2c-8b4d-4f8cfba9d650 | ninfane/Guia8-POO | Guia 8/ex_3.cpp | #include <iostream>
#include <list>
#include <numeric>
#include <fstream>
using namespace std;
void insertar(list<float> &l){
auto it = l.begin();
auto it2 = next(it);
float aux = accumulate(it,it2,0.0)/2.0;
it = l.insert(it2,aux);
for(int i=0;i<3;i++) {
auto it2 = next(it);
auto it3 = next(it,2);
float ... | TOOL | 0.873596 | 3.539494 |
efe02305-cc76-47fd-840f-1d6cee22b7ce | yzzupgo/MFTCG | Data/abc137_a/vjudge3/ac/27633009.cpp | #include <iostream>
using namespace std;
int main()
{
int A , B , c , d , e;
cin>>A>>B;
c=A+B;
d=A-B;
e=A*B;
if(c>=d && c>=e)
cout<<c;
else if(d>=c && d>=e)
cout<<d;
else
cout<<e;
return 0;
}
| ALGO | 0.999954 | 3.522181 |
4a45aadb-850f-4851-9e9c-264d492a1e69 | ishandutta2007/codeforces | martin53/normal/1099/F.cpp | #include<bits/stdc++.h>
using namespace std;
const int nmax=1e5+42,LIM=1<<21;
int n;
long long t;
vector< pair<int/*node*/,int/*cost*/> > adj[nmax];
int cookies[nmax];
int required[nmax];
pair<long long/*time*/,long long/*cookies*/> tree[LIM];
long long value[nmax],dp[nmax];
long long query(int node,int l,int r,long lo... | ALGO | 0.999957 | 3.535056 |
95efb351-b523-4559-82af-987f48de6a3c | KMSBisko/Past-cpp-projects | 7-10-2022/Array&Queries.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 5e5 + 17, lg = 19;
int n, k, q, fen[maxn], sp[lg][maxn], r[maxn], ans[maxn];
vector<int> vec[maxn];
void upd(int p, int x){
for(p++; p < maxn; p += p & -p)
fen[p] = min(x, fen[p]);
}
int get(int p){
int ans = maxn;
for(p++; p; p ... | ALGO | 0.999929 | 3.549252 |
ee9ef42c-3976-4e7b-8a3d-c019b85f0d27 | matsudo74/C_practice | 1019_02.cpp | #include <stdio.h>
int main(void)
{
int a, b;
printf("整数値を二つを入力せよ:");
scanf("%d %d", &a, &b);
if (a > b)
printf("大きい方は%dです。\n", a);
else if (a < b)
printf("大きい方は%dです。\n", b);
else
puts("二つの数は等しいです。\n");
return (0);
}
| ALGO | 0.993335 | 3.415046 |
8c71f945-f1d8-4977-b84d-d096ae9a496e | ishandutta2007/codeforces | rubikun/normal/1466/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define ... | ALGO | 0.999923 | 4.241233 |
37e7bcb9-a37e-4a7e-bb83-44955d2cd5a3 | Masters-Akt/CS_codes | leetcode_sol/693-Binary_number_With_Alternating_Bits.cpp | class Solution {
public:
bool hasAlternatingBits(int n) {
if(n<2) return true;
bool last_bit = n&1;
n=n>>1;
while(n){
bool curr_bit = n&1;
if(curr_bit==last_bit) return false;
last_bit = curr_bit;
n=n>>1;
}
return true;
... | ALGO | 0.999922 | 5.968601 |
3322af66-7b29-47fa-b99c-26cfe894f104 | persefonades/cs_grad_ultra | DSAlgo/IntroToAlgoCormen_3rdEdition/chapter2/ex_2_3_7.cpp | #include <iostream>
#include <algorithm>
using namespace std;
bool findSum(int *a, int n, int s) {
int i = 0, j = n - 1;
while (i < j) {
if ((a[i] + a[j]) == s)
return true;
if (a[i] + a[j] < s)
i++;
if (a[i] + a[j] > s)
j--;
}
return false;
}
int main(int argc, char const *argv[])
{
int a[10] = ... | ALGO | 0.998764 | 4.402952 |
a63c3151-c545-4248-aaae-1d194c9074c2 | ibeastking/DSA | Revision/tuple.cpp | #include <bits\stdc++.h>
using namespace std;
tuple<int, float, string> fun()
{
int a;
float b;
string c;
cout << "\nEnter the values: ";
cin >> a >> b >> c;
return make_tuple(a, b, c);
}
int main()
{
vector<tuple<int, float, string>> v;
for (int i = 0; i < 5; i++)
{
tup... | ALGO | 0.985905 | 3.551636 |
cb63c8b4-b173-49da-bb3a-a1b60723a0ed | siokaze/OffScreenRendering | cocos2d/cocos/base/CCEventDispatcher.cpp | #include "base/CCEventDispatcher.h"
#include "base/CCEvent.h"
#include "base/CCEventTouch.h"
#include "base/CCEventCustom.h"
#include "base/CCEventListenerTouch.h"
#include "base/CCEventListenerAcceleration.h"
#include "base/CCEventListenerMouse.h"
#include "base/CCEventListenerKeyboard.h"
#include "base/CCEventListene... | TOOL | 0.936025 | 4.206809 |
29a97cec-981c-4977-aac2-a763047b2316 | Pranta-Saha/codeforces-solved | 903C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<int,pii> piii;
#define FRO freopen("in.txt","r",stdin);
int main()
{
int n,i,j,t,tcs=0,k,m,u,v;
cin>>n;
vector<int>vec(n);
for(i=0;i<n;i++)
... | ALGO | 0.999924 | 3.495662 |
ba23e165-28a7-44f3-a3bd-77aee6af2ab7 | Ruban-07/Flutter | practice_3/basics_flutter/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.997424 | 6.785645 |
d548b3ff-6f2d-42d9-88e3-256a4b32c8bf | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9205_940.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << a + b;
return 0;
}
| ALGO | 0.997335 | 3.536291 |
7a905af5-cf18-4bab-86d6-8576a1d6cf8b | ishandutta2007/codeforces | piyushsethia1999/normal/515/B.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ul unsigned long long int
#define pb push_back
#define mp make_pair
#define ii pair<int,int>
#define vi vector<int>
#define iii pair<int,pair<int,int>>
#define INF 1<<30
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(N... | ALGO | 0.999988 | 3.108848 |
b9646851-ee19-4763-b908-2cf9bb2e4a28 | ishandutta2007/codeforces | amnesiac_dusk/normal/1166/F.cpp | /*
* The way if it's all predetermined
* And the way i should go all my life
* I swear to go wherever will be
* 'Cause there'll be something to see and to find
* I don't know the meaning of life
* But i know what's truly precious
* The way it's leading me to be in love
* No fear i can find m... | ALGO | 0.999985 | 4.793334 |
f63bbe30-d6dd-480f-991d-a8f88c83c9ba | yasheshoffgithub/Contests | codeforces/800rating/71A.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
while(n--){
string s;
cin>>s;
int cnt=s.length();
if(cnt>10){
s=s[0]+to_string(cnt-2)+s[cnt-1];
cout<<s<<endl;
} else cout<<s<<endl;
}
return 0;
} | ALGO | 0.999567 | 4.868462 |
bdf082f8-4c81-444c-90d4-3d8d5c328a28 | harshit-singhh/DSA-QUESTIONS | 1185-find-in-mountain-array/1185-find-in-mountain-array.cpp | class Solution {
public:
int findInMountainArray(int target, MountainArray &mountainArr) {
int length = mountainArr.length();
// Find the index of the peak element in the mountain array.
int peakIndex = findPeakIndex(1, length - 2, mountainArr);
// Binary search for the target in t... | ALGO | 0.999995 | 6.87917 |
4a86b8f8-ff1e-41fa-bb86-3c6bcad9e3d6 | kaloronahuang/KaloronaCodebase | Practices/UniversialOJ/UOJ450.cpp | // UOJ450.cpp
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 501000, mod = 19491001, g = 7;
int n, k, d, fac[MAX_N], fac_inv[MAX_N], inv[MAX_N], omega[3];
int fpow(int bas, int tim)
{
int ret = 1;
while (tim)
{
if (tim & 1)
ret = 1LL * ret * bas % mod;
bas = ... | ALGO | 0.999815 | 4.518675 |
9fe5fee1-d1c5-4bd9-8db0-9751d29e7c01 | Sam-555/DSA | HASHINGbasics/hashingNumbers.cpp | #include<iostream>
#include<vector>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> arr(n);
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int hashh[13]={0};
for(int i=0;i<n;i++)
{
hashh[arr[i]]+=1;
}
int queries;
cin>>queries;
while(queries--)
... | ALGO | 0.999799 | 4.416216 |
f93df191-5868-451a-9a62-4692473372e3 | ishandutta2007/codeforces | rajat1603/normal/506/D.cpp | #include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 5;
const int SQN = 330;
int n , m;
int a[N];
int b[N];
int c[N];
int cnt[N];
int q;
int qu[N];
int qv[N];
int ans[N];
int parent[N];
int sz;
int buf[N];
vector < int > v[N];
map < int , int > mp[N];
int find(int node){
if(parent[node] == node){
return... | ALGO | 0.999856 | 4.269923 |
c8b67720-9d1e-4dac-acc5-5bf7ae6d8e8b | malhardhaygude/CODING-deCODING | LeetCode/Medium/8. String to Integer (atoi).cpp | class Solution {
double UPPER_LIMIT=pow(2,31)-1, LOWER_LIMIT=pow(2,31);
public:
int myAtoi(string str) {
int index = 0;
double result = 0;
int multiplier = 1;
while(index<str.size() && str[index]==' ') index++;
if(str[index] == '+') index++;
else if(str[i... | ALGO | 0.999802 | 5.440486 |
3e5fbf55-5647-4f49-9057-3697427af73c | champawatsaksham0693/Crtphase2 | string_hackerrank.cpp | /*
Alternating String for example = xyxyxyxyxyxy or yxyxyxyxyx
We have given an String S = "abaaacdcbd"
We have to perform operation on it and convert into alternating string
and return maximum lenghth of alternating string
also find the minimum number of characters
Time Comlexity = O(N*26*26... | ALGO | 0.999918 | 4.487375 |
1038fc1a-4983-4611-a4fd-dd39ffb86517 | Ashfaqur4988/DSA-codes | recursion/isSortedArray.cpp | #include <iostream>
using namespace std;
bool isSorted(int arr[], int n)
{
// base case
if (n == 0 || n == 1)
{
return true;
}
if (arr[0] > arr[1])
{
return false;
}
else
{
bool ans = isSorted(arr + 1, n - 1);
return ans;
}
}
int main()
{
int... | ALGO | 0.99985 | 5.309985 |
2ebfc5f1-0eee-400b-9ffa-c459100dbe4b | shunya-fug/atcoder-cpp | contest/atcoder.jp/abc314/abc314_b/main.cpp | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++(i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++(i))
#define REP_R(i, n) for (int i = (int)(n)-1; (i) >= 0; --(i))
#define REP3R(i, m, n) for (int i = (int)(n)-1; (i) >= (int)(m); --(i))
#define ALL(x) ::std::begin(x), ::std::en... | ALGO | 0.999175 | 3.816905 |
1883760d-b792-4f2a-97cf-901358b858be | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/CodeLlama/top0-100/walls-and-gates-Solution.wallsAndGates/177912_Exec_Code_Overflow.cpp | tt_cmap12_validate( FT_Byte* table,
FT_Validator valid )
{
FT_Byte* p;
FT_ULong length;
FT_ULong num_groups;
if ( table + 16 > valid->limit )
FT_INVALID_TOO_SHORT;
p = table + 4;
length = TT_NEXT_ULONG( p );
p = table + 12;
p ... | ALGO | 0.962659 | 3.089055 |
be6891d4-1b49-4180-8d9e-50842795d422 | youquanl/M3Net | libs/pointops/src/aggregation/aggregation_cuda.cpp | #include <vector>
#include <torch/serialize/tensor.h>
#include <ATen/cuda/CUDAContext.h>
#include "aggregation_cuda_kernel.h"
void aggregation_forward_cuda(int n, int nsample, int c, int w_c, at::Tensor input_tensor, at::Tensor position_tensor, at::Tensor weight_tensor, at::Tensor idx_tensor, at::Tensor output_tensor)... | DATA | 0.949172 | 5.514808 |
d6b35356-7f41-4d11-a0a6-fb8a9fdad35c | Jovalga/Universidad | ALG/Practica4/material/friendship/src/prueba_APermutacion.cpp | #include <iostream>
#include "../include/Apermutacion.h"
#include "./Apermutacion.cpp"
#include <string>
template <class T>
ostream & operator<<(ostream &os, const vector<T> & d){
for (int i=0;i<d.size();i++)
os<<d[i]<<" ";
os<<endl;
return os;
}
void MuestraSecuencia(const Apermutacion & P){
Apermu... | ALGO | 0.997965 | 3.449884 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.