uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
671335e7-6ca3-4419-b83f-cc8ec3d9ba00 | SaurabhRaj-SR31/LeetCode | 0207-course-schedule/0207-course-schedule.cpp | class Solution {
public:
bool topologicalSortCheck(unordered_map<int, vector<int>> &adj, int n, vector<int> &indegree) {
queue<int> que;
int count = 0;
for(int i = 0; i<n; i++) {
if(indegree[i] == 0) {
count++;
que.push(i)... | ALGO | 0.999888 | 6.551977 |
f2cc2268-6509-408f-a9f0-80b1d5654bf7 | strengthen/LeetCode | C++/955.cpp | __________________________________________________________________________________________________
sample 8 ms submission
auto _ = []() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
return 0;
} ();
class Solution {
public:
int minDeletionSize(const vector<string>& a) {
... | ALGO | 0.999975 | 5.49832 |
002cde81-d732-4fae-b8cb-b80b7868b1b3 | raviii21/Leetcode-Codes | zigzag-conversion/2-3-2023, 9_40_02 AM/zigzag-conversion.cpp | // Link: https://leetcode.com/problems/zigzag-conversion
/** Submission Info:
*
* AUTHOR: Ravi Savsani
* TITLE: zigzag-conversion
* RUNTIME: 7 ms
* MEMORY: 8.3 MB
* DATE: 2-3-2023, 9:40:02 AM
*
*/
// Solution:
class Solution {
public:
string convert(string s, int numRows) {
if(numRows == 1) ... | ALGO | 0.999996 | 6.431288 |
7d607b7b-6b07-4f89-bf7a-cc0a80049c2e | MasterIceZ/IMSO | icpc/cf/smth/G.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MxN = 200020;
int n, deg[MxN];
vector<int> adj[MxN];
inline void solve() {
cin >> n;
for(int i=2, u, v; i<=n; ++i) {
cin >> u >> v;
adj[u].emplace_back(v);
adj[v].emplace_back(u);
deg[u]++, deg[v]++;
}
int first_ma... | ALGO | 0.999911 | 5.086467 |
c1dfa4f9-0b9d-458a-a5bc-6334edfc02f5 | Mzohaibm/Cpp-Zero-to-Standard | smallProjects/HypotenusePractise.cpp | #include <iostream>
#include <cmath>
int main()
{
double a;
double b;
double c;
std::cout << "Enter A Value..."
<< "\n";
std::cin >> a;
std::cout << "Enter B Value..."
<< "\n";
std::cin >> b;
a = pow(a, 2);
b = pow(b, 2);
c = sqrt(a + b);
std::cou... | ALGO | 0.997612 | 3.991765 |
38d0e69e-27da-42ef-b203-c2cb67c1a9de | himanshu062/CrackYourPlacement | 304-range-sum-query-2d-immutable/range-sum-query-2d-immutable.cpp | class NumMatrix {
public:
NumMatrix(vector<vector<int>>& matrix) {
if (matrix.empty())
return;
const int m = matrix.size();
const int n = matrix[0].size();
prefix.resize(m + 1, vector<int>(n + 1));
for (int i = 0; i < m; ++i)
for (int j = 0; j < n; +... | ALGO | 0.999721 | 6.717075 |
7c53ccb4-1f29-467b-a696-c7cf01d4fa0e | IvanRenison/ProgrammingProblems | ICPC contests/NEERC Northern Subregional 2008-2009/K.cpp | // https://codeforces.com/gym/100623
/*
Encontrar el número mas chico que no se puede escribir como suma
Subproblema mas simple: https://cses.fi/problemset/task/2183
Resolver m veces ese problema es la solución
*/
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define fore(i, a, b) ... | ALGO | 0.999498 | 4.34548 |
f95bfce7-3289-4d19-8b36-53d6536e34bb | felipejazz/advent-of-code-cpp | day_1/tests/TestSolver.cpp | #include "Day1Solver.cpp"
#include <cassert>
#include <iostream>
using namespace std;
ostream& operator<<(ostream& os, const vector<int>& vec) {
os << "[";
for (size_t i = 0; i < vec.size(); ++i) {
os << vec[i];
if (i != vec.size() - 1) {
os << ", ";
}
}
os << "]";
... | ALGO | 0.979776 | 6.506082 |
2f8c99d6-5d54-47b8-a44a-1cb2a5d8b422 | seoyeon0413/Algorithm | Algorithm/1507.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n;
int t[21][21];
int main()
{
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cin >> t[i][j];
}
}
for (int k = 0; k < n; k++) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (t[i][k] == -1 |... | ALGO | 0.999979 | 3.522807 |
e50a1fa5-d6e4-4faf-80ca-0b7d58b91677 | 5455945/cpp_demo | c++11/linq_test/linq_test.cpp | #include "../linq/LinqCpp.hpp"
#include <iostream>
#include <string>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
void TestLinqCpp()
{
using namespace cosmos;
vector<int>v = { 0, 1, 2, 3, 4, 5, 3, 6 };
vector<string> strv = { "a", "b", "c" };
map<int, int> mymap = { { ... | ALGO | 0.938263 | 4.293667 |
de639136-3e8a-4408-ac44-34ad7728071b | samheather/3DVision | OpenCV/opencv-2.4.8/modules/ml/src/knearest.cpp | #include "precomp.hpp"
/****************************************************************************************\
* K-Nearest Neighbors Classifier *
\****************************************************************************************/
// k Nearest Neighbors... | ALGO | 0.999096 | 6.50179 |
7fe90690-1629-4d99-9f29-1e2f883f081e | Abhi6722/qzense_fish_data | 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.998841 | 6.783336 |
19d13f4a-4b8e-40e5-a731-d69ea9521ae6 | pnnv/hyprland-dotfiles | VSCodium/User/History/-1ba534aa/RrGk.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int32_t main() {
ios::sync_with_stdio(false); cin.tie(0);
ll fin = 0;
ll n, m; cin >> n >> m;
vector <ll> v(n);
for(auto &i: v) cin >> i;
vector <ll> pre = v, suf = v;
map <ll, ll> pp; pp[0]++;
for(int i = 1; i < n; i++) pre[i] += pre[i - ... | ALGO | 0.999991 | 4.123042 |
7bf0a065-1768-48e0-9809-c6737f3a0fc5 | ab-kg/DataStructures-Algorithms | tree/BST/bstIterator.cpp | #include <iostream>
#include <algorithm>
#include <climits>
#include <stack>
using namespace std;
// Node structure for the binary tree
struct Node {
int data;
Node* left;
Node* right;
// Constructor to initialize
// the node with a value
Node(int val) : data(val), left(nullptr), right(nullpt... | ALGO | 0.999884 | 5.578372 |
d754bb50-47fd-4cbb-87c8-bbc7fe409895 | Anxi77/.Algorithms | BaaarkingDog/0x10/solutions/2748.cpp | // Authored by : jihwan0123
// Co-authored by : -
// http://boj.kr/fca58deb2214447782fe6483572acdb8
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll d[100];
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
d[1] = 1, d[2] = 1;
for (int i = 3; i <= n; i++)
d[i] ... | ALGO | 0.999993 | 4.537287 |
42646154-91bf-45fc-a23f-80a7b0bb3dda | NaterGator/AndroidOpenCV_mods | modules/features2d/src/fast.cpp | /*
The references are:
* Machine learning for high-speed corner detection,
E. Rosten and T. Drummond, ECCV 2006
* Faster and better: A machine learning approach to corner detection
E. Rosten, R. Porter and T. Drummond, PAMI, 2009
*/
#include "precomp.hpp"
namespace cv
{
static int fast9CornerScore(const uns... | ALGO | 0.999748 | 6.094082 |
b301bd5e-079d-4c32-a2e8-e27eb7f14828 | irori-gthb/atcoder | abc2xx/abc221/abc221_a.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int main() {
int A, B;
cin >> A >> B;
int ans = 1;
rep(i, A - B) ans *= 32;
cout << ans << endl;
return 0;
} | ALGO | 0.998584 | 3.25846 |
18995a0f-5295-485a-8021-effa2fa31124 | kwon4450/Algorithm | BI/3/03_10866.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
const ll INF = 9876543210;
const ll mod = 1000000007;
const double PI = acos(-1);
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
int N,deck[20001]={},f... | ALGO | 0.996903 | 4.213088 |
db053cd0-c4dc-4c1b-b60c-60325b38765c | 789sandeep/programmc- | pointer1/q2.cpp | // Q2 - Write a program to find the product of 2 numbers using pointers
#include<iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
int *ptra=&a;
int *ptrb=&b;
int ans;
int *ptr_ans=&ans;
*ptr_ans=*ptra * *ptrb;
cout<<ans<<endl;
cout<<*ptr_ans;
} | ALGO | 0.999524 | 3.659475 |
e171f660-c74d-48c0-aa7d-22bffd1e0af8 | tarek-adam/runtrackCPP | jour03/job05.cpp | #include <iostream>
#include <string>
using namespace std;
// Function to check if a character is a digit
bool isDigit(char c) {
return c >= '0' && c <= '9';
}
// Function to validate if the input matches the format "XXhXX"
bool validateTimeFormat(const string& input) {
// Check if the input length is 5 (XXh... | TOOL | 0.961405 | 6.733778 |
9bad42ba-ee50-4b60-a11b-590002673f44 | dwaine-lci/3DGraphics | Pix/Clipper.cpp | #include "Clipper.h"
#include "Viewport.h"
const int BIT_INSIDE = 0; // 0000
const int BIT_LEFT = 1 << 1; // 0001
const int BIT_RIGHT = 1 << 2; // 0010
const int BIT_BOTTOM = 1 << 3; // 0100
const int BIT_TOP = 1 << 4; // 1000
enum class ClipEdge : int { Left, Bottom, Right, Top, Count };
bool IsInFront(ClipEdge e... | ALGO | 0.999034 | 6.182849 |
4b99afdc-4b03-4f4a-99c6-453d7f9cc1b2 | dvpu2tg/leafi | LeaFi-enhanced MESSI/src/filters/conformal_adjustor.cpp | #include "conformal_adjustor.h"
#include <algorithm>
#include <cstring>
#include <cassert>
#include <numeric>
#include "clog.h"
template<class T>
static std::string array2str(T *values, ID_TYPE length) {
return std::accumulate(values + 1,
values + length,
std... | ALGO | 0.989187 | 6.982705 |
04d2dbb5-74b4-4ffb-8457-799f90ec2014 | Vishvajeet123/Striver_A_2_sheet | zig-zag traversal of binarytree .cpp | class Solution {
public:
vector<vector<int>> zigzagLevelOrder(TreeNode* root) {
vector<vector<int>>ans;
queue<TreeNode * >q;
int count =0;
q.push(root);
if (root == NULL)
return ans ;
while (1)
{
int size = q.size(... | ALGO | 0.999987 | 5.916906 |
39e4e75d-6003-445e-b655-7de9e11c8580 | JiayeJerryWang/CUDA-CNN-Optimization-on-GPU | CUDA CNN Optimization/project/third_party/eigen/unsupported/doc/examples/MatrixExponential.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(3,3);
A << 0, -pi/4, 0,
pi/4, 0, 0,
0, 0, 0;
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix exponential ... | ALGO | 0.999768 | 3.706936 |
e936b790-9c55-4e63-9e54-3dca5ace1f3c | duchenlong/boost-search-engine | boost/install/boost_1_53_0/libs/math/src/tr1/assoc_legendre.cpp | extern "C" double BOOST_MATH_TR1_DECL boost_assoc_legendre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, double x) BOOST_MATH_C99_THROW_SPEC
{
return (m&1 ? -1 : 1) * c_policies::legendre_p BOOST_PREVENT_MACRO_SUBSTITUTION(l, m, x);
}
| TOOL | 0.950371 | 4.3802 |
eb4c3ce3-f64f-4891-8ac6-df44b469b935 | onera/Cassiopee | Cassiopee/XCore/XCore/AdaptMesh/MeshSmooth.cpp | #include <stack>
#include "Mesh.h"
#include "common/mem.h"
void Mesh_get_cneis(Mesh *M, E_Int cid, E_Int &nn, E_Int neis[24])
{
E_Int *cell = Mesh_get_cell(M, cid);
E_Int *crange = Mesh_get_crange(M, cid);
E_Int cstride = M->cstride[cid];
nn = 0;
for (E_Int i = 0; i < cstride; i++) {
E_I... | ALGO | 0.999632 | 4.163266 |
476ff23a-fefb-49aa-8c3a-4566cedd44f7 | KMsojib/LeetCode | Year-2025 Problem List/March 2025/2460. Apply Operations to an Array.cpp | /*
# Problem : 2460. Apply Operations to an Array
# Time Complexity : O(N)
# C++ Solution
*/
class Solution {
public:
vector<int> applyOperations(vector<int>& nums) {
int n = (int)nums.size();
vector<int> ans;
for (int i = 0; i < n - 1; i++) {
if (nums[i] == nums[i + ... | ALGO | 0.999994 | 5.846533 |
3f9fc4ee-eb6c-4c16-83a9-d363ad452241 | dvbuiilds/dsa-prep | GFG/Sliding Window/Smallest window in a string containing all the characters of another string.cpp | /**
* @file Smallest window in a string containing all the characters of another string
* @author @dvbuiilds
* @brief
* @version 0.1
* @date 2022-06-26
* @link https://practice.geeksforgeeks.org/problems/smallest-window-in-a-string-containing-all-the-characters-of-another-string-1587115621/ @endlink
* @copyrigh... | ALGO | 0.999991 | 6.422361 |
0b0f70af-d50a-4e8e-8392-1d1f581a4082 | etiset/kattis-solutions | whatdoesthefoxsay.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> v;
int main() {
int test;
cin >> test;
cin.ignore();
while (test--) {
v.clear();
string text;
getline(cin, text);
stringstream ss(text);
string s;
while (ss >> s) {
v.push_back(s);
}
while (true) {
st... | ALGO | 0.996217 | 3.844669 |
f590f473-0005-4952-8af9-2b5a09b0687c | HS831/Leetcode-Company-Wise-Solutions | Goldman-Sachs/Product-of-array-except-self.cpp | /* ------------------------ Product of Array Except Self ---------------
Leetcode Question Number : 238
Leectode Difficulty Tag : Medium
Leetcode Problem Link : https://leetcode.com/problems/product-of-array-except-self/
---------------------------------------------------------------*/
class Solution {
publi... | ALGO | 0.999941 | 6.56592 |
705920fd-7b48-4cc2-a6f9-78efe62818fa | smart-lemon/DesignPatterns-Algorithms | Prep/Leet/Trees/Easy/IsBalancedBinaryTree.cpp | #include "./../../../../Include/Common.h"
typedef struct TreeNode;
/*
Given a binary tree, determine if it is height-balanced.
https://leetcode.com/problems/balanced-binary-tree
*/
typedef struct TreeNode;
class Solution {
int isBalancedUtil(TreeNode* root) {
if(root == nullptr)
... | ALGO | 0.999649 | 6.489428 |
804e3113-9700-4b37-9c49-4e1a8b656456 | eternity-group/eternity | src/addrman.cpp | #include "addrman.h"
#include "hash.h"
#include "serialize.h"
#include "streams.h"
int CAddrInfo::GetTriedBucket(const uint256& nKey) const
{
uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetHash().GetCheapHash();
uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << (has... | TOOL | 0.915586 | 6.65579 |
070953f8-0ea8-45ae-b539-b80629c96d0a | Eicosane-2/Schemi | Schemi/src/service/zoneInsideSphere.cpp | /*
* zoneInsideSphere.cpp
*
* Created on: 2024/10/10
* Author: Maxim Boldyrev
*/
#include "zoneInsideSphere.hpp"
schemi::zoneInsideSphere::zoneInsideSphere(const vector & c, const scalar r) :
sphere(c, r)
{
}
bool schemi::zoneInsideSphere::isPointInZone(const vector & p) const noexcept
{
return isPoint... | TOOL | 0.943283 | 4.256525 |
33aa3634-0433-4520-affd-e57e77d58b5f | ToraSpencer/libigl_CGAL_openGL | include/igl/inradius.cpp | template <
typename DerivedV,
typename DerivedF,
typename DerivedR>
IGL_INLINE void igl::inradius(
const Eigen::MatrixBase<DerivedV> & vers,
const Eigen::MatrixBase<DerivedF> & tris,
Eigen::PlainObjectBase<DerivedR> & r)
{
Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> l;
Eigen::Matrix<typena... | ALGO | 0.997826 | 5.946877 |
23619dc7-e4ca-42b6-9fb8-e4e210e000d1 | btjanaka/algorithm-problems | kattis/bossbattle.cpp | // Author: btjanaka (Bryon Tjanaka)
// Problem: (Kattis) bossbattle
// Title: Boss Battle
// Link: https://open.kattis.com/problems/bossbattle
// Idea: Subtract 2 (usually).
// Difficulty: easy
// Tags: easy
#include <bits/stdc++.h>
#define GET(x) scanf("%d", &x)
typedef long long ll;
using namespace std;
int main() {... | ALGO | 0.999955 | 4.539348 |
65ad77e9-e527-4202-9bf5-d2600a3ba8be | Yukariko/acm | problem/3005/test.cpp | #include <bits/stdc++.h>
using namespace std;
const int dy[] = {0, 1};
const int dx[] = {1, 0};
int N, M;
char a[21][21];
int main()
{
scanf("%d%d", &N, &M);
for(int i=0; i < N; i++)
scanf("%s", a[i]);
string ans = "|";
for(int i=0; i < N; i++)
{
for(int j=0; j < M; j++)
{
if(a[i][j] == '#')
con... | ALGO | 0.999944 | 4.867767 |
995390cf-102e-4282-ac80-44da798b6c72 | LucasWilkinson/ASpT-mirror | CSB/bicsb.cpp | #include <cassert>
#include "bicsb.h"
#include "utility.h"
// Choose block size as big as possible given the following constraints
// 1) The bot array is addressible by IT
// 2) The parts of x & y vectors that a block touches fits into L2 cache [assuming a saxpy() operation]
// 3) There's enough parallel slackness for... | ALGO | 0.986689 | 3.300197 |
83cc9654-4274-4a88-a0e2-e21e84d5584d | UCM-FDI-DISIA/FORGE_Dependencies | Bullet/src/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp | #define CLEAR_MANIFOLD 1
#include "btSphereSphereCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionDispatch/btCollision... | ALGO | 0.99833 | 6.664439 |
4a1fc061-1e65-4dea-b008-421727db1bbc | Ali-hey-0/opencv | 3rdparty/carotene/src/scharr.cpp | #include <vector>
#include "common.hpp"
namespace CAROTENE_NS {
bool isScharr3x3Supported(const Size2D &size, BORDER_MODE border, s32 dx, s32 dy, Margin borderMargin)
{
return (dx == 0 && dy == 1 &&
isSeparableFilter3x3Supported(size, border, 3, 1, borderMargin)) ||
(dx == 1 && dy =... | ALGO | 0.982099 | 4.749222 |
4bf32e89-6fa2-44ab-93db-ca6509dd00f4 | THU-DSP-LAB/llvm-project | libc/src/math/generic/cosf.cpp | #include "src/math/cosf.h"
#include "sincosf_utils.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/except_value_utils.h"
#include "src/__support/FPUtil/multiply_add.h"
#include "src/__support/common.h... | ALGO | 0.998841 | 7.516635 |
b50230c1-ccd9-454c-807e-d6177d57f79c | souravpadhy/LOC_GRP_6 | week 1/2.cpp | #include <iostream>
using namespace std;
int main() {
int number ;
std::cout << "Enter a number: ";
std::cin >> number;
if (number > 0) {
std::cout << "The number is positive.";
} else if (number < 0) {
std::cout << "The number is negative.";
} else {
std::cout << "The ... | TOOL | 0.972926 | 3.853747 |
a13c65e1-7bef-48b0-8c65-b309f30b4e27 | sarvex/leetcode-c3 | solution/2400-2499/2467.Most Profitable Path in a Tree/Solution.cpp | class Solution {
public:
int mostProfitablePath(vector<vector<int>>& edges, int bob, vector<int>& amount) {
int n = edges.size() + 1;
vector<vector<int>> g(n);
for (auto& e : edges) {
int a = e[0], b = e[1];
g[a].emplace_back(b);
g[b].emplace_back(a);
... | ALGO | 0.999896 | 5.114717 |
0c7440a0-db0a-40f0-8167-57be4b38023d | GdelP/advent-of-code-2021 | 01.cpp | #include <iostream>
int main(int, char**) {
std::int64_t depth_0 = 0;
std::int64_t depth_1 = 0;
std::size_t increases = 0;
std::cin >> depth_0;
while (std::cin >> depth_1) {
if (depth_1 > depth_0) {
increases++;
}
depth_0 = depth_1;
}
std::cout << increases;
}
| ALGO | 0.998835 | 4.206698 |
61bd89b1-522c-4cb7-9e85-31e2adfb1aa3 | praymeta/Code-Up-Algorithm | BOJ_EveryoneIsaWinner.cpp | #include <iostream>
using namespace std;
int main(void) {
int M, K;
cin >> M >> K;
if (M % K == 0) {
cout << "Yes";
} else {
cout << "No";
}
}
| ALGO | 0.999963 | 4.338787 |
6be49822-1bb6-4f86-812b-fa6fca839f9c | miguelsrrobo/C-C- | ED/listaDupEncMenuCirc.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
struct Node
{
int num;
Node* prox;
Node* ant;
};
typedef struct Node node;
struct LDEC
{
Node *cabeca;
Node *cauda;
int tamanho;
};
typedef struct LDEC ldec;
void inserirInicio(ldec *l,int valor) //Insere um n no comeo da ... | ALGO | 0.999249 | 3.782212 |
baec5e3c-6939-45ea-a7c8-d892e66200f7 | aryanRiyal/DSA | basics/dynamicAllocation/dynamicAllocation.cpp | #include<iostream>
using namespace std;
int main(){
cout<<"Static Memory Allocation"<<endl;
int n = 10;
int arr[n] = {0};
cout<<"int n = 10;"<<endl;
cout<<"int arr[n] = {0};"<<endl;
cout<<"arr["<<n<<"] = { ";
for(int i = 0; i<n; i++){
cout<<arr[i]<<" ";
}
cout<<"}"<<endl<<en... | TOOL | 0.940033 | 4.161171 |
1d3b72d4-05d0-4fa8-96ca-a4aa8c3a6b83 | coral-learning/open-jdk-coderead | hotspot/src/share/vm/libadt/vectset.cpp | #include "precompiled.hpp"
#include "libadt/vectset.hpp"
#include "memory/allocation.inline.hpp"
// Vector Sets - An Abstract Data Type
// %%%%% includes not needed with AVM framework - Ungar
// #include "port.hpp"
//IMPLEMENTATION
// #include "vectset.hpp"
// BitsInByte is a lookup table which tells the number of b... | TOOL | 0.869821 | 5.983238 |
b97e4642-5dfe-4d87-96e7-cb7159a7485e | kanikachouhan0027/DSA | 14_lect/search.cpp | #include<iostream>
using namespace std;
int Search(int arr[],int n,int key){
int start=0;
int end=n-1;
int mid=start+(end-start)/2;
while(start<=end){
/* a*/ if(key>=arr[0]){//1st line of graph
/*1st*/ if(arr[mid]>=0){
if(arr[mid]==key){ return mid;}
else if(ke... | ALGO | 0.99998 | 4.786399 |
7da92aaa-8797-4b3f-a199-087006f27e02 | Nimesh-Srivastava/DSA | C++/Codeforces/1525B.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n{0};
cin>>n;
vector<int> arr;
int minVal{INT_MAX}, maxVal{INT_MIN};
for(int i = 0; i < n; i++){
int temp;
cin>>temp;
arr.push_back(temp);
minVal = min(minVal, temp);
maxVal = max(maxV... | ALGO | 0.999638 | 4.437588 |
4b4efbfb-ef72-4a5b-b48a-d3a87c2e6015 | dennisfInf/test_repo | src/home_operator/create_entry.cpp | #include "crypto/bookkeeping_proofs/create_entry/out_types.hpp"
#include "crypto/bookkeeping_proofs/create_entry/verifier.h"
#include "home_operator/protocol.h"
#include "user/protocol.h"
namespace bookkeeping
{
bool HomeOperator::verify_create_entry_proof(proof_create_entry_user &p_ce, std::vector<uint8_t> &h, tsps... | ALGO | 0.994038 | 5.549271 |
85faf2f6-1aca-4d94-b4d7-43aa00ab77a6 | ys-dirard/cpp | kyopro_educational_90-main/sol/038.cpp | #include <iostream>
using namespace std;
long long gcd(long long a, long long b) {
if (b == 0) return a;
return gcd(b, a % b);
}
int main() {
long long A, B, THRESHOLD = 1000000000000000000LL;
cin >> A >> B;
long long C = A / gcd(A, B);
if (B <= THRESHOLD / C) cout << C * B << endl;
else cout << "Large" << en... | ALGO | 0.999946 | 3.893742 |
6304562f-57e2-48e0-bf57-6517f26126e9 | loma373/LeetCode | 48-rotate-image/48-rotate-image.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
int n=matrix.size();
for(int i=0;i<(n+1)/2;i++){
for(int j=0;j<n/2;j++){
int temp=matrix[n-1-j][i];
matrix[n-1-j][i]=matrix[n-1-i][n-1-j];
matrix[n-1-i][n-1-j]=matrix[j][n-... | ALGO | 0.999981 | 6.38623 |
55c8153e-eb8d-4c15-9a9b-49e31d6fb5f9 | Naveenprabaharan/Learning | Language/C++/C++_learning/12.1.1 while loop factorial.cpp | #include<iostream>
using namespace std;
int main()
{
int number;
cout<<"enter the number to find Factorial:";
cin>>number;
int i=1;
int sum=1;
while(i<=number)
{
sum *=i;
i++;
}
cout<<"factorial of "<<number<<" is = "<<sum;
return 0;
}
| ALGO | 0.999738 | 3.236444 |
32201b29-58c8-4b05-8b7c-9384d1c853cd | skillzee/DP | lec03_1.cpp | // FrogJump Tabulation
#include <bits/stdc++.h>
using namespace std;
int frogJump(int n, vector<int> &heights) {
vector<int> dp(n, -1);
dp[0] = 0;
for(int i = 1; i<n; i++){
int fs = dp[i-1] + abs(heights[i] - heights[i-1]);
int ss = INT_MAX;
if(i>1){
ss = dp[i-2] + abs... | ALGO | 0.999863 | 5.440124 |
5a6aa246-72a3-4ca4-b237-eba338fda154 | ItsTHEAvro/Leetcode-Solutions | 3016-minimum-number-of-pushes-to-type-word-ii/3016-minimum-number-of-pushes-to-type-word-ii.cpp | class Solution {
public:
int minimumPushes(string word) {
unordered_map<char,int>mp;
for(auto &e: word) mp[e]++;
int ans = 0;
priority_queue<pair<int,int>>pq;
for(auto &[f,s]:mp) pq.push({s,f});
int click = 1, button= 0;
while(!pq.empty()){
aut... | ALGO | 0.999984 | 5.364147 |
5715042a-6f1a-453d-9fda-233d3d8968d1 | leenldk/lammps_hiercut | src/KOKKOS/pair_exp6_rx_kokkos.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Stan Moore (Sandia)
------------------------------------------------------------------------- */
#include "pair_exp6_rx_kokkos.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neig... | ALGO | 0.986039 | 6.629128 |
a1f44d85-f88a-4ce1-81e0-d351a092e1ce | AllisonLee0507/CPlusPlus_Language_Tutorial | 15.STL Basic/15-03.binary_function.cpp | #if 0
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;
// include self-defined fopow<>
#include <functional>
#include <cmath>
template <class T1, class T2>
struct fopow : public std::binary_function<T1, T2, T1>
{
T1 operator() (T1 base, T2 exp) const {
return std:... | ALGO | 0.963443 | 5.1953 |
4ea6a15d-ab05-44d9-99e4-ac38c1f35028 | luckoo1/algorithm | 2024/4.P_정수삼각형.cpp | #include <iostream>
#include <vector>
using namespace std;
int dist[501][501];
int max(int a, int b)
{
if (a > b)
return a;
else
return b;
}
int solution(vector<vector<int>> triangle)
{
dist[0][0] = triangle[0][0];
for (int i = 0; i < triangle.size(); i++)
{
for (int j =... | ALGO | 0.999939 | 4.546308 |
5650bbb9-7a47-4331-9300-e2727b236ced | hemantchaurasia2002/C_PROGRAMS | BASICS/rec.cpp | /*#include <iostream>
using namespace std;
void area
{ int l=7,b=5;
float area;
area=(float(l+b)/2);
cout<<area;
}*/
#include <stdlib.h>
#include <iostream>
using namespace std;
int main()
{
int b=4,h=5;
float area;
area=(float(b * h)/2);
cout<<area;
}
| ALGO | 0.998567 | 3.231012 |
8317f98e-c975-44cd-81e4-0b45543f5c32 | pablobladimir/Aqui-estan-todos-los-ejercicios-hechos-en-progra-2 | PabloMoralesPrueba1.cpp | #include <iostream>
using namespace std;
/*
Ingresar un numero y determinar cuantas cifras tiene, evaluar hasta 4 cifras y luego decir tiene mas de 4 cifras
No tiene que importar el signo se avaluara el valor absoluto
<------------------------------------------------------->
0 9 99 999 ... | ALGO | 0.995767 | 3.623343 |
6975eecb-7d4e-467a-bbaf-eab81ef735e2 | anproa31/ICPC | Self-Learn/CSES/bit_strings.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define F first
#define S second
#define MAX 1000000007
int main()
{
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// ios_base::sync_with_stdio(0);
// cin... | ALGO | 0.999967 | 4.346819 |
6bb48839-6513-45e7-9dc6-b633ae5afd93 | meatharvagosavi/AdvancedC-basics | lcm and gcd of numbers.cpp | #include<stdio.h>
int gcd(int,int);
int main()
{
int lcm,hcf,x,y;
printf("enter two num\n");
scanf("%d%d",&x,&y);
hcf=gcd(x,y);
lcm=(x*y)/hcf;
printf("the hcf of %d and %d is %d\n",x,y,hcf);
printf("the lcm of %d and %d is %d",x,y,lcm);
return 0;
}
int gcd(int x,int y)
{
if(x==0)
{
return y;
}
while(y!=0... | ALGO | 0.999851 | 3.006425 |
adb35d44-78f6-4233-85de-8e3af1aacce5 | UCC-Programacion3-historico/ejercicios-2018-Favaro99 | U06_Hash/Ej-01/main.cpp | #include <iostream>
#include <string>
#include "../HashMap/HashMap.h"
using namespace std;
unsigned int miHashF(int clave);
int main() {
HashMap<int, string> th(13);
th.put(325, "Hola");
th.put(425, "Chau");
th.put(5, "Casa");
th.put(3, "PC");
//th.print();
std::cout << "Ejercicio 05/01... | ALGO | 0.990017 | 3.903828 |
927c02b2-f928-47fa-982a-b23f070af1b3 | disillusion028/MyLeetCode | LintCode/172_remove-element/remove-element.cpp | /*
@Copyright:LintCode
@Author: disillusion028
@Problem: http://www.lintcode.com/problem/remove-element
@Language: C++
@Datetime: 16-11-24 03:07
*/
class Solution {
public:
/**
*@param A: A list of integers
*@param elem: An integer
*@return: The new length after remove
*/
int removeElem... | ALGO | 0.995545 | 5.84903 |
4fa6e91e-b853-432c-8853-6e7605d6c7fd | LoiNguyennn/CompetitiveProgramming4_Solutions | Kattis_OJ/cd.cpp | #include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define INP() freopen("input.txt", "r", stdin)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int main() {
// ios::sync_with_stdio(false);
// cin.tie(0);
int n, m;
cin >> n >> m;
while (n && m) {
... | ALGO | 0.999739 | 3.537966 |
65427333-ce04-4b2c-b4ab-ae63b3b37b2b | Joelhhh/OJ | 2.cpp | <<<<<<< HEAD
change2
=======
change1
>>>>>>> 计算器2
123213
123123
#include<iostream>3213
#include<fstream>
using namespace std;
struct num
{
int n[1000];
int top;
};
struct sym
{
char s[1000];
int top;
};
int pri[5][7]=
{
1,1,3,3,3,1,1,
1,1,3,3,3,1,1,
1,1,1,1,3,1,1,
1,1,1,1,3,1,1,
3,3,3,3,3,2,1,
};
int judg... | ALGO | 0.999986 | 3.467704 |
42bfb457-5fb2-4614-acd7-b3d45ee997a2 | Acephoeni-X/Data-Structures-And-Algorithms | Linked Lists/Circular Linked List/delete_head.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
Node* next;
Node(int x){
data = x;
next = NULL;
}
};
Node* delHead(Node* head){
if(head == NULL) return NULL;
if(head->next == head){
delete head;
return NULL;
}
Node* p = head;
do{
p = p->next;
}while(p->next!=head);
Node* temp = hea... | ALGO | 0.999444 | 4.231283 |
4d9e6d8a-8fcd-4bb8-834c-e80e0dff5221 | kamilix2003/MAPT | mapt1/lab9/ex11.cpp | #include<iostream>
float thebiggestfloat(float f1, float f2, float f3)
{
if(f1 >= f2 && f1 >=f3)
return f1;
if(f2 >= f1 && f2 >=f3)
return f2;
return f3;
}
int main()
{
float f[3][3] = {
{1.0, 3.3, 0.3},
{0.2, 9.99, 0.0},
{123.11, 231.0, 0.9999}
};
for(i... | ALGO | 0.999461 | 3.683041 |
608ed94a-5f20-48a1-97ce-db90e70e24f1 | SongmiLim/Algorithm | 프로그래머스/1/12940. 최대공약수와 최소공배수/최대공약수와 최소공배수.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(int n, int m) {
vector<int> answer;
int max_n = max(n, m);
int min_n = min(n, m);
int i = max_n;
int j = 1;
int gcd = 0;
int lcm = 0;
while (true) {
if (n % i == 0 && m % i == 0) {
gcd =... | ALGO | 0.999927 | 5.721132 |
d1205937-9a72-465b-9ab6-02462e37577b | vaporbird/iy_SimpleSim-working | sniper/sniper-7.4/library/boost_1_66_0/libs/numeric/ublas/doc/samples/matrix_row_project.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
for (unsigned i = 0; i < m.size1 (); ++ i) {
for (unsigned j = 0; j < m.size2 (); ++ j)
... | ALGO | 0.96627 | 3.216831 |
f1459cbd-b739-4452-a8ec-33309e7cc2eb | FrancoisDupayrat/echOpen_cocos2d-x_app | cocos2d/extensions/Particle3D/PU/CCPUParticleFollower.cpp | #include "CCPUParticleFollower.h"
#include "extensions/Particle3D/PU/CCPUParticleSystem3D.h"
NS_CC_BEGIN
// Constants
const float PUParticleFollower::DEFAULT_MAX_DISTANCE = 3.40282e+038f;
const float PUParticleFollower::DEFAULT_MIN_DISTANCE = 10.0f;
//-----------------------------------------------------------------... | TOOL | 0.92545 | 6.547683 |
82d382a6-f2c7-4074-920a-f1879dc81b1d | ms303956362/myexercise | Cpp/LeetCode/wc273_4.cpp | #include "usual.h"
class Solution {
public:
vector<int> recoverArray(vector<int>& nums) {
sort(nums.begin(), nums.end());
int n = nums.size();
vector<int> ans;
auto check = [&](int k)
{
unordered_map<int, int> cnt;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999988 | 5.300464 |
6471a107-851c-4ede-83f9-425f7e0fd3a6 | SGGODE/lettcode-solved | 3110-score-of-a-string/3110-score-of-a-string.cpp | class Solution {
public:
int scoreOfString(string s) {
int result = 0;
for(int i=1;i<s.size();i++){
result+=abs(int(s[i])-int(s[i-1]));
}
return result;
}
}; | ALGO | 0.999953 | 5.536649 |
d66e43df-8f2c-4f42-b1a0-8361330d4599 | chirag-12-mmax/pr | 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.998809 | 6.763549 |
8aa2d6d8-c694-483e-a2bb-694d8a4986ac | suhwan22/algorithm | Baekjoon/0x09_BackTracking/1759/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool consonant[15] = {};
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
cin >> n >> m;
char input;
vector<char> str;
vector<int> seq;
for (int i = 0; i < m; i++)
{
cin >> input;
str.push_back(input... | ALGO | 0.999951 | 4.09344 |
0b4750ba-2aea-4ac4-a56d-63e52cfade35 | aiubian-edge/Codechef---Problem-Solving | Volume 04/CHESSDIST.cpp | /******************************************************************************
Chessboard Distance
Problem
The Chessboard Distance for any two points (X_1, Y_1)(X
1
,Y
1
) and (X_2, Y_2)(X
2
,Y
2
) on a Cartesian plane is defined as max(|X_1 - X_2|, |Y_1 - Y_2|)max(∣X
1
−X
2
∣,∣Y
1
−Y
2
∣).
Y... | ALGO | 0.999812 | 4.894581 |
71a16e5a-f380-4803-a15a-2fb2bc15bb20 | newtron-vania/Algorithm | 프로그래머스/2/12941. 최솟값 만들기/최솟값 만들기.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> A, vector<int> B)
{
int answer = 0;
sort(A.begin(), A.end());
sort(B.rbegin(), B.rend());
for(int i = 0; i < A.size(); i++)
{
answer += A[i] * B[i];
}
return answer;
} | ALGO | 0.999958 | 4.824995 |
d8aa59fd-475a-4bc1-90b9-31ecedfdbb0f | KianWeng/NUC972_Buildroot | source/NUC970_Custom_Application/qt-everywhere-opensource-src-4.8.5/src/corelib/concurrent/qtconcurrentfilter.cpp | /*!
\headerfile <QtConcurrentFilter>
\title Concurrent Filter and Filter-Reduce
\ingroup thread
\brief The <QtConcurrentFilter> header provides concurrent Filter and
Filter-Reduce.
These functions are a part of the \l {Concurrent Programming}{Qt Concurrent} framework.
The QtConcurrent::fi... | TOOL | 0.910612 | 7.42262 |
532e41b9-f90c-4fbb-be1d-b28a579c3eee | eggag32/Competitive-Programming | COCI/nadan.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i... | ALGO | 0.999941 | 3.128688 |
91d55d76-6730-4ad1-b40f-d0a92edbaa76 | EricaMeredith/ghFHE | FHE_demo/src/engine/rand.cpp | #include <cstdlib>
#include <ctime>
#include "system.h"
#include "rand.h"
#include <sstream>
#include <iostream>
void Rand::Init()
{
srand(static_cast<uint32_t>(time(nullptr)));
}
int32_t Rand::Get(int32_t min, int32_t max)
{
if (max)
{
if (min > max) std::swap(min, max);
return min + Ge... | TOOL | 0.952115 | 4.285196 |
ccb4e5f2-9d10-410c-a3a3-9981f5f4ecc7 | Stektpotet/IMT2021-Algmet-Lib | Sort.cpp | #include "sort.hpp"
void Sorting::selection(ItemType * arr, const u32 arrLen)
{
if (arrLen <= 1) return;
//move over the array, every item at index < i is sorted
for (u32 i = 0; i < arrLen-1; i++)
{
u32 min = i;
for (u32 j = i+1; j < arrLen; j++)//look for a minimum value in all coming items
{
if(lessThan... | ALGO | 0.99898 | 4.95945 |
11e5bca6-522f-4ea3-9a9a-b7bb3e3a96f0 | Zainabad27/PRACTICING_DSA | maths_dsa.cpp | #include <iostream>
#include <vector>
using namespace std;
bool is_prime(int n)
{
for (int i = 2; i * i < n; i++)
{
if (n % i == 0)
{
return false;
}
}
return true;
}
void num_of_primes(int n)
{
vector<bool> primes(n, true);
for (int i = 2; i < primes.size();... | ALGO | 0.999857 | 4.544415 |
cd3011e1-0495-44b3-907b-b1c6d009dcc1 | tursodatabase/examples | flutter_todo_list/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.998082 | 6.762122 |
091f811c-64a5-4d2d-8232-caf84376dab7 | Arewa100/flutter | picture_app/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998653 | 6.76775 |
57cfcbb8-2aee-45f5-a1d9-867222c6ea25 | AdaCompNUS/summit | Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/GraphParser.cpp | #include "Carla.h"
#include "GraphParser.h"
#include "DoublyConnectedEdgeList.h"
#include <type_traits>
#include <unordered_set>
namespace MapGen {
using Graph = DoublyConnectedEdgeList;
// ===========================================================================
// -- Local static methods ----------------... | ALGO | 0.984537 | 7.339506 |
9a486f14-1c9f-4d38-a01b-f29956e151d3 | TIPatle/Practice | DSA/striverDP/dp_21.cpp | #include <bits/stdc++.h>
#define N 1e7
#define M 1e5
#define vi vector<int>
#define vii vector<vector<int>>
#define vpii vector<pair<int, int>>
#define pii pair<int, int>
#define rep(i, a, b) for(int i = a; i<b; i++)
#define decrep(i, a, b) for ( int i = a; i>=b; i--)
#define repit(it, s) for ( auto it : s)
using n... | ALGO | 0.999656 | 4.355362 |
81e91e92-1f76-420a-adc6-57d5a72070f5 | Zhenghao-Liu/LeetCode_problem-and-solution | 0738.单调递增的数字/solution_greedy.cpp | //找到第一个不是递增的地方,然后找最右边可以减1的地方,后面全部补9
class Solution {
public:
int monotoneIncreasingDigits(int N) {
string num=to_string(N);
int num_size=num.size();
string ans;
ans+=num.at(0);
int ans_length=1;
for (int i=1;i<num_size;++i)
{
if (num.at(i)>=ans.at(... | ALGO | 0.999991 | 6.159974 |
65ebc80f-6398-4a12-8a77-4d2f0fd36b84 | MunSeoHee/baekjoon | algorithm/algorithm/5546.cpp | #include<iostream>
#include <string>
using namespace std;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(NULL);
int a[101] = { 0, }, dp[101][4][4] = { 0, };
int N, K;
cin >> N >> K;
while (K--) {
int t1, t2;
cin >> t1 >> t2;
a[t1] = t2;
}
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 3;... | ALGO | 0.999976 | 4.128446 |
274a169c-4abf-4e5b-bd14-ac7b4be001b6 | BC46/kattis-solutions | src/runningmom.cpp | #include <iostream>
#include <unordered_set>
#include <unordered_map>
using namespace std;
unordered_map<string, unordered_set<string>> flights;
bool findVisitedFlights(unordered_set<string> &visited, const std::string &origin) {
auto it = flights.find(origin);
if (it == flights.end())
return false;... | ALGO | 0.999462 | 5.255793 |
931ddee7-40e5-48bb-9e24-de820d8371cd | sinian666/code_102_5 | cpp_副本/chapter_array_and_linkedlist/list.cpp | /**
* File: list.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Driver Code */
int main() {
/* 初始化列表 */
vector<int> list = {1, 3, 2, 5, 4};
cout << "列表 list = ";
printVector(list);
/* 访问元素 */
int num = list[1];
cout << "访问索引 1 处的元素,得到 n... | ALGO | 0.930479 | 5.024094 |
40a44b00-1016-4300-8334-8f8bcce7bf60 | Garretming/slg_server | 3rd/sdsl-lite/tutorial/expl-02.cpp | #include <iostream>
#include <sdsl/vectors.hpp>
using namespace std;
using namespace sdsl;
int main()
{
int_vector<> v(10*(1<<20));
for (size_t i=0; i<10; ++i)
for (size_t j=0; j < 1U<<20; ++j)
v[i*(1<<20)+j] = j;
cout << size_in_mega_bytes(v) << endl;
util::bit_compress(v);
co... | ALGO | 0.911023 | 3.965535 |
c221eed6-55eb-467e-85bc-5f068497890a | ranjeetxsingh/DSA_Essentials_Code | 07. Recursion/sortedArrayCheck.cpp | #include<iostream>
using namespace std;
bool isSorted(int arr[], int n){
if(n == 1 or n == 0){
return true;
}
if(arr[0]<arr[1] and isSorted(arr+1, n-1)){
return true;
}
return false;
}
bool isSortedArray(int arr[], int i, int n){
if(i == n-1 ){
return true;
}
if... | ALGO | 0.99991 | 5.109842 |
f519bc27-7fbb-4119-9a6b-e0f381232282 | joydip007x/CompetitiveCodeArchive | UVA/1213/18497598_AC_1520ms_0kB.cpp | #include<bits/stdc++.h>
using namespace std;
#define loop(i,L,U) for(long long int i=(long long int)L;i<U;i++)
#define loopeq(i,L,U) for(long long int i=(long long int)L;i<=U;i++)
#define preflag long long flag=0,i=0,j=0,k=0,l=0
#define preflag2 long double flag=0,i=0,j=0,k=0,l=... | ALGO | 0.999827 | 3.452752 |
20474e6d-2033-42b8-b7e6-28a758cc2c1d | bradbell/cppad_mixed | example/private/fix_con_eval.cpp | /*
{xrst_begin fix_con_eval.cpp dev}
constraint_eval: Example and Test
#################################
Private
*******
This example is not part of the
:ref:`cppad_mixed public API<base_class-name>` .
{xrst_literal
// BEGIN C++
// END C++
}
{xrst_end fix_con_eval.cpp}
*/
// BEGIN C++
# include <cppad/cppad.h... | TEST | 0.978676 | 7.420954 |
689f9a65-4dc9-45b3-9946-e5f13e4b7f2b | Elsa9999/LienGiaBao-monC | Chapter 03/Program Chanllenges/Challenges_22.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
double angle, sinValue, cosValue, tanValue;
// Nhập góc từ người dùng
cout << "Nhap goc (radians): ";
cin >> angle;
// Tính giá trị sin, cos, và tan
sinValue = sin(angle);
cosValue = cos(angle);
... | ALGO | 0.853229 | 5.259294 |
9c03e598-c785-49de-9b9e-e57811ac9513 | flowersayo/Algorithm | 백트래킹/15664.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, slope;
int check[9] = { false, };
int pArr[8] = { 0, };
int num[8] = { 0, };
bool repeated[9] = { false, };
void permutaion(int depth, int start) {
if (depth == slope) {
for (int i = 0; i < slope; i++) {
cout << pArr[i] << ... | ALGO | 0.99976 | 3.738712 |
1dab626a-5ff2-406a-b68d-d4fb7cd55f9e | ishandutta2007/codeforces | never_giveup/normal/1103/A.cpp | /*
.:*+=%@@@@@@=-.
.:=@#@@@#@@#######%==*.
.-=####@######%*-.....:%##%.
.*@###########%+:--........-%@-
.*@##############@+--.........-:%-
.+##################@==%%%%=+*:----+.
.-@####################%++%@@@@@=+**%@@*
.%######... | ALGO | 0.999902 | 3.34965 |
236213b0-d301-4c26-a27b-07ff6b1eee61 | JongSinister/LeetCode4Fun | Template/AlgorithmC++/bruteforce/combi_simple.cpp | #include <bits/stdc++.h>
using namespace std;
void combi(int n,vector<int> &sol, int len){
if(len == n){
for(int i=0;i<n;i++){
if (sol[i]==1){
cout<<i<<" ";
}
}
cout<<"\n";
}else{
sol[len]=0;
combi(n,sol,len+1);
sol[len]=1... | ALGO | 0.985511 | 4.448756 |
8499fac8-6042-449d-a94a-3665029c716e | hossam7amdy/competitive-programming | leetcode-hard/reducing-dishes.cpp | // https://leetcode.com/problems/reducing-dishes/
#include<bits/stdc++.h>
using namespace std;
/*
# approach: DP
*/
class Solution {
static const int MAX = 500 + 1;
int memo[MAX][MAX];
int dp(vector<int>& satisfaction, int idx, int time){
if(idx == satisfaction.size())
return 0;
... | ALGO | 0.999798 | 5.745847 |
4119d5c3-e56c-4bea-9f6f-c6737cd02aa6 | baofuhann/FISCO_BCOS_FL | deps/src/boost/libs/multi_index/perf/test_perf.cpp | #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <assert.h>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/ne... | TOOL | 0.890286 | 7.563072 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.