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
bd1967e0-a860-41b2-ad07-0e78043b993e
likanhp/icu
icu4c/source/i18n/sortkey.cpp
//=============================================================================== // // File sortkey.cpp // // // // Created by: Helena Shih // // Modification History: // // Date Name Description // // 6/20/97 helena Java class name change. // 6/23/97 helena Added comments t...
TOOL
0.973755
6.212571
4b4c0008-73a4-4612-8b1e-f4713e7685e0
AllenAndrew01123/Competitve-Programming
CSES/Introductory Problems/PalindromeReorder.cpp
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 typedef long long ll; int main() { cin.tie(0)->sync_with_stdio(0); string s; cin >> s; map<char, ll> mp; for (int i = 0; i < s.length(); i++) mp[s[i]]++; ll cnt = 0; for (auto x : mp) { if (x.second & 1)...
ALGO
0.999999
4.456649
88e08c9c-e7dc-4484-bbf8-1da530c4b01f
Hantaro171902/LeetCode
3279-AliceAndBobPlayingFlowerGame/3279-AliceAndBobPlayingFlowerGame.cpp
// Last updated: 8/29/2025, 11:09:34 PM class Solution { public: long long flowerGame(int n, int m) { long long odd_x = (n + 1) / 2; long long even_x = n / 2; long long odd_y = (m + 1) / 2; long long even_y = m / 2; return odd_x * even_y + even_x * odd_y; } };
ALGO
0.999983
5.842798
9a9faa85-412c-4905-8752-df6758da4a9f
JetBrains-Research/authorship-detection
datasets/cppSample/2.cpp
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #include <list> #include <cassert> #include <queue> using namespace std; #define cl...
ALGO
0.999338
4.029232
595821c1-3e5e-4b2b-a1f2-8f25371c39de
UnendingGlory/daily_leetcode
[1] 合集/精选200/156. 上下翻转二叉树.cpp
#include "header.h" // 给你一个二叉树的根节点 root,该二叉树的右节点均没有子结点。 // 请你将此二叉树上下翻转,并返回新的根节点。 // 你可以按下面的步骤翻转一棵二叉树: // 原来的左子节点变成新的根节点 // 原来的根节点变成新的右子节点 // 原来的右子节点变成新的左子节点 // 上面的步骤逐层进行。题目数据保证每个右节点都有一个同级节点(即共享同一父节点的左节点)且不存在子节点。 // 输入:root = [1, 2, 3, 4, 5] // 输出:[4, 5, 2, null, null, 3, 1] // Solution:递归。 // 对于一个结点 root来说,l = root....
ALGO
0.999737
6.277916
4f8210e0-65ca-4e91-9187-a5be075cfebd
raincross7/code-similarity
codes/train_code/problem346/problem346_461.cpp
#include <iostream> #include <string> #include <iomanip> #include <algorithm> #include <cassert> #include <queue> #include <set> #include <vector> #include <cmath> #include <bitset> #include <functional> #include <limits> #include <map> using namespace std; typedef long long ll; #define rep1(i, n) for(ll i = 1; i <=(l...
ALGO
0.999979
3.993936
92b7e1e7-5985-47ab-93d6-87d9fef88006
shyu61/program-competition
code/seisen100/077.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) const int M = 1e5; // 🔷抑えるべき抽象論は? // 累積和は半開区間 // "間の距離"は"スタートからの位置"と読み替える int main() { int n, m; cin >> n >> m; vector<int> a(n); rep(i, n - 1) { int d; cin >> d; a[i + 1] = (a[i] + d) % M; }...
ALGO
0.999994
4.392648
3f197264-4c0a-4ff0-b710-87285b4a8ef6
dvbonn/DSA_UIT
Selection_sort/main.cpp
#include <iostream> #include <vector> using namespace std; void swap(int& a, int& b) { int temp = a; a = b; b = temp; } void selectionSort(vector<int>& arr, int n) { for (int i = 0; i < n - 1; i++) { int t = i; for (int j = i + 1; j < n; j++) { if (arr[j] < arr[t]) { ...
ALGO
0.999884
5.694607
2c4bbf55-3acd-4fa9-a8e6-25ca12ac4be6
stkuroneko/asuswrt-modx
release/src/router/APP-IPK/DM-ipk/crypto++/adler32.cpp
// adler32.cpp - written and placed in the public domain by Wei Dai #include "pch.h" #include "adler32.h" NAMESPACE_BEGIN(CryptoPP) void Adler32::Update(const byte *input, size_t length) { const unsigned long BASE = 65521; unsigned long s1 = m_s1; unsigned long s2 = m_s2; if (length % 8 != 0) { do { s1...
ALGO
0.874717
6.606503
d36d07bc-8c2b-4766-b533-79caed2d4bd8
ehteshampantho/Programming_Journey
Data Structure/Module 7/Practice/practice_3.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int val; Node * next; Node(int val){ this->val = val; this->next= NULL; } }; void insert(Node * &head, Node * &tail, int val){ Node * newNode = new Node(val); if(head == NULL){ ...
ALGO
0.999818
3.995463
455ca657-7661-4bc2-9356-8b430cbcbe0d
yonghuatang/codeforces
cf0236A.cpp
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; map<char, int> m; for (const char& c : s) { m[c]++; } cout << ((m.size()) % 2 == 0 ? "CHAT WITH HER!" : "IGNORE HIM!") << endl; return 0; }
ALGO
0.999574
4.435122
00e8ac75-033d-4339-aa18-64535fb694dc
basecode-lang/basecode
share/prototypes/bootstrap-redux/ext/boost-1.70.0/libs/math/example/series.cpp
#include <boost/math/tools/series.hpp> #include <iostream> #include <complex> #include <cassert> //[series_log1p template <class T> struct log1p_series { // we must define a result_type typedef: typedef T result_type; log1p_series(T x) : k(0), m_mult(-x), m_prod(-1) {} T operator()() { // ...
ALGO
0.992693
4.206108
b07b66af-c60d-4800-ba07-7c7ae81294a4
daokoder/Craft3D
Source/ThirdParty/Bullet/src/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.999425
7.401257
0fbd5832-1cee-4ac1-b37f-0ba762bff08a
snka1226/Javascript_mini_project
bodlogo1.cpp/bodlogo6.cpp
#include<iostream> using namespace std; int main(){ int a,b,p,s; cout<< "a toog oruulna uu." <<endl; cin>> a; cout<< "b toog oruulna uu." <<endl; cin>> b; p=(a+b)*2; s=a*b; cout<< "p=" <<p<<endl<< "s=" <<s; return 0; }
TOOL
0.917288
3.205023
657e960b-0ca0-4d43-ab2b-042a21a2ecba
shagilhmx/LeetCode
435-non-overlapping-intervals/435-non-overlapping-intervals.cpp
class Solution { public: int eraseOverlapIntervals(vector<vector<int>>& intervals) { sort(intervals.begin(), intervals.end(), comparator); int count = 0; for(int itr=0;itr<intervals.size()-1;itr++) { if(intervals[itr][1] <= intervals[itr+1][0]) continue...
ALGO
0.999932
6.073296
0866ec99-d2af-4640-a833-f69057b82b91
ahmadsoliman/ACM
CodeBlocks/ACM/CodeJam/Round2 2014/Round2D.cpp
#include <stdio.h> #include <string.h> #include <string> #include <vector> #include <queue> #include <set> #include <bitset> #include <map> #include <algorithm> using namespace std; char in[100]; char startchar; typedef struct trie{ bool root; int words; int prefixes; struct trie *edges[26]; }trie; ...
ALGO
0.999875
3.84269
3b749457-78e8-4d0d-9c2f-a2a11ce11142
kakefu1146/2024software06
3rdparty/openexr/IlmImf/dwaLookups.cpp
#define OPENEXR_BUILTIN_TABLES // // A program to generate various acceleration lookup tables // for Imf::DwaCompressor // #include <cstddef> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <vector> #include <OpenEXRConfig.h> #ifndef OPENEXR_BUILTIN_TABLES #ifdef OPENEXR_IMF_HAVE_SYSCONF_NPROCESS...
ALGO
0.966214
5.427552
e3e0fd00-ddec-4436-9d3d-6d16edca9839
dnbaker/frp
src/test_gs.cpp
#include "frp/linalg.h" #include "frp/dist.h" #include <iostream> using namespace frp; // enter Froopyland! using namespace frp::linalg; int main(int argc, char *argv[]) { unsigned size(argc > 1 ? std::atoi(argv[1]): 10), nrows(size), ncols(size), flags(ORTHONORMALIZE); blaze::DynamicMatrix<FLOAT_TYPE> input(n...
TEST
0.990389
4.94733
4cd8e3db-9e38-4362-8786-883dca27c060
DanielBLimo/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.9988
6.76073
c04a0619-29a8-40e4-92b3-6d1d456fe181
Rockstatata/CP-solves
CodeforcesLadder/1932C.cpp
#include <bits/stdc++.h> using namespace std; #define fast {ios_base::sync_with_stdio(false); cin.tie(0);} typedef long long ll; #define int long long #define float long double void solve() { int n,m; cin >> n >> m; deque<int> d; int x=1; int a[n]; for(int k,i=0;i<n;i++){ cin >> k; ...
ALGO
0.999954
3.776329
0971e31e-c578-44b4-a0a4-24c836e233fb
maxromanovskii/ci_hse_devops
ci_hse_devops/godot-engine-ci-main/thirdparty/oidn/mkl-dnn/src/cpu/gemm/s8x8s32/jit_avx512_core_kernel_gemv_s8u8s32_kern.cpp
#include "jit_avx512_core_kernel_gemv_s8u8s32_kern.hpp" #ifdef _WIN32 #define is_windows 1 #else #define is_windows 0 #endif namespace mkldnn { namespace impl { namespace cpu { void jit_avx512_core_gemv_s8u8s32_kern::vnni(Xbyak::Zmm acc, Xbyak::Zmm b, Xbyak::Zmm a, Xbyak:...
ALGO
0.999247
5.200825
bf2959a4-8e68-480c-852a-f5de8f6c79d8
priyanshu28012002/my_alloc
examples/src/vector.cpp
/* * Problem: Two Sum (LeetCode #1) * Description: Given an array of integers nums and an integer target, * return indices of the two numbers such that they add up to target. * Solution: Using Vector to store and search for complement values. */ #include "ds.hpp" #include <iostream> Vector<int>...
ALGO
0.999573
6.733586
d1a11ea2-a7ee-42c5-a811-3bbe97619f04
joshualass/CP
Solutions/Contests/CodeForces/CF1992/F1992.cpp
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. ******************************************...
ALGO
0.999958
4.872294
2839e264-c880-496b-a08b-77c0c63c9431
Devanhu/DS-Laboratory
8 bubble_sort.cpp
#include <iostream> using namespace std; void bubble_sort(int arr[], int n){ for(int i = 0; i < n ; i++){ for(int j = 0; j < n - i - 1; j++){ if( arr[j] > arr[j + 1] ){ int temp = arr[j]; arr[j] = arr[j + 1]; arr[j + 1] = temp; } } } } int main() { int n, arr[50]; cout << "enter the no. ...
ALGO
0.99932
4.257643
a44efd8e-0967-454f-a52c-d486189653d7
MohitJain617/CPFolder
Codebook/Data-Structures/treapLazy.cpp
struct Node { char val; int weight, size; Node *left, *right; int toinvert; Node(char c) : val(c), weight(rand()), size(1), left(NULL), right(NULL), toinvert(0) {} } *root; inline int size(Node *treap) { return treap ? treap->size : 0; } void push(Node *treap) { if(treap == NULL) return; ...
ALGO
0.999987
4.367423
c19122af-22d0-4d92-8e58-0e4344ce78e5
xinchengxx/algorithm_contest
动态规划/1049. 最后一块石头的重量 II.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: int lastStoneWeightII(vector<int>& stones) { int n = stones.size(); int sum = 0; for (int stone : stones) sum += stone; vector<bool> f(sum / 2 + 1, false); f[0] = true; ...
ALGO
0.999688
5.212403
7dabdfb0-b680-40f5-bf2c-5a4c31a59e93
shivamaggarwal513/delhi-technological-university
Semester 3/Data Structures Lab/09 Lab 11 Oct/15StacksQ.cpp
#include <iostream> #include <queue> using namespace std; class stack { private: queue<int> q, qTemp; public: void push(int data) { qTemp.push(data); while (!q.empty()) { qTemp.push(q.front()); q.pop(); } queue<int> qSwap = q; q = qTe...
ALGO
0.977587
4.331408
ef071eee-b766-4d30-9890-9fafff28b6a6
voidtelmina/GAME
GameTemplate/Game/bulletPhysics/src/Bullet3Collision/BroadPhaseCollision/b3OverlappingPairCache.cpp
#include "b3OverlappingPairCache.h" //#include "b3Dispatcher.h" //#include "b3CollisionAlgorithm.h" #include "Bullet3Geometry/b3AabbUtil.h" #include <stdio.h> int b3g_overlappingPairs = 0; int b3g_removePairs =0; int b3g_addedPairs =0; int b3g_findPairs =0; b3HashedOverlappingPairCache::b3HashedOverlappingPairCache...
TOOL
0.953508
4.848375
fc928d0c-f626-470c-9e9c-b54a566fc3c4
Urooj-Baloch/DSA
SinglyLinkedList.cpp
#include<iostream> using namespace std; class Node{ public: int data; Node* next; Node(int data){ this->data=data; this->next=NULL; } }; void InsertAtHead(Node* &head,int d){ Node *temp= new Node(d); temp->next=head; head=temp; } void InsertAtTail(Node* &ta...
ALGO
0.99988
4.573263
8fbadaaf-58fc-4f28-b8f8-e89630e66e9a
Undoe97/Data_Structure
DataStructure/Josephus.cpp
#include "CircularLinkedList.h" #include <iostream> using namespace std; int main() { int N, K; cin >> N >> K; ListNode* Head = NULL; for (int i = 1; i <= N; i++) { Head = Insert_Last(Head, i); } cout << "<"; Display(Head, N, K); cout << ">"; return 0; }
ALGO
0.999627
3.245831
94e9fb34-9d75-4e52-a9b0-3e310fb6bcb1
9ine6ix/C-ESPRESSO-WORK_SHEET
Week_3/WORK_3_1/problem11/problem11/problem11.cpp
#include "stdafx.h" #include <iostream> #include <string> using namespace std; int main() { string str; getline(cin, str); int vowel = 0; // int consonant = 0; // for (int i = 0; i < str.length(); i++) { if (str[i] == 'a' || str[i] == 'i' || str[i] == 'e' || str[i] == 'o' || str[i] == 'u') vowel++; ...
ALGO
0.999531
5.00332
7aa68d32-2a73-4f6a-9bb2-89cdaec0b2ad
Taejin1221/Problem-Solving
Baekjoon/Baekjoon23832.cpp
// Baekjoon23832.cpp // https://www.acmicpc.net/problem/23832 #include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; vector<int> prime; ll getCoprime(int num) { pair<ll, ll> ans = { 1LL, 1LL }; for (int i = 0; i < prime.size() && prime[i] <= num; i++) { if (num % ...
ALGO
0.999951
5.159579
f29a968b-6ef0-4d1e-8904-36a8347b4f14
JRgit03/Algorithm
atcoder/abc/348/E.cpp
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e5 + 10; int n; int c[N]; int sum,s[N],f[N]; int dist[N]; vector<int> g[N]; void dfs(int u,int fa){ s[u] = c[u]; for(auto &v : g[u]){ if(v == fa) continue; dist[v] = dist[u] + 1; dfs(v,u); s[u] +=...
ALGO
0.999911
3.844402
7c974203-2c6f-448b-8cf1-aa53d1d79bf4
edin-dal/vecht
benchmark/e2e_other.cpp
#include <ctime> #include <vector> #include <iomanip> #include <numeric> #include <iostream> #include <algorithm> #include "tbb/tbb.h" #include "../include/parallel_hashmap/phmap.h" #include "../include/libcuckoo/libcuckoo/cuckoohash_map.hh" #include "../include/high_precision_timer.h" #include "../src/vecht.hpp" us...
ALGO
0.979921
4.440474
49b7b5a5-bc2c-4138-b0c1-b1a5417741ca
uchiyou/algorithms
13130110075_周游practice2/pigInsideWind.cpp
/*֮£ܷɡйţУνꡱ һعʷĻᣬ֪һ֧Ʊnļ۸ƣԳΪnʾ еiԪأprices[i]ùƱiĹɼۡ һʼûйƱ 1ɶ1ɵĻᣬǰһҪȱ֤ûйƱ ν׻ᶼΪ0 㷨ܻõ档 ֵΧ2<=n<=100,0<=prices[i]<=100 : 3,8,5,1,7,8 : 12*/ class Solution { public: /** * ܻõ * * @param prices Prices[i]iĹɼ * @return */ int calculateMax(vector<int> prices) { int result=0; ...
ALGO
0.999975
4.664495
12288e80-cf93-40c1-a901-22455b547ddf
DennyKuo0809/leetcode
Array_String/medium/442_hint.cpp
class Solution { public: vector<int> findDuplicates(vector<int>& nums) { int len = nums.size(); vector<int> ret; for(int i = 0 ; i < len ; i ++){ nums[(nums[i] - 1) % len] += len; if((nums[(nums[i] - 1) % len] - 1) / len > 1){ ret.push_back((nums[i] -...
ALGO
0.999948
5.500068
0dd42023-71b0-44dc-8789-0199416dd279
Eric3911/OpenAGI
DeepSpeech-2-master/PaddleSpeech-develop/third_party/ctc_decoders/ctc_greedy_decoder.cpp
#include "ctc_greedy_decoder.h" #include "decoder_utils.h" std::string ctc_greedy_decoding( const std::vector<std::vector<double>> &probs_seq, const std::vector<std::string> &vocabulary, size_t blank_id) { // dimension check size_t num_time_steps = probs_seq.size(); for (size_t i = 0; i < num_t...
ALGO
0.999542
6.64493
0b6ea30a-87dc-4030-b90e-66b879b45332
linqiu15/wuziqi
src/handle.cpp
#include "handle.h" handle::handle():vec{{1,0},{1,1},{0,1},{-1,1}}{} handle::~handle(){} int handle::distance_xboarder(int x){return (x<8)?x:(14-x);} int handle::distance_yboarder(int y){return (y<8)?y:(14-y);} int handle::single_find_same(chessboard *cb,piece *pi,int xvec,int yvec){ int num=0,x0=pi->getx()+xvec,y...
ALGO
0.991647
4.138946
1300095b-ef61-48f6-be96-3894d3c3dfe9
ModularBitcoin/tryrepo3
reference-04-curve-operations/depends/ate-pairing/src/zm.cpp
#include "zm.h" #include <cstdio> using namespace mie; #ifdef MIE_USE_X64ASM #define XBYAK_NO_OP_NAMES #include "xbyak/xbyak.h" using namespace Xbyak; #endif /** out[] = x[] + y[] @note the sizeof out >= n @return size of x[] + y[] */ static inline bool in_addN(Unit *out, const Unit *x, const Unit *y, size_t n) {...
ALGO
0.995737
5.789005
18bb1008-9d05-4860-8ce5-dc93b7e849c0
davrec72/clang-meta
llvm/tools/clang/lib/AST/InheritViz.cpp
#include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/TypeOrdering.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/GraphWriter.h" #include "llvm/Support/raw_ostream.h" #include <map> #include <set> using namespace clang; namespace { /// Inherita...
TOOL
0.893565
7.686381
d28c8706-00c9-4d0f-9e2a-f32337cabace
Saikat36/Assignment-on-CodeBlock
Assignment -23 ( C++ )/try4.cpp
/* 4. Write a C++ program to calculate the area of a circle */ #include <iostream> using namespace std; class area_of_the_circle { public: // Access Moifier int p; area_of_the_circle(int a) // Constructor { p = a; } float find_area(); ...
ALGO
0.985817
4.544005
8fbac560-0c8f-498d-a9ec-434062a22746
Sai-Suraj-27/cpp
heaps/implementation.cpp
#include<bits/stdc++.h> #define sz(x) (int)x.size() #define all(x) (x).begin(), (x).end() #define F(i,a,n) for(ll i=a;i<n;i++) #define B(i,a,n) for(ll i=n-1;i>=a;i--) #define ll long long int #define ld long double #define pb push_back #define mp make_pair #define vll vector<ll> ll mod = 1e9 + 7; using namespace std; ...
ALGO
0.999635
4.389701
5c12b9d6-84d2-4a50-81f1-705fb0d47cdd
DarkSideMandrillo/C_CPP
16_ConditionalOperator/main.cpp
#include <iostream> using namespace std; int main() { int num{}; cout << "Enter an integer: "; cin >> num; if (num % 2 == 0) cout << num << " is even" << endl; else cout << num << " is odd" << endl; cout << num << " is " << ((num % 2 == 0) ? "even" : "odd") << endl ...
ALGO
0.966585
3.317227
5be7e97d-90ac-43a8-a13d-9ce69d797827
Gugfann/3.Semester
CPP/Circular Buffer/boost_1_59_0/libs/numeric/odeint/examples/quadmath/black_hole.cpp
#include <cstdlib> #include <cmath> #include <iostream> #include <iterator> #include <utility> #include <algorithm> #include <cassert> #include <vector> #include <complex> extern "C" { #include <quadmath.h> } const __float128 zero =strtoflt128 ("0.0", NULL); namespace std { inline __float128 abs( __float128 x )...
ALGO
0.999929
4.643134
46103ecb-890a-4600-ae32-3a5f7dce4782
AndrewMonteith/AISearch
AISearch/ReverseSubsection.cpp
#include "Annealing.h" #include <algorithm> ReverseSubsection::ReverseSubsection(Graph* g) { std::random_device seed; rnd = std::mt19937(seed()); indiciesDis = std::uniform_int_distribution<>(0, g->getNumberOfCities() - 1); } void reverseSubsectionWraparound(std::vector<int>& vec, int upper, int lower) { auto u...
ALGO
0.99876
4.055406
7fcfb356-f427-46a0-b1a9-5671980adf65
ishandutta2007/codeforces
tanphatls987/normal/144/A.cpp
#include <bits/stdc++.h> using namespace std; #define X first #define Y second #define INPUT freopen("A.inp","r",stdin) #define OUTPUT freopen("A.out","w",stdout) #define FOR(i,l,r) for(auto i=l;i<=r;i++) #define REP(i,l,r) for(auto i=l;i<r;i++) #define FORD(i,l,r) for(auto i=l;i>=r;i--) #define REPD(i,l,r) for(auto ...
ALGO
0.999936
3.819484
f4cd1aaf-e0bb-4d1d-bb6f-31c0ee67ca01
TwistyLime/CodeChef-Contest-Solutions
02_STARTERS/Starters_27D/The_product_mystery.cpp
#include <iostream> using namespace std; int gcd(int a, int b); int main() { int t; cin >> t; while (t--) { int x, y; cin >> x >> y; cout << y / gcd(x, y) << "\n"; } return 0; } int gcd(int a, int b) { { if (b == 0) { return a; } return gcd(b, a % b); } }
ALGO
0.999857
5.355311
c553d7da-e7b4-447e-8854-0a758075850a
NMRanaHamid/Problem_Solving
XPSC/week-07/day-02/K_Parliament.cpp
#include <iostream> using namespace std; int main() { int t; cin>>t; while(t--) { int n,m; cin>>n>>m; if(n & 1) n++; if(m>=n/2) cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }
ALGO
0.999543
3.655662
8f08f915-fd15-4b21-825a-ae45ee1edb5f
ishandutta2007/codeforces
emiso/normal/799/A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define MN 1001000 ll n, t, k, d; //char s[MN]; string str; int main() { scanf("%lld %lld %lld %lld", &n, &t, &k, &d); ll t1 = (n + k - 1) / k * t; puts((d + t < t1) ? "YES" : "NO"); return 0; }
ALGO
0.999864
3.48313
69edd634-651f-43ac-9a2b-38a379b9d48e
Dushi18/data-structures-and-algorithms
recursion/sortedArray.cpp
#include <iostream> using namespace std; bool isSorted(int arr[], int size){ if(size==1||size==0) return 1; if(arr[0]<arr[1]){ return isSorted(arr+1, size-1); } else{ return 0; } } int main(){ int arr[]={12, 34, 56, 67, 78, 12}; int size = 6; if (isSorted(arr, size)) ...
ALGO
0.999649
4.348932
8ec1f8a3-bdcb-4066-9794-04632465865f
mostafaamahmoudd/Problem-Solving-Submissions
other/A - Playing with Dice.cpp
//https://codeforces.com/contest/378/problem/A #include <iostream> #include <bits/stdc++.h> #include <string> #include <vector> #include <map> #define ll long long #define pi acos(-1) using namespace std; void fast () { cin.sync_with_stdio(0); cin.tie(0); cout.tie(0); } //const int maxInteger = 1e7; //in...
ALGO
0.999797
4.428864
5b6e1701-ef4a-4ddb-8ee5-4f0c1095e847
Leon-OS/ComputeGraphicsProgramingForApple
Chapter_16_rayTracing/Prog16_1_computeShader/main.cpp
#include <stdio.h> #include <GL/glew.h> #include <GLFW/glfw3.h> #include "Utils.h" GLuint buffer[3]; GLuint simpleComputeShader; int v1[] = { 10, 12, 16, 18, 50, 17}; int v2[] = { 30, 14, 80, 20, 51, 12 }; int res[6]; void init() { simpleComputeShader = Utils::createShaderProgram("simpleComputeShader.glsl"); glGe...
TOOL
0.93158
5.144484
dcdd0cb3-1306-4962-a84a-fea347900dcd
hjaiswal04/dsa.practical
Expt18_linkedListInsertionDeletionAtPosition.cpp
#include <iostream> using namespace std; struct Node { int data; Node* next; }; class LinkedList { public: LinkedList() { head = nullptr; } void insertAtPosition(int value, int position) { if (position < 0) { cout << "Invalid position. Cannot insert." << endl; ...
ALGO
0.998933
5.799274
03078034-31b6-4422-b194-c730c642693c
Hayeon-Lee/PS
프로그래머스/0/181942. 문자열 섞기/문자열 섞기.cpp
#include <string> #include <vector> using namespace std; string solution(string str1, string str2) { string answer = ""; int flag = 1; int index = 0; while (index < str1.length()) { if (flag == 1) answer += str1[index]; else answer += str2[index]; flag *= -1; ...
ALGO
0.999975
4.958519
9f4e41f7-0b5b-42cf-a6ab-81ea7fb4d9e2
Lydxn/Competitive-Programming
Codeforces/451/B.cpp
#include <bits/stdc++.h> using namespace std; int a[100000], sorted[100000]; int main() { cin.sync_with_stdio(0); cin.tie(0); int n, p1 = 0, p2 = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; sorted[i] = a[i]; } sort(sorted, sorted + n); for (i...
ALGO
0.999931
3.959424
f6dd97e2-68f1-4f94-97d3-8a39a8223924
desyang-hub/algorithm
leetcode/backtrack/77_combinations.cpp
#include "bits/stdc++.h" using namespace std; /** * @brief 给定两个整数 n 和 k,返回范围 [1, n] 中所有可能的 k 个数的组合。 你可以按 任何顺序 返回答案。 * */ class Solution { vector<vector<int>> paths; vector<int> path; public: vector<vector<int>> combine(int n, int k) { backtrack(1, n, k); return paths; } void...
ALGO
0.999971
5.500546
146e57bb-08b1-4504-b8cb-b7ba9fd28918
smartbh/DSalgorithm
ch07/sort_practice2.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; //함수 포인터 방법 bool abbs_cmp(const int a, const int b) { return abs(a) < abs(b); } class Person { public: string name; int age; bool operator < (const Person& a) const { return this->age < a.age; } void...
ALGO
0.999652
4.94733
e2c84b1a-7569-44a9-a9ee-a72e7be91fbd
lars-dammann/maxentrdf
src/QEQ/fix_qeq_fire.cpp
// clang-format off /* ---------------------------------------------------------------------- Contributing author: Ray Shan (Sandia) ------------------------------------------------------------------------- */ #include "fix_qeq_fire.h" #include "atom.h" #include "comm.h" #include "error.h" #include "force.h" #inc...
ALGO
0.997459
6.83199
92824b53-620f-4c27-9988-d66fc1f73460
aryapunni/c-plusplus
DSA/graphs/components.cpp
#include<iostream> #include <iterator> #include <string> #include <utility> #include <vector> #include <map> using namespace std; void print_vector(vector<int> input) { cout << "{"; if(input.empty()) { cout << "}" << endl; return; } for(int i = 0; i < input.size(); i++) { c...
ALGO
0.999675
5.669391
2df4e344-37f3-48f7-9fd5-1c050c19bdc4
AymenChla/competitive-programming-training
B. Students in Railway Carriage/main.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n,a,b; cin >> n >> a >> b; int na=a,nb=b; char p; int last = -1; for (int i = 0; i < n; ++i) { cin >> p; if(p=='*') { last = -1; } else{ if((last==0 || (b>=a && last =...
ALGO
0.99981
3.383452
2f3d8a3d-ef5a-41ee-8478-0888b955fa16
ishandutta2007/codeforces
skydogli/normal/1556/F.cpp
#include<bits/stdc++.h> using namespace std; #define int long long int read(){ int a=0,fh=1;char c=getchar(); while(c>'9'||c<'0'){if(c=='-')fh=-1;c=getchar();} while('0'<=c&&c<='9'){ a=a*10+c-48; c=getchar(); } return a*fh; } #define MN 200005 #define pii pair<int,int> #define mp make_pair #define x first #def...
ALGO
0.999886
3.829138
8e94482b-d02f-46e6-819d-b4b70043cf8f
alexandraback/datacollection
solutions_1483488_1/C++/MiameRishio/c.cpp
#include <iostream> using namespace std; int nTestCase; int n, m, ans; int num_hash[3000000]; void init() { scanf("%d %d", &n, &m); } int getBit(int x) { int ans = 0; while (x > 0) { ans++; x /= 10; } return ans; } void process() { ans = 0; int tmp; int a[8] = {1, 10, 100, 1000, 10000, 100000, 1000000};...
ALGO
0.999342
4.197656
9e56692e-e846-464e-aae0-283dad007fad
aswindevsp/cp
codeForces/1668B.cpp
#include <bits/stdc++.h> using namespace std; void solve(); int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("temp/input.txt", "r", stdin); freopen("temp/time.txt", "w", stderr); freopen("temp/output.txt", "w", stdout); #endif int t; cin >> t; ...
ALGO
0.999992
3.958204
7233121b-d7be-42a0-a903-1e02113a3b2a
action-script/ofxWFC3D
src/ofxWFC3D.cpp
#include "ofxWFC3D.h" size_t weightedRandom(const std::vector<double>& a, double between_zero_and_one); // ------------------ void ofxWFC3D::SetUp(std::string config_file, std::string subset_name, size_t max_x, size_t max_y, size_t max_z, bool periodic, std::string ground_name, std::string surround_name) { //ini...
ALGO
0.9769
4.77489
dc532dcf-216d-42d8-afd9-1ed96a45920f
becastal/maratona
beecrowd/adhoc/meuAvoEFamoso.cpp
#include <bits/stdc++.h> #define f first #define s second #define _ ios_base::sync_with_stdio(0);cin.tie(0); #define endl '\n' #define dbg(x) cout << #x << " = " << x << endl typedef long long ll; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fll; using namespace std; int main() { _; int n, m; wh...
ALGO
0.999911
3.459282
db0409fa-9600-4edf-95e2-36605e3bb4f2
UVARocketry/SpaceportAmericaCup23-24
Airbrakes/src/eigen/doc/examples/class_CwiseUnaryOp_ptrfun.cpp
#include <Eigen/Core> #include <iostream> // define function to be applied coefficient-wise double ramp(double x) { if (x > 0) return x; else return 0; } int main(int, char**) { Eigen::Matrix4d m1 = Eigen::Matrix4d::Random(); std::cout << m1 << std::endl << "becomes: " << std::endl << m1.unaryExpr(std...
ALGO
0.982726
4.481187
608c4f48-8e87-46d5-a22d-0bd638a42ebe
YashRajSingh-4799/DSA_leetcode
665-non-decreasing-array/665-non-decreasing-array.cpp
class Solution { public: bool checkPossibility(vector<int> &nums) { int cnt = 0; for (int i = 1; i < nums.size(); i++) { if (nums[i] < nums[i - 1]) { if (++cnt > 1) return false; if (i == 1 ||...
ALGO
0.999972
5.731425
c6a9fc29-bb65-4129-89af-327af7531d0f
ishandutta2007/codeforces
kczno1/normal/976/F.cpp
#include<bits/stdc++.h> using namespace std; template <typename T> void chmin(T &x,const T &y) { if(x>y)x=y; } #define rep(i,l,r) for(int i=l;i<=r;++i) const int N=4000+5,M=2000+N+5,inf=1e9; struct Edge { int to,f,*nf; }; Edge qa[M*2],*t[N],*nt[N]; int cnt[N]; struct Edge0 { int x,y,f; Edge *dy; }; Edge0 edge0[M];...
ALGO
0.99996
3.380682
624cf972-423b-4438-9fe1-5b88c5fa4f66
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/07/0731/personal_submission/cf1041d_metal_frog.cpp
#include <cstdio> #include <algorithm> #include <iostream> #include <vector> #include <set> #include <map> #include <functional> #include <numeric> #include <queue> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() using ull = unsigned...
ALGO
0.999924
4.580898
32e51b97-5e43-4d8b-83c2-580ffb18e1d4
NahulRahman/C-_For_Noob_Steps
4.3.2 cubrt using setprecision.cpp
#include<iostream> #include<cmath> #include<iomanip> using namespace std; int main(){ double a,b,c; cin>>a>>b>>c; cout<<fixed<<setprecision(5)<<cbrt(a)<<endl<<cbrt(b)<<endl<<cbrt(c); return 0; }
ALGO
0.99503
4.032094
858d2265-075e-4501-b841-837504c6f2c7
DilawarAhmad/oops-programs
vowels.cpp
#include <iostream> using namespace std; int main() { char c; bool isLowercaseVowel, isUppercaseVowel; cout << "Enter an alphabet: "; cin >> c; // evaluates to 1 (true) if c is a lowercase vowel isLowercaseVowel = (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'); // evaluates t...
ALGO
0.993932
5.124171
e77b8d00-888c-4701-8d7f-2a2422571ede
C-2023-1-3/8209230229cyx
4.(二).2(2).cpp
/*дһַʽʾһ16תΪ10 вԡԭ int parseHex(const char *const hexString); 磺ú parseHex(A5);165*/ #include<iostream> using namespace std; int parseHex(const char* const hexString) { int sum = 0; int len= strlen(hexString); for (int i = 0; i < len; i++) { char currentChar = hexString[i]; int m; ...
ALGO
0.895335
4.936366
59430cb8-6679-4102-b146-e0248fcb27d0
KunalBansal12/KUNALBANSAL12
796-reaching-points/reaching-points.cpp
class Solution { public: bool reachingPoints(int sx, int sy, int tx, int ty) { if(sx==tx && sy==ty) return true; if(sx>tx || sy>ty) return false; if(tx==ty) return false; while(sx<=tx && sy<=ty){ if(sx==tx && sy==ty) return true; if(tx==ty) return false; ...
ALGO
0.999915
5.128915
415ae611-a076-4b4f-820a-5fe1fdc50ade
rohit9798/IB
LinkedList/reorder.cpp
Given a singly linked list L: L0 → L1 → … → Ln-1 → Ln, reorder it to: L0 → Ln → L1 → Ln-1 → L2 → Ln-2 → … You must do this in-place without altering the nodes’ values. For example, Given {1,2,3,4}, reorder it to {1,4,2,3}. ListNode *reverse(ListNode* ptr) { ListNode *atr = NULL, *qtr = ptr, *rtr = ptr; ...
ALGO
0.999957
5.092501
b5da9467-4aa5-4fa0-839c-2eb575c6b168
18860012923/move_base-and-TEB
navigation/amcl/src/amcl/sensors/amcl_laser.cpp
/////////////////////////////////////////////////////////////////////////// // // Desc: AMCL laser routines // Author: Andrew Howard // Date: 6 Feb 2003 // CVS: $Id: amcl_laser.cc 7057 2008-10-02 00:44:06Z gbiggs $ // /////////////////////////////////////////////////////////////////////////// #include <sys/types.h> //...
ALGO
0.986028
5.568535
32e15bb5-5692-4d7b-ac7d-94c34384c021
stevenmsl/cpp_dw_91
main.cpp
#include <iostream> #include <tuple> #include <vector> #include <string> #include "solution.h" #include "util.h" using namespace std; using namespace sol213; /* Example 1: Input: "12" Output: 2 Explanation: It could be decoded as "AB" (1 2) or "L" (12). */ tuple<string, int> testFixture1() { return make_tuple("12",...
ALGO
0.999201
5.440494
45662a0a-815c-4574-ae10-2aaf6434ecbb
eulersimoes/skrminifirware-e3-v2
Marlin-2.0.8.2.x-SKR-mini-E3-V2.0/Marlin/src/feature/bedlevel/abl/abl.cpp
#include "../../../inc/MarlinConfig.h" #if ENABLED(AUTO_BED_LEVELING_BILINEAR) #include "../bedlevel.h" #include "../../../module/motion.h" #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" #endif xy_pos_t bil...
ALGO
0.981824
6.396613
b40470b7-fa60-4dcc-8025-79d3cc07c394
Krutarth90/CODEFORCES
SOLVED/1300/1498B - Box Fitting.cpp
#include <bits/stdc++.h> using namespace std; #define flp(k,n) for(int i=k;i<n;i++) #define flm(k,n) for(int j=n-1;j>=k;j--) #define YES cout<<"YES\n" #define NO cout<<"NO\n" #define int ...
ALGO
0.999851
4.309461
392a0199-25a9-4fe9-938b-abf9c0befe79
DungNguyenCoder/CPP_PTIT
CPP0741.cpp
#include <bits/stdc++.h> #define faster() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; #define ll long long #define fi first #define se second #define vt vector #define db double const int mx = 1e5; // const int mod = 1e9 + 7; #define TEST 1 ll ans(ll n, ll k, ll mod) { if(k == 0) r...
ALGO
0.999958
4.786258
b2fce378-6954-4529-8c22-459f680dfa5b
BHUVI-SHIP-IT/its-me
1993-sum-of-all-subset-xor-totals/sum-of-all-subset-xor-totals.cpp
class Solution { public: int subsetXORSum(vector<int>& nums) { int total=0; for(int num:nums) { total|=num; } return total*(1<<(nums.size()-1)); } };
ALGO
0.999969
5.414296
aa04988e-23f3-4c4a-8362-10ed7672a5b5
Abdulrahman-Yasser/ProblemSolving
MostafaSaad_Udemy_Courses/Algorithms_1/3_Search/7_Heaters.cpp
#include <algorithm> int search_binary(vector<int>& heaters, int target){ int r = heaters.size()-1, l = 0, m = 0; int my_min = 2147483647; while(r >= l){ m = (r + l) / 2; if(heaters[m] < target){ l = m + 1; }else if(heaters[m] > target){ r = m - 1; }e...
ALGO
0.999954
5.482167
bd5061b9-1848-4215-8dbe-764a3ed4c5bb
trungdangtapcode/Competitive-Programming-Notebook
archived/my_desktop_grade11/boigioi/SPERNUM.cpp
#include <bits/stdc++.h> using namespace std; int n; int a[100005], f[100010], trace[100010]; bool danhdau[100005]; int main(){ memset(f,1,sizeof(f)); //ifstream fi("daykg.inp"); //ofstream fo("daykg.out"); cin >> n; int myMax = 0; for (int i = 0; i < n; i++) cin >> a[i]; f[0] = -1e15; for (int i = 0; i < ...
ALGO
0.999976
3.461351
45c6fb8d-3cb6-401b-bad9-35809b7797ce
mr-umardev/Data-Structures-and-Algorithms
0726-number-of-atoms/0726-number-of-atoms.cpp
class Solution { public: string countOfAtoms(string formula) { map<string, int> elementCount; stack<map<string, int>> elementStack; elementStack.push({}); int n = formula.size(); for (int i = 0; i < n; ) { if (formula[i] == '(') { elementStack.push({}); i...
ALGO
0.999983
5.353804
97135d99-1af0-4e22-9772-a098063fa70b
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/September/answer_20200913000818.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; #define testcase() int t; cin >> t; while(t--) int main(){ testcase(){ int size; cin >> size; vector<int> velocity,infected; velocity.push_back(0); for(int i = 1; i <= size; i++){ int a; ...
ALGO
0.999917
3.17057
28f02841-76f8-4a54-823b-4f89bb22cd71
chongin12/Problem_Solving
acmicpc.net/old/1205.cpp
#include <bits/stdc++.h> using namespace std; using ll=long long; int main(){ ll N,k,P; cin>>N>>k>>P; vector<ll> v(N); for(int i=0; i<N; ++i){ cin>>v[i]; } sort(v.begin(), v.end()); if(N==P && v[0]>=k) { cout << "-1\n"; } else{ cout << N-(upper_bound(v.begin(), v....
ALGO
0.999988
3.852115
f560eab5-a626-45fd-975e-1cba31244cf6
heonilp/study
leetcode/Rotate Array.cpp
class Solution { public: void rotate(vector<int>& nums, int k) { int cell = (int)nums.size(); k = k % cell; if(k==0) { return; } k = nums.size()-k; //바꾸는것 로직 reverse(nums.begin(),nums.begin()+k); reverse(nums.begin...
ALGO
0.999975
5.910673
3b2f95e7-05a9-4c77-8e08-c20d3e021d52
perfan/ParPhase
src/2D/Geometry/Vector2D.cpp
#include <math.h> #include <boost/algorithm/string.hpp> #include "System/Exception.h" #include "Vector2D.h" const Scalar Vector2D::EPSILON_ = 10. * std::numeric_limits<Scalar>::epsilon(); // This parameter governs the precision of vector operations Vector2D::Vector2D(std::string vecStr) { using namespa...
TOOL
0.9219
6.767178
238a7615-ab09-4b90-9c7c-49bc16e94413
ebayparts/Cpp_projects
pos_neg_zero in template function/pos_neg_zero in template function/Source.cpp
#include<iostream> #include<Windows.h> #include<string> #include<ctime> using namespace std; int pos = 0; int neg = 0; int zer = 0; template <typename T> void posNegZer(T array[], T size) { for (T i = 0; i < size; i++) { if (array[i] > 0) { pos++; } else if (array[i] < 0) { neg++; } else { zer+...
ALGO
0.987392
3.987252
789d2b5e-eb8f-438f-8241-b5a26486ebab
Nasir-1310/Combinatorial-Optimization-CSE-301-
All CO codes/Assignment_LCS,ED,Bread_cutting,Rod_cutting/ED(Edit distance).cpp
//ED code in C #include<bits/stdc++.h> using namespace std; int main() { printf("Determining ED(Longest Common Subsequence)\n---------------------------------------------------\n"); printf("Enter the length of x and y\n"); int m,n; int ch; cin>>m>>n; m=m+2; n=n+2; int a[m][n]; ch...
ALGO
0.999996
3.805935
5082a4d1-032d-49da-ae98-968a2cc09d65
Xnuvers007/Kuliah
semester 4/pert6/tugaspendahuluan6.cpp
#include <iostream> using namespace std; int main() { int data[100], cari, n, i, j, temp; cout << endl; cout << "|=============================|" << endl; cout << "| Nama : Indra Dwi Aryadi |" << endl; cout << "| NIM : 211011450468 |" << endl; cout << "|==========================...
ALGO
0.999436
4.580213
510e2945-d0b4-4c8f-97b8-ee023a4beb07
ConanSherlock/AdventOfCode2015
src/private/2015/aoc_2015_day6.cpp
// // Created by conan on 11/02/2021. // #include "aoc_2015_day6.hpp" #define LIGHTS_ON "on" #define LIGHTS_OFF "off" #define INDEX_SIZE_OFFSET 1 #define TOGGLE_INCREASE 2 #define TURN_CHANGE 1 void AoC2015Day6::reset() { numLights = 0; totalBrightness = 0; ui16StartX = UINT16_MAX; ui16StartY = UINT1...
TOOL
0.914314
6.124296
ac66a693-372c-478e-8e75-4cabf8cbdd91
sam5854/lc_submitter
C++/meeting-scheduler.cpp
// Time: O(n) ~ O(nlogn) // Space: O(n) class Solution { public: vector<int> minAvailableDuration(vector<vector<int>>& slots1, vector<vector<int>>& slots2, int duration) { vector<pair<int, int>> min_heap; for (const auto& slot : slots1) { if (slot[1] - slot[0] >= duration) { ...
ALGO
0.99998
6.451032
516858a3-3a38-4bf7-9afc-38363151e264
Mr-khan3810/C-programs
Adding entered numbers.cpp
#include<iostream> #include<cmath> using namespace std; int main() { int num,r,sum=0; cout<<"Enter the number:"<<endl; cin>>num; while(num!=0) { r=num%10; sum=sum+r; num=num/10; } cout<<"The sum is "<<sum; return 0; }
ALGO
0.999485
3.682009
f97f104a-a12e-4716-b0d4-276008e5ffee
srcnstc/KocaeliUniversity
HEVC/HM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
/** \file TComLoopFilter.cpp \brief deblocking filter */ #include "TComLoopFilter.h" #include "TComSlice.h" #include "TComMv.h" #include "TComTU.h" //! \ingroup TLibCommon //! \{ // ==================================================================================================================== // Cons...
ALGO
0.886828
3.261347
1fc08c35-dc8b-4dee-8760-d1f6f9a186d6
Argente0810/BAEKJOON__ONLINE_JUDGE
one-dimensional array/10810 Ball throw.cpp
#include <iostream> using namespace std; int main(){ int N, M; cin >> N >> M; int arr[100]; for (int i = 0; i < N; i++) { arr[i] = 0; } for (int i = 0; i < M; i++) { int A, B, C; cin >> A >> B >> C; for (int j = A - 1; j < B; j++) { arr[j] = C; ...
ALGO
0.999793
3.658374
76cfc8e4-541a-4020-8715-6acfaf913a2f
li-ming-jiang/MyOpenSees
SRC/analysis/dof_grp/TransformationDOF_Group.cpp
// $Revision: 1.22 $ // $Date: 2009-03-09 22:33:01 $ // $Source: /usr/local/cvs/OpenSees/SRC/analysis/dof_grp/TransformationDOF_Group.cpp,v $ // Written: fmk // Created: 05/99 // Revision: A // // Purpose: This file contains the code for implementing the methods // of the TransformationDOF_Group class interface. // /...
TOOL
0.928504
6.07138
b156a234-0f80-41fd-b02f-baf04f07b780
liuq901/code
ZJ/zj_d_821.cpp
#include <cstdio> #include <cstdlib> #include <cstring> const int mod=100000; const int c[4][2]={{-1,0},{1,0},{0,-1},{0,1}}; bool map[60][60]; int dis[60][60],num[60][60],q[4000][2]; int main() { int n,m; while (scanf("%d%d",&n,&m)==2) { memset(dis,63,sizeof(dis)); for (int i=0;i<n;i++) fo...
ALGO
0.999929
4.890504
3964b326-d927-4fb3-af7b-a0e47c199f39
nikhil16072003/LeetCode
788. Rotated Digits.cpp
class Solution { public: string rotate(string s){ string temp=""; bool check=true; for(int i=0;i<s.length();i++){ if(s[i]=='0' || s[i]=='1' || s[i]=='8'){ temp+=s[i]; } else if(s[i]=='2'){ temp+='5'; } ...
ALGO
0.999631
5.43045
4a2ab756-cea3-4df3-8603-b513715a3132
strengthen/LeetCode
C++/86.cpp
__________________________________________________________________________________________________ 8ms /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* partition(ListNode*...
ALGO
0.999997
5.144859
e609697c-7030-49f4-8753-80c2c93a681a
Todah01/Coding_Test
Coding_Test/pair_of_playground.cpp
#if 0 #include <string> #include <vector> #include <algorithm> #include <map> #include <cstdio> using namespace std; long long solution(vector<int> weights) { long long answer = 0; map<float, long long> weight_map; vector<int> dist = { 2, 3, 4 }; vector<vector<int>> dist_comb; for (auto weight : ...
ALGO
0.999765
3.755919