uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1542247b-452f-42cd-9066-2b93e5031512 | jc-sas/E-frime-frimeelrs | src/lib/FEC/hamming.cpp | /***************************************************************************
* INCLUDED FILES
***************************************************************************/
#include "hamming.h"
/***************************************************************************
* ... | ALGO | 0.999929 | 6.716431 |
7e45821e-a958-4feb-83d0-ea33537955b6 | Tamimkhan7/Hackerrank | Random/FInd the number.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
cin >> arr[i];
int k, c = 0;
cin >> k;
for (int i = 0; i < n; i++)
if (arr[i] == k)
c++;
if (c != 0)
cout << "YES" << endl;
else
... | ALGO | 0.999974 | 4.238691 |
14de6b43-7836-4ba6-9509-d9d38d6d6033 | Haseebi-khan/NumJig | Practice_Question/11SingleNumberProblem .cpp | #include <iostream>
using namespace std;
// Problem: Single Number
// Problem Description: Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.
// You must implement a solution with a linear runtime complexity and use only constant extra space.
// Example 1:
// ... | ALGO | 0.999594 | 5.899761 |
48418f9d-b543-4cc1-9797-e148942cb71d | sarcilav/investigacion-g-- | _frename_registers/sample3.cpp | /* Sergio Botero - <EMAIL>
* Title: 10004 Bicoloring - Grafos - DFS
* Submitted:Friday, October 31 2008
* OJ: UVa
*/
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <set>
#include <bitset>
#include <queue>
#include <list>
#include <deque>
#include <numeric>
#inc... | ALGO | 0.999495 | 5.048222 |
15cd1e34-d42c-44cd-be51-728429bb92bf | OmarEltobgy/AdHoc | UVA_10427_NaughtySleepyBoys.cpp | #include <stdio.h>
int get(int N)
{
int position, number, i, toReturn;
if(N <= 9)
{
return N;
}
else if(N <= 189)
{
N = N - 10;
number = 10 + N / 2;
position = N % 2;
for(i=1; i>=position; i--)
{
toReturn = number%10;
number = number/10;
}
return toReturn;
}
else if(N <= 2889)
{
N = N... | ALGO | 0.99884 | 3.454763 |
a0751717-207e-4d55-9ef7-9b7c0215a248 | chncwang/cuda_test | eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp | MatrixXd A = MatrixXd::Random(6,6);
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
EigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
complex<double> l... | ALGO | 0.999356 | 3.058228 |
29b0258c-a1b4-4ad1-bfe0-ba90601bf403 | Jimaaaaa1/Work_mmdection | deepsort/tracker.cpp | #ifdef _WIN32
#include <Windows.h>
#else
#include <sys/time.h>
#endif
#include "tracker.hpp"
#include <queue>
unsigned int now()
{
#ifdef _WIN32
return GetTickCount();
#else
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
#endif
}
int Tracker::global_id = 0;
Tr... | ALGO | 0.998154 | 5.50525 |
43111082-45af-4753-b929-df3837ee3a84 | AAS-EMB/leetcode_cpp | majority-element/169-Majority-Element.cpp | class Solution {
public:
int majorityElement(vector<int>& nums) {
unordered_map<int, int> um;
for (auto const& item : nums)
{ ++um[item]; }
for (auto const& [key, value] : um) {
if (value > nums.size() / 2) {
return key;
}
}
r... | ALGO | 0.999705 | 5.958357 |
f3b9a0e8-c00f-492b-a521-59b51c0322b5 | Keshav7891/Leetcode-Solutions | 1704-determine-if-string-halves-are-alike/1704-determine-if-string-halves-are-alike.cpp | class Solution {
public:
bool halvesAreAlike(string s) {
int count = 0;
transform(s.begin(), s.end(), s.begin(), ::tolower);
for(int i=0;i<s.size();i++)
{
char curr = s[i];
if(i<s.size()/2)
{
if(curr == 'a' || curr == 'e' || curr ==... | ALGO | 0.997054 | 6.029192 |
36ff4425-e27f-4e3d-b326-fb462530b332 | ktpstudsteak/cs124 | projects/project06/isLeapYear/isLeapYear.cpp | #include <iostream>
bool isLeapYear(int year)
{
if (year % 4 != 0)
{
return false;
}
else if (year % 100 != 0)
{
return true;
}
else if (year % 400 != 0)
{
return false;
}
else
{
return true;
}
}
int main()
{
int numDays;
... | ALGO | 0.997574 | 3.799743 |
80ccfbd2-dbd5-4281-ad5c-af6e8d01dfac | rubenkindt/MazeGenerator | maze.cpp | #include "maze.h"
Input::Input(int argc, char *argv[])
{
if (argc != 3 && argc != 4)
{
throw std::runtime_error("invalid parameter list, I need a row and col size [seed]");
}
rows = std::stoi(argv[1]);
columns = std::stoi(argv[2]);
if (rows<=0 || columns<=0){
throw std::runtim... | ALGO | 0.979734 | 5.746471 |
5a240a1d-ebeb-46a7-bf30-060fcfc01c8d | hehaodele/acm-icpc | poj/p3469.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
const int N = 20000 + 1;
const int M = 1000000;
const int INF = 1 << 30;
struct Edge {
int to, flow, capa, next;
Edge() {}
Edge(int v, int f, int c, int n): to(v), flow(f), capa(c), next(n) {}
} g[M];
int first[N], arc[N], edge_count;
int n, m, vs,... | ALGO | 0.999955 | 4.495484 |
5f14a951-7847-46e8-80a8-aae0947610dd | rajesh-1920/Competitive_Programming_Problem_Solving | Codeforces/B_World_Cup.cpp | // Author: Rajesh Biswas
// CF : rajesh-1920
// Date : 08.03.2025
#include <bits/stdc++.h>
using namespace std;
//----------------------------(definition section)-----------------------------------------
#define dbg(x) cout << #x << " = " << x << '\n'
#define int long long int
#define fi first
#define sc second... | ALGO | 0.999973 | 4.032689 |
308951f7-20a8-4294-9304-80bcd157191f | PandayMoulina/LeetCode-Solved-Questions | 0118-pascals-triangle/0118-pascals-triangle.cpp | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> ans;
for(int i = 1;i<=numRows;i++){
ans.push_back(generateRow(i));
}
return ans;
}
vector<int> generateRow(int row)
{
int ans=1;
vector<int> ansRow;
... | ALGO | 0.999992 | 5.838193 |
592f6792-b052-4f79-9ad9-d46cd2cbf4d5 | qiuwenhui/bullet3 | src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp | #include "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCompoundShape.h"
#include "BulletCollision/BroadphaseCollision/btDbvt.h"
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btAa... | ALGO | 0.999504 | 6.974378 |
76aad179-253e-4963-b384-2aa0febbff9d | ArsenyPogosov/olympiad_programs | NSUts/Задача Z.cpp | #include <fstream>
//#include <vector>
//#include <queue>
//#include <list>
//#include <map>
//#include <algorithm>
//#include <math>
//#include <string>
using namespace std;
int main()
{
ifstream fin("input.txt"); //open input file
ofstream fout("output.txt"); //open output file
long long n;
fin >> n;
fout << ... | ALGO | 0.999687 | 3.553003 |
22c1a2a2-2515-4859-81ad-2bcc710ef74a | faizzmi/C-Programming | Discrete Structure Algorithm/Code for Sorting/Code for Sorting/1_Selection_Sort.cpp | #include <stdio.h>
#define maxsize 10
void selection_sort(int [],int);
int main()
{
int i, num_elements, data[maxsize];
/*Read in a value for number of elements */
printf("\nEnter list size: ");
scanf("%d",&num_elements);
/*Read in the list of number */
for(i=0; i<num_elements; i++)
{
printf("\nEnter num... | ALGO | 0.999672 | 4.118072 |
5934bedb-0cad-418a-be44-8431d182e1c4 | yadavsahil28/Linked-List | Intersection of Two Linked Lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
if(headA == NULL || headB == NULL) return NULL;
u... | ALGO | 0.999499 | 5.407731 |
c40522d4-cb18-48a3-9e70-30f9377dec03 | 123pk/CP-daily-problem-solving | Day73/8. String to Integer (atoi).cpp | /*
Platform :- Leetcode
Approach :- Using stringstream builtin library of c++
*/
class Solution {
public:
int myAtoi(string s) {
stringstream sam(s);
int x=0;
sam>>x;
return x;
}
};
| ALGO | 0.992957 | 5.383912 |
6dac5ce8-0319-485f-bd30-555f10dba3fb | HotPotatoC/cpp | lambdas/main.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
auto to_upper(std::string& str) {
auto f = [](unsigned char ch) -> unsigned char { return std::toupper(ch); };
std::transform(str.begin(), str.end(), str.begin(), f);
}
auto to_lower(std::string& str) {
auto f = [](unsigned char ... | ALGO | 0.862158 | 6.380927 |
4f522e18-155a-4081-8ed5-c5357ce1cdcc | biribas/cses | dynamic-programming/dice-combinations.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define MOD 1000000007
int main(void) {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int> dp(n + 1);
dp[0] = 1;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= 6 && j <= i; j++) {
dp[i]... | ALGO | 0.999963 | 4.962535 |
0d69bbf4-42aa-488c-b410-a285df9c9939 | yaswini2004/LeetCodeDailyProblemSolutions | 2794-maximum-number-of-moves-in-a-grid/2794-maximum-number-of-moves-in-a-grid.cpp | class Solution {
public:
int maxMoves(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
vector<int> prev(m, 0);
int res = 0, aliveCount = m;
for (int j = 1; j < n && aliveCount > 0; j++) {
vector<int> curr(m, -1); // -1 as cell unreachable
... | ALGO | 0.999999 | 6.182067 |
f0125829-e279-407c-b025-e3b8460ff0de | Doveqise/Cloud | Codes/C++/2955.cpp | #include<cstdio>
#include<cstring>
using namespace std;
char num[100];
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%s",num);
if(num[strlen(num)-1]=='1'||num[strlen(num)-1]=='3'||num[strlen(num)-1]=='5'||num[strlen(num)-1]=='7'||num[strlen(num)-1]=='9') printf("odd\n");
else printf("even\n")... | ALGO | 0.999709 | 3.774149 |
a22c3647-215f-463e-b505-ce0bcb627e86 | FutureYL3/algorithm_learning | syntax_basic/Lec06/808.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
using namespace std;
int gcd(const int x, const int y) {
int small = min(x, y) + 1;
while (small--) {
if (x % small == 0 && y % small == 0) break;
}
return small;
}
int main() {
int x, y; cin >> x... | ALGO | 0.999807 | 4.967916 |
d5e308f3-c647-4ea5-aaf5-706a0fbed0c3 | rndudals/Algorithm_PS | 백준/10815_숫자카드 v1.cpp | #include <iostream>
#include <map>
using namespace std;
int N, M, x;
int dp[101][10];
map<int, int> m;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin >> N;
for (int i = 0; i < N; i++) {
cin >> x;
m[x] = 1;
}
cin >> M;
for (int i = 0; i < M; i++) {
cin >> x;
if (m[x] ==... | ALGO | 0.999985 | 3.766769 |
e523c0b6-5826-4f11-bdbe-79760c5e93f4 | behnejad/Online-Judge-Solutions | TJU/2952 - TROJKE.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
int N,cont1,cont2;
int pos[26][2];
string s;
cin>>N;
cont1=0;
for(int i=0;i<N;i++){
cin>>s;
for(int j=0;j<N;j++)
if(s[j]!='.'){
pos[cont1][0]=i;
... | ALGO | 0.999278 | 3.282082 |
b0046892-4d7b-4680-8d02-e81e6a5ca7ea | Nauh24/thcs2-codeptit | thuchanh1/SapXepNoiBot.cpp | #include <stdio.h>
#include <stdbool.h>
void bubbleSort(int a[], int n){
int t = 1;
int ok;
for(int i = 0; i < n-1; i++){
ok = false;
for(int j = 0; j < n-1-i; j++){
if(a[j] > a[j+1]){
int tmp=a[j+1];
a[j+1]=a[i];
a[i]=tmp;
ok = true;
}
}
if(ok == false)
break;
printf("Buoc %d: ", ... | ALGO | 0.999945 | 4.233647 |
173e6373-cf07-4c9d-9bf4-345faf5cfa1a | asherushare/DSA-with-Codehelp | 2_Array/13_transpose.cpp | #include <bits/stdc++.h>
using namespace std;
void transposeMatrix(int arr[][3], int rows, int cols)
{
int ans[1000][1000] = {0};
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
ans[j][i] = arr[i][j];
}
}
for (int i = 0; i < cols; i++)
{ // Note: should be cols here
... | ALGO | 0.999786 | 3.685501 |
2436fe2b-7b30-4c82-acf6-1ec50b4ff331 | CGAL/cgal | Shape_regularization/benchmark/Shape_regularization/benchmark_qp_segments.cpp | #include <CGAL/Random.h>
#include <CGAL/Real_timer.h>
#include <CGAL/function_objects.h>
#include <CGAL/point_generators_2.h>
#include <CGAL/Join_input_iterator.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Shape_regularization.h>
// #include "../../test/Shape_regularization/include... | ALGO | 0.965772 | 7.175776 |
3d1c0274-436b-4e6d-9000-4bb4debf00cd | gage-black/Graphics | Graphics/ppc.cpp |
#include "ppc.h"
#include "matrix.h"
#include "framebuffer.h"
PPC::PPC(float hfov, int _w, int _h) : w(_w), h(_h) {
C = vector(0.0f, 0.0f, 0.0f);
a = vector(1.0f, 0.0f, 0.0f);
b = vector(0.0f, -1.0f, 0.0f);
float alpha = hfov / 2.0f * 3.1415926f / 180.0f;
c = vector(-(float)w / 2.0f, (float)h / 2.0f, -(flo... | ALGO | 0.991124 | 5.455135 |
3f679aa8-e358-4f9f-9789-95e383abaa09 | Spencer-Huang2019/dynamic_env_planning | src/ompl/tests/geometric/constraint/test_sphere.cpp | /* Author: Zachary Kingston */
#define BOOST_TEST_MODULE "ConstrainedPlanning"
#include <boost/test/unit_test.hpp>
#include <fstream>
#include <ompl/base/Constraint.h>
#include <ompl/base/ConstrainedSpaceInformation.h>
#include <ompl/base/spaces/constraint/ConstrainedStateSpace.h>
#include <ompl/base/spaces/constrai... | TEST | 0.977737 | 6.900167 |
23eab093-9936-47fb-932a-08f7f5d4f1d2 | alexandraback/datacollection | solutions_5634947029139456_1/C++/zein/solution.cpp | // Google Jam.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include... | ALGO | 0.999947 | 4.354762 |
52523a8e-8b63-47e9-be6e-07cb1dcf817e | AmanKathait15/Data-Structure-and-Algorithm | arr/piviot_element.cpp | #include <bits/stdc++.h>
using namespace std;
#define num int
num piviot(num a[], num n)
{
num lmax[n],rmin[n]; lmax[0]=a[0]; rmin[n-1]=a[n-1];
for(num i=1; i<n; i++)
lmax[i] = max(lmax[i-1],a[i]);
for(num i=n-2; i>=0; i--)
rmin[i] = min(rmin[i+1],a[i]);
//for(num i=0; i<n; i++) cout<<lmax[i]<<" "; cout<<"\... | ALGO | 0.999947 | 5.299482 |
4f513943-41b2-4942-b2a1-eedc838e3689 | isbraz/cpp-42 | cpp6/list.cpp | #include <iostream>
#include <string>
class Node{
public:
int data;
Node *next;
Node(int data) {
this->data = data;
this->next = nullptr;
}
void addBack(int nextData);
};
void Node::addBack(int nextData){
Node *_next = new Node(nextData);
if (this->next == nullptr) {
thi... | ALGO | 0.999632 | 5.472303 |
5f865bb6-3cb9-4c49-9f19-079c89404c11 | SkyrimCode/Graph-Algorithms | DFS/Bipartite.cpp | /*Bipartite Graph - Graph that can be colored with 2 colors provided no 2 adjacent nodes have same color / If graph doesn't have odd length cycle it is bipartite.
Logic: Keep coloring adjacent uncolored node opposite of current node color. If adjacent node is colored and same as current node, graph is not bipartite.
*... | ALGO | 0.999973 | 5.629496 |
e13849e1-64d0-4a01-90c6-55640246131a | Morsiusiurandum/LeetCode | leetcode/editor/en/[486]Predict the Winner.cpp | //You are given an integer array nums. Two players are playing a game with this
//array: player 1 and player 2.
//
// Player 1 and player 2 take turns, with player 1 starting first. Both players
//start the game with a score of 0. At each turn, the player takes one of the
//numbers from either end of the array (i.e... | ALGO | 0.999993 | 5.639062 |
82cf2235-ea68-4cd7-8262-3e453868c401 | spsingh37/DROID_SAM2 | thirdparty/DROID-SLAM/thirdparty/lietorch/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
std::cout << "Row's maximum: " << std::endl
<< mat.rowwise().maxCoeff() << std::endl;
}
| ALGO | 0.999578 | 3.881484 |
03d64579-4524-45b6-83be-83c916509578 | Vito-bo/- | 基础算法1.cpp |
#if 0
// 㷨
#include <iostream>
using namespace std;
const int N = 100010;
int n, m, k;
int q[N];
int main()
{
cin >> n >> m;
for (int i = 0; i<n; i++)
cin >> q[i];
while (m--)
{
cin >> k;
int l = 0, r = n - 1;
// [l,r]Ϊ[l,mid][mid+1,r]ʱʹ
while (l<r)
{
int mid = l + r >> 1;
if (q[mid] >= k)... | ALGO | 0.999987 | 3.923162 |
0b202775-e0ca-4a5a-87c7-cdce13d586cc | CQ-yangxh/leetcode | dominantIndex_747/747.cpp | #include <vector>
using namespace std;
#include <map>
class Solution {
public:
int dominantIndex(vector<int>& nums) {
map<int, int, greater<int>> map;
for(int i = 0; i < nums.size(); i++){
int key = nums[i];
map[key] = i;
}
int max = map.begin()->first;
... | ALGO | 0.999938 | 5.754399 |
b5598434-1638-4b90-8853-15108df15407 | wzx54321/AndroidLearnTips | java-leetcode/code/triangle.cpp | // Triangle
// 时间复杂度O(n^2),空间复杂度O(1)
class Solution {
public:
int minimumTotal (vector<vector<int>>& triangle) {
for (int i = triangle.size() - 2; i >= 0; --i)
for (int j = 0; j < i + 1; ++j)
triangle[i][j] += min(triangle[i + 1][j],
triangle[i + 1][j + 1]... | ALGO | 0.999972 | 6.168021 |
3ee4a78e-b619-4e72-aa65-8f4bb31b49d1 | NicholasFan235/Google-Kickstart | 2020/Round E/High Buildings/Solution.cpp | #include <bits/stdc++.h>
//#include "CheckSolution.h"
int T, A, B, C, N;
std::vector<int> result;
void addInc(int n){
for (int i = 0; i < n; i++){
result.push_back(i+2);
}
}
void addMax(int n){
for (int i = 0; i < n; i++){
result.push_back(N);
}
}
void addDec(int n){
for (int i =... | ALGO | 0.999518 | 4.632359 |
62a8a18b-59ce-456c-810d-ec0b9d95c114 | iwiwi/programming-contests | zoj/331/I.cpp | #include <stdio.h>
long long powmod(long long a,long long b,long long m){
if(b==0)return 1;
if(b%2==1)return (powmod(a,b-1,m)*a)%m;
long long c=powmod(a,b/2,m);
return (c*c)%m;
}
long long binom(long long a,long long b,long long p){ //a,b<p
long long ret=1;
for(long long i=0;i<b;i++){
ret=(ret*(a-i))%... | ALGO | 0.999968 | 3.960983 |
64e6ab29-f587-485d-98d6-12814786c3db | HanYouyang/Computer | 数据结构与算法/PKU-CS/Leetcode/LeetCode-master 3/C++/is-subsequence.cpp | // Time: O(n)
// Space: O(1)
// Greedy solution.
class Solution {
public:
bool isSubsequence(string s, string t) {
if (s.empty()) {
return true;
}
int i = 0;
for (const auto& c : t) {
if (c == s[i]) {
++i;
}
if (i ==... | ALGO | 0.999932 | 6.96768 |
6ad81647-7a31-4be2-af1c-12faee0fb152 | JiayeJerryWang/CUDA-CNN-Optimization-on-GPU | CUDA CNN Optimization/project/third_party/eigen/doc/examples/make_circulant2.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
// [circulant_func]
template<class ArgType>
class circulant_functor {
const ArgType &m_vec;
public:
circulant_functor(const ArgType& arg) : m_vec(arg) {}
const typename ArgType::Scalar& operator() (Index row, Index col) const {
Index index = ... | ALGO | 0.999686 | 5.538595 |
d8c531d0-5aa5-48a8-be48-ab7c5bbba806 | etnk125/POSN-second-camp | Day9/901_2.cpp | #include<iostream>
#include<vector>
using namespace std;
main()
{
int n,a,count=0,index=0;
vector<int> all;
cin>>n;
while(n--)
{
cin>>a;
all.push_back(a);
}
if(n==1)cout<<-1;
else
{
while(1)
{
if(all.size()==2)
{
if(all.front()!=all.back())
{
count++;
}
break;
}
e... | ALGO | 0.999734 | 3.645613 |
15ac515b-7e0f-4f34-b788-c86254e7a87a | QuinnAho/SchoolProjects | CSC1100/LAB/Aho_CSC1100_Lab9/Aho_CSC1100_Lab9.cpp | /**
Quinn Aho
CSC 1100
Lab 9
*/
#include <iostream>
#include <fstream>
using namespace std;
int main() {
// Open the input file FIRST.TXT
ifstream inputFile("FIRST.TXT");
// Open the output file SECOND.TXT
ofstream outputFile("SECOND.TXT");
string word;
bool firstWord = true;
while... | TOOL | 0.916171 | 5.912734 |
46f791de-52f1-42ab-8e7f-82dd6a80cbe6 | TKJ-Kasih-Ananda/X-TKJ-2023-2024 | Rafael-Adliyansyah/Rafael_peluncuranRoket.cpp | #include <iostream>
using namespace std;
int main() {
// Deklarasi
int i;
// Algoritma
for (i = 60; i >= 0; i--) {
cout << i << endl;
}
// Roket meluncur pada hitungan 0
cout << "Roket meluncur pada hitungan 0!" << endl;
return 0;
} | ALGO | 0.989573 | 5.289575 |
b8ea106f-7f26-4c73-8e32-a8744c1c3825 | dotAlgorithm/study | 알고리즘기법/solution/14891-김지환.cpp | // acmicpc 14891
// authored by jihwankim
// study
// 23-10-10 PM 03:58
#include <bits/stdc++.h>
using namespace std;
deque<bool> arr[4];
vector<pair<int, int>> rotates;
int n;
void input() {
// 1 0
for(int i = 0; i < 4; i++) {
string s;
cin >> s;
for(char &c : s) {
if(c == '0') arr[i].push_back(false... | ALGO | 0.999974 | 4.467225 |
7c005fba-e892-4f5c-bb0d-8e0ee79dab64 | cosmicray001/academic | cse419/UVA/10394/11413936_AC_140ms_0kB.cpp | #include <bits/stdc++.h>
#define le 20000110
using namespace std;
bool n[le];
int m[le];
void se(){
memset(n, 0, le);
for(int i = 4; i < le; i += 2) n[i] = 1;
int rt = sqrt(le);
for(int i = 3; i <= rt; i += 2){
if(!n[i]){
for(int j = i * i; j < le; j += i){
n[j] = 1;
}
}
}
}
voi... | ALGO | 0.9977 | 3.570197 |
35c191bf-15c5-48c0-ac95-393e71e5bdf7 | nakamo326/atCoder | ABC/235/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
int main() {
int i;
cin >> i;
ll a, b, c;
c = i % 10;
i /= 10;
b = i % 10;
i /= 10;
a = i;
ll ret =
(a * 100 + b * 10 + c) + (b * 100 + c * 10 + a) + (c * 100 + a * 10 + b);
st... | ALGO | 0.999459 | 3.617987 |
6950fc27-d3ce-4a50-b36b-fb72ef922569 | kensey-yuyu/AtCoder | APG4b/ex16.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> data(5);
for (int i = 0; i < 5; i++)
{
cin >> data.at(i);
}
for (int i = 0; i < 5 - 1; i++)
{
if (data.at(i) == data.at(i + 1))
{
cout << "YES" << endl;
return 0;
}
... | ALGO | 0.999964 | 3.883202 |
670c4d74-3c4e-447b-aa16-943eb492d57e | divanimodena/Lab-5-AP | Pertemuan4_perulangan/Tugas/no 6.cpp | #include <iostream>
using namespace std;
int sumOfEvenSquares(int n) {
int sum = 0;
for (int i = 2; i <= n; i += 2) {
sum += i * i;
}
return sum;
}
int main() {
int n1, n2;
cin >> n1 >> n2;
cout << sumOfEvenSquares(n1) << endl;
cout << sumOfEvenSquares(n2) << endl;
retur... | ALGO | 0.999615 | 5.251191 |
ec13405b-1b34-4efd-ac40-38a5a5625615 | WashizuRyo/Competitive-programming | ABS/abc337/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using P = pair<int, int>;
int main() {
string s, ns = "";
cin >> s;
int i = 0;
while (i < s.size() && s[i] == 'A')
i++;
while (i < s.size() && s[i] == 'B')
i++;
while (i < s.size() && s[i] == 'C')
i++;... | ALGO | 0.999949 | 3.83846 |
a540cb6f-8bdf-441d-a63d-ec7727624d67 | ZeroWalker10/Exposing-Congestion-Attack-on-Emerging-Connected-Vehicle-based-Traffic-Signal-Control | sumo-1.10.0/src/netbuild/NBNetBuilder.cpp | /****************************************************************************/
/****************************************************************************/
/// @file NBNetBuilder.cpp
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @author Thimor Bohn
/// @author Sascha Krieg
/// @author Michael Be... | TOOL | 0.979824 | 6.757614 |
9fa38ae4-61b7-40fa-b700-f3f5eb43b345 | qaz5216/algorithm-study | baekjoon/1647-3.cpp | #include <iostream>
#include <queue>
using namespace std;
int p[100001];
priority_queue<
pair<int,pair<int,int>>,
vector<pair<int,pair<int,int>>>,
greater<pair<int,pair<int,int>>>
>pq;
int mxcost;
int answer=0;
int find(int x){
if(x==p[x])return x;
return p[x]=find(p[x]);
}
void myunion(int a, int b){
if(... | ALGO | 0.999924 | 4.53451 |
0f4d8046-3538-4f76-bb42-0d8fa8d99056 | ishandutta2007/codeforces | tempura0224/normal/1450/C1.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for... | ALGO | 0.999927 | 4.57396 |
c7baad83-3bfd-4560-a57a-6f2ff0663263 | mq1n/Metin2-VFS-File-System | 3rd/tbb/src/test/test_halt.cpp | #define HARNESS_DEFAULT_MIN_THREADS 4
#define HARNESS_DEFAULT_MAX_THREADS 8
#include "harness_defs.h"
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <utility>
#include "tbb/task.h"
#include "tbb/task_scheduler_init.h"
#include "tbb/tick_count.h"
#include "tbb/parallel_for.h"
#include "tbb/blocked_ran... | TEST | 0.966297 | 6.239474 |
ee3f2d95-8940-4f54-88b8-ebedb8a8ec84 | mathlover777/HackerEarth | clique.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
// \frac{r-1}{r}\cdot\frac{n^2}{2} = \left( 1-\frac{1}{r} \right) \cdot\frac{n^2}{2}.
int solve(int N,int E){
double n = N;
double e = E;
int trial = ceil( 1.0/(1.0 - (2.0*e/(n*n))));
// int maxEdge = ceil((1-1/trial)*(n*n/2));
double maxEdge = (1.0-... | ALGO | 0.999788 | 4.590373 |
2b767488-4f71-406b-8876-fdcf69d87242 | manav0117/DSA | Binart Search/find_pivot_element_sorted_array.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int arr[]={7,9,1,2,3,4,5};
int n=sizeof(arr)/sizeof(int);
int s=0;
int e=n-1;
int mid=s+(e-s)/2;
while(s<e)
{
if(arr[mid]<arr[mid-1])
{
s=mid;
}
else{
e=mid;
}
mid=s+(e-s)/2;
}
cout<<s<<endl;
} | ALGO | 0.999943 | 4.220989 |
02ffadcf-2e90-41d2-ab2a-b8f35abbb3c7 | kursof/abramyan | boolean/bool 17/bool17.cpp | /* Дано целое положительное число.
* Проверить истинность высказывания:
* «Данное число является нечетным трехзначным».
*/
#include <iostream>
int main()
{
int a;
std::cout << "enter a\n";
std::cin >> a;
bool b = ((a > 99) && (a < 1000) && (a % 2));
std::cout << "\n" << b << "\n";
return 0;
} | ALGO | 0.980706 | 3.633828 |
261608fe-deb6-44a1-9c93-fb920a5cdbfc | TheRickyZhang/CompetitiveProgramming | Codeforces/1950-1999/1990/1990C.cpp | #include <bits/stdc++.h>
using namespace std;
#define tpl_ template
#define tn_ typename
#define cx_ constexpr
#define fn function
#define f(i, to) for (int i = 0; i < (to); ++i)
#define fe(i, to) for (int i = 1; i <= (to); ++i)
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define repr(i, a, b) for (int i = (... | ALGO | 0.999902 | 3.818794 |
18214a4a-95e2-4284-ac38-815d7ab71879 | southeast02/JZOF | chap2_page71.cpp | #include <iostream>
#include <queue>
using namespace std;
class Stack2{
public:
void push(char ch){
if(!queue1.empty() || queue2.empty()){
queue1.push(ch);
} else {
queue2.push(ch);
}
}
char pop(){
char value;
int size;
if(queue1.empty() && queue2.empty()){
cout << "empty stack, wrong operat... | ALGO | 0.996415 | 3.996717 |
b3872f43-1304-4842-9d3c-45ad62b409e8 | Serendipity565/CodeBackup | Codeforces/Codeforces Round 938 (Div. 3)/B.cpp | #include<bits/stdc++.h>
using namespace std;
int a[300005]={0};
int k[300005]={0};
void solve()
{
memset(a,0,sizeof(a));
memset(k,0,sizeof(k));
int n,c,d;
cin>>n>>c>>d;
bool flag=true;
long long temp;
for (int i=0;i<n*n;i++)
{
cin>>a[i];
}
sort(a,a+n*n);
for (int i=0;... | ALGO | 0.999744 | 3.613562 |
31d62a2b-c7f0-4ac8-bd4f-f1c7e2ad5a8e | SonuKumarYadav9977/Programmings | C++/Recursions/1ToN.cpp | #include<iostream>
using namespace std;
int num(int n){
if(n==0) return 0;//base case
num(n-1);//recuesion
cout<<n<<endl;//work
return 0;
}
int main(){
int n;
cout<<"enter n: ";
cin>>n;
num(n);
} | ALGO | 0.99958 | 4.008758 |
f063f9dd-52ac-4d8c-b12e-d11bb0e2c1f5 | NilFoundation/zkllvm-circifier | libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
// class Proj = identity>
// requires sortable<I, Comp, Proj>
// constexpr I
// ranges::pop_heap(I first, S last, Comp comp = {}, Proj proj = {}); ... | TEST | 0.995961 | 7.371265 |
eae8b8b5-3053-47da-a9d1-6c5c9926297e | kpeel5839/LeetCode | 0260-single-number-iii/0260-single-number-iii.cpp | class Solution {
public:
typedef long long ll;
vector<int> singleNumber(vector<int>& nums) {
int n=nums.size();
ll res=0;
for(int i=0;i<n;i++){
res^=nums[i];
}
ll lowestBit=res&-res;
vector<ll>result(2);
for(int i=0;i<n;i++){
if((lo... | ALGO | 0.999994 | 5.11308 |
4534c2fa-4184-4727-b5cc-048a3be25920 | Torivlu/Linguagem-C | exercicio 11 - lista 3.cpp | #include <stdio.h>
int menorNumero(int num1, int num2, int num3) {
int menor = num1;
if (num2 < menor) {
menor = num2;
}
if (num3 < menor) {
menor = num3;
}
return menor;
}
int main() {
int numero1, numero2, numero3;
printf("Digite o primeiro numero: ");
scanf("%... | ALGO | 0.999193 | 4.606095 |
72a5a162-4930-41d1-bd98-a7773a99d8ac | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5224_20.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 50;
int a[10], n;
char s[N];
void L() {
for (int i = 0; i < 10; i++)
if (!a[i]) {
a[i] = 1;
return;
}
}
void R() {
for (int i = 9; i >= 0; i--)
if (!a[i]) {
a[i] = 1;
return;
}
}
int main() {
scanf("%d%s", &n... | ALGO | 0.999935 | 3.047833 |
16a3fbd6-03c4-405f-b495-400bbff86e37 | Sakurai00/Contest-Code | Cpp/AtCoder/ABC/140-159/145/c.cpp | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using llint = long long;
using vint = vector<int>;
int main () {
int n; cin >> n;
vint x(n), y(n);
rep(i, n) cin >> x[i] >> y[i];
double ans = 0;... | ALGO | 0.999708 | 3.945624 |
dd4e2737-0c3a-4b39-b370-764e0cbe6c9e | ishandutta2007/codeforces | dorost/normal/1400/G.cpp | /* * In the name of GOD */
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define int long long
const int N = 301234, K = 41, M = 998244353;
int ps[K][N], fac[N];
int t[N], a[N], l[N], r[N], u[K], v[K];
bool f[N];
int tav(int x, int n) ... | ALGO | 0.999989 | 4.171708 |
4ee737f0-64f1-4bfe-8567-a64345594992 | pandya-manan/dsa_c- | stack_using_array.cpp | #include<iostream>
using namespace std;
class Stack
{
private:
int* arr;
int maxSize;
int top;
public:
Stack(int size)
{
top=-1;
maxSize=size;
arr=new int[maxSize];
}
~Stack()
{
delete[] arr;
... | ALGO | 0.870981 | 4.295939 |
fcb55054-c568-488a-b0a7-373d89f99692 | Jackfrost2639/ex | stones.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k;
int a[101];
bool dp[100001];
int main()
{
cin >> n >> k;
for(int i = 0; i < n; i++)
{
cin >> a[i];
}
//false is lose for person going next: true is win for perso going next
dp[0] = false;
for(int i = 1; i <= k; i++)
... | ALGO | 0.99999 | 5.055171 |
e96b927c-c977-4884-ab72-ebd9d7aba76d | Dipanjana12/CPP | ghatiya_rope-cuting.cpp | #include <bits/stdc++.h>
using namespace std;
int cut_rope(int length,int a, int b, int c)
{
int m=min(a,min(c,b));
if(length==0)
{
return 0;
}
//if length is divisible by min
if(length%m==0)
{
//cout<<"in2"<<endl;
return 1+cut_rope(length-m,a,b,c);
}
else
... | ALGO | 0.999944 | 3.612713 |
3d05ce3c-e449-4984-9dca-03b96c8069d7 | MoeinGhaniyoun/LLVM-SLH-RISCV | llvm/lib/Analysis/SyntheticCountsUtils.cpp | #include "llvm/Analysis/SyntheticCountsUtils.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/IR/ModuleSummaryIndex.h"
using namespace llvm;
// Given an SCC, propagate entry counts along the edge of the SCC nodes.
template <typename CallGraphType>... | TOOL | 0.953411 | 7.702081 |
33d10334-b160-410a-8204-67b2ed6661d2 | TitanHZZ/hp-omen-OpenRGB | dependencies/hueplusplus-1.0.0/src/UPnP.cpp | #include "hueplusplus/UPnP.h"
#include <algorithm>
#include <iostream>
#include "hueplusplus/LibConfig.h"
namespace hueplusplus
{
std::vector<std::pair<std::string, std::string>> UPnP::getDevices(std::shared_ptr<const IHttpHandler> handler)
{
// send UPnP M-Search request
std::vector<std::string> foundDevice... | WEB | 0.958114 | 4.528354 |
26002266-2650-493a-b86b-282a1e9942a1 | fujitsu/compiler-test-suite | C++/0000/0000_0028.cpp | #include <iostream>
#include <vector>
using namespace std;
#define N 50
#define N2 30
#define Answer 435
#define ELEMENT_TYPE long long int
void func1(vector<ELEMENT_TYPE> *vec1, vector<ELEMENT_TYPE> *vec2) {
(*vec1).swap(*vec2);
}
struct S {
bool action();
};
bool S::action() {
bool flg = false;
ELEMENT_TY... | ALGO | 0.999079 | 3.337734 |
0806dc09-fe49-4499-9337-ac6f368acb0b | zzaekkii/BOj | 11060.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
int A[1001];
int dp[1001];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> N;
for(int i=1;i<=N;i++)
cin >> A[i];
fill(dp,dp+1001,1111);
dp[0]=dp[1]=0;
for(int i=1;i<N;i++)
for(int j=1;j<=A[i];j++){
if(i+j>N)break;
dp[i+j]... | ALGO | 0.9999 | 3.660525 |
bb1a1292-a326-4d71-bc21-ff7721c4dbc2 | techpg22/aether-sx2 | pcsx2/x86/iFPUd.cpp | #include "PrecompiledHeader.h"
#include "Common.h"
#include "R5900OpcodeTables.h"
#include "common/emitter/x86emitter.h"
#include "iR5900.h"
#include "iFPU.h"
/* This is a version of the FPU that emulates an exponent of 0xff and overflow/underflow flags */
/* Can be made faster by not converting stuff back and forth... | TOOL | 0.889342 | 5.282595 |
9d79c41c-12fc-45b1-bd05-28bd543c3bc7 | richardwei6/Competitive-Programming | VISUAL STUDIO/CodeForces/CodeForces/StringTransformation1.cpp | /*
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <functional>
#include <cmath>
#include <limits>
#include <list>
#include <memory>
#include <stack>
#include <iterator>
#include <queue>
#include <numer... | ALGO | 0.999844 | 4.30907 |
1f8baaa4-26c4-4ac5-8ccc-7acdd287d368 | Apregot/VirtualEndoscopy | ArterialTreeBuilder/hessian_filters.cpp | #include "stdafx.h"
#include "Headers/hessian_filters.hpp"
#include "Headers/eigen.hpp"
#include "Headers/hessian2d3d.hpp"
#include <stdlib.h>
#include <omp.h>
//#include <amp.h> // заголовочный файл C++ AMP
//using namespace concurrency; // так меньше набирать кода :)
#include "tracer.h"
void FFRService_u... | ALGO | 0.999043 | 3.809525 |
965a387b-69c2-4731-80b5-9ad6a0f4a470 | suxutao/LeetcodeList | cn/405-convert-a-number-to-hexadecimal .cpp | #include "../../../stdc.h"
using namespace std;
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
public:
string toHex(int num) {
}
};
//leetcode submit region end(Prohibit modification and deletion)
int main(){
return 0;
} | ALGO | 0.997619 | 4.730628 |
52fdd989-76d9-4d9f-a4e9-f6a273d0ddc7 | dantrag/moleqcage | CGAL-4.7/demo/CGAL_ipelets/minkowski.cpp | #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/CGAL_Ipelet_base.h>
#include <CGAL/minkowski_sum_2.h>
#include <CGAL/approximated_offset_2.h>
#include <CGAL/offset_polygon_2.h>
namespace CGAL_minkowski{
typedef CGAL::Exact_predicates_exact_constructions_kernel Kerne... | ALGO | 0.991223 | 6.018339 |
c1cd4c19-b486-49c2-8be5-e1ac2093482f | Sreehari78/LeetCode | 0167-two-sum-ii-input-array-is-sorted/0167-two-sum-ii-input-array-is-sorted.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int left = 0, right = numbers.size() - 1;
while(left < right) {
int sum = numbers[left] + numbers[right];
if(sum == target)
return {left + 1, right + 1};
... | ALGO | 0.999595 | 6.626486 |
5b516afa-2a42-4082-8bee-a2aaf38bc567 | Yang890912/Leetcode | LeetCode/Medium/0898-bitwise-ors-of-subarrays/0898-bitwise-ors-of-subarrays.cpp | class Solution {
public:
int subarrayBitwiseORs(vector<int>& arr) {
unordered_set<int> res;
unordered_set<int> curr;
for (int num : arr) {
unordered_set<int> next;
next.insert(num);
for (int prev : curr) {
next.insert(prev | num);
... | ALGO | 0.999944 | 6.126927 |
3d39903f-15f1-4e8c-8df0-5d88886fa7fe | FalseF/Problem-Solving | Lightoj/1281 - New Traffic System2.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;
struct graphNode {
short ver;
short cost;
bool is_proposed;
graphNode(short v, short c, bool isp) { ver = v, cost = c, is_proposed = isp; }
};
struct node {
short ver;
int cost;
short used;
... | ALGO | 0.999867 | 4.208995 |
14752cf5-f64a-432d-b525-222f32bacca0 | ankitabadhe/DSL | De_queue.cpp | #include <iostream>
using namespace std;
struct Node {
public:
int data;
Node* next;
Node* prev;
Node() {
next = NULL;
prev = NULL;
}
};
class Deque {
public:
Node* head;
Node* tail;
Deque() {
head = NULL;
tail = NULL;
}
void insertFront(int v... | ALGO | 0.985349 | 5.726032 |
20f4432e-fdd2-4b83-897f-076d44d3fd65 | emmanuel-wilson/teensy_xinput_modifications | 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.991016 | 5.949927 |
f30d6bc5-93b5-4981-a28b-8f66e1d5412f | muskan300600/DSA | Sorting/10.count xors.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int a[] = {1, 3, 4, 1, 4};
int n = sizeof(a)/sizeof(a[0]);
sort(a,a+n);
int count=1,res=0;
for(int i=1;i<n;i++){
if(a[i]==a[i-1]) count++;
if(a[i]!=a[i-1] || i==n-1){
res = res+(... | ALGO | 0.999862 | 4.550217 |
8b8ded59-94be-4d24-9429-c02d72702749 | MH-Fahim11/XPSC-Batch-04 | Week-16/PracticeProblems/A_Xorry_1.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int t;
cin >> t;
while (t > 0) {
int x;
cin >> x;
int nearest_power_of_2 = pow(2, static_cast<int>(log2(x)));
int a = x - nearest_power_of_2;
int b = nearest_power_of_2;
cout << a << "... | ALGO | 0.999804 | 4.623102 |
12d48d70-5928-4a8b-9432-67035add4637 | glycerine/PrattParserInC | lex_twopointer.cpp | #include "stdio.h"
#include <vector>
#include <sys/mman.h>
#include <fcntl.h>
#include <assert.h>
#include "l3path.h"
#include "rmkdir.h"
#include "unistd.h"
#include "dv.h"
#include "quicktype.h"
#include "lex_twopointer.h"
#include "l3ts.pb.h"
#include "l3path.h"
#include "l3ts_common.h"
#include "rmkdir.h"
#includ... | TOOL | 0.909823 | 3.750352 |
409a2132-8932-479a-8adc-b8e0076798f8 | SatyendraOO7/ConvexHull | Graham_scan.cpp | #include<bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define LL long long
#define MAX 1000005
#define mod 1000000007
#define debug(a) cout<<a<<"\n"
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define pred(a) printf("... | ALGO | 0.99967 | 3.996839 |
35f22553-1d63-4542-8e29-1665815c2754 | nxh2803/Data-Structures | tree/Btree.cpp | #include <iostream>
using namespace std;
template <class E>
class BTree{
struct BNode{
E element;
BNode * left, * right;
BNode(E e = E(), BNode * l = 0, BNode * r = 0) : element (e), left(l), right(r){}
bool isLeaf() const{ return !left && !right;};
bool isInternal() ... | ALGO | 0.999903 | 5.012581 |
acd68b1c-ec9b-4fa5-bfa3-1480c521d639 | dido1092/CameraStreaming | opencv/sources/modules/gapi/src/backends/cpu/gcpustereo.cpp | #include <opencv2/gapi/stereo.hpp>
#include <opencv2/gapi/cpu/stereo.hpp>
#include <opencv2/gapi/cpu/gcpukernel.hpp>
#ifdef HAVE_OPENCV_CALIB3D
#include <opencv2/calib3d.hpp>
#endif // HAVE_OPENCV_CALIB3D
#ifdef HAVE_OPENCV_CALIB3D
/** @brief Structure for the Stereo operation setup parameters.*/
struct GAPI_EXPORTS... | TOOL | 0.87882 | 7.034382 |
703e8b8d-56f5-4cd5-8591-0812eeea68a5 | misterbaadshah/CODSOFT | numberGuessingGame.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
const int MAX_RANGE = 100;
const int EASY = 1;
const int MEDIUM = 2;
const int DIFFICULT = 3;
const int MAX_ATTEMPTS_EASY = 10;
const int MAX_ATTEMPTS_MEDIUM = 7;
const int MAX_ATTEMPTS_DIFFICULT = 5;
void displayInstructions()
{
cout <... | TOOL | 0.899445 | 4.380871 |
5ae86cee-7525-46bb-8b4c-61e0ab53f050 | Aadhithya-R-P/CPC | DSA_SHEET/Arrays/sumClosestto0.cpp | int closestToZero(int arr[], int n)
{
// your code here
sort(arr,arr+n);
int i=0,j=n-1;
int ans,minl = i, minr=j;
while(i<j)
{
if(abs(arr[i]+arr[j]) < abs(ans))
{
ans = arr[i]+arr[j];
... | ALGO | 0.999991 | 5.023787 |
1e80a91b-80ce-42b7-994b-cb9f5c41a91d | sharc-lab/LightningSim | llvm-project/llvm/lib/CodeGen/StackColoring.cpp | #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/MachineBasicB... | TOOL | 0.890059 | 7.675602 |
51678d67-1a7e-4816-ab9f-e83adad79248 | UserBits/OI-Codes | Luogu/P1962[矩阵快速幂]斐波那契数列.cpp | #include <cstdio>
#include <cstring>
typedef long long ll;
const ll mod=1000000007;
struct node{
/*
ll a[5][5];
node(){
memset(a,0,sizeof(a));
}*/
ll a,b,c,d;
}x,res;
inline node multi(node p,node q){
node tp;
/*
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
for(int k=1;k<=n;k++)
tp.a[i][j]=(tp.a[i][... | ALGO | 0.999981 | 3.932133 |
159ace7f-95ed-4d74-ad59-04b7d911908b | tokotoko9981/AtCoder | ABC/ABC212/A.cpp | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vs = vector<string>;
using ll = long long;
int main(void){
int A, B;
cin >> A >> B;
if(A > 0 && B > 0) cout << "Alloy" << endl;
else... | ALGO | 0.984723 | 4.080648 |
690918c3-ff24-4616-a7a7-6ecb7a3eab4a | IITH-Compilers/LLVM-Loop-Profiler_MonoRepo | llvm/lib/CodeGen/MachineSSAUpdater.cpp | #include "llvm/CodeGen/MachineSSAUpdater.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineOperand.h"... | TOOL | 0.990197 | 7.925349 |
2c3a670e-c4e6-4290-938e-769f38cb91cc | shreejitverma/SDE-Interview-Prep | LeetCode/C++/print-zero-even-odd.cpp | // Time: O(n)
// Space: O(1)
class ZeroEvenOdd {
public:
ZeroEvenOdd(int n) : n_(n) {
}
// printNumber(x) outputs "x", where x is an integer.
void zero(function<void(int)> printNumber) {
for (int i = 0; i < n_; ++i) {
{
unique_lock<mutex> l(m_);
wai... | ALGO | 0.999676 | 6.375945 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.