uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
986db942-197c-4278-868e-1e707891a2da | jmiv-eng/ECEN5763_EMVIA | ex1/capture-transformer/hough_line.cpp | #include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
void help()
{
cout << "\nThis program demonstrates line finding with the Hough transform.\n"
"Usage:\n"
"./houghlines <image_name>, Default is pic1.jpg\n" << e... | TOOL | 0.970557 | 4.59662 |
280265d0-d753-4489-8656-e6a787e65702 | KrutagyaKaneria/leetcode | 7-reverse-integer/reverse-integer.cpp | #include <iostream>
#include <limits.h>
class Solution {
public:
int reverse(int x) {
long long reversed = 0;
while (x != 0) {
int digit = x % 10;
reversed = reversed * 10 + digit;
x /= 10;
if (reversed > INT_MAX || reversed < INT_MIN) {
... | ALGO | 0.999895 | 5.766241 |
cf462d04-a271-4549-b72a-cf11ac0dd960 | dk-17/LeetCode-Contest | Weekly_Contest/224/1727. Largest Submatrix With Rearrangements.cpp | class Solution {
public:
int largestSubmatrix(vector<vector<int>>& matrix) {
int n=matrix.size();
int m=matrix[0].size();
int ans=0;
vector<int> height(m,0);
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(matrix[i][j]==0)
height... | ALGO | 0.999858 | 5.624902 |
d075e297-d855-4219-a7e7-9e7fbbeb03f5 | Ishita-Trivedi/DailyDSA | Articulation Point - I - GFG/articulation-point-i.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
private:
int timer = 1;
void dfs(int node, int parent, vector<int> &vis, int tin[], int low[],
vector<int> &mark, vector<int>adj[... | ALGO | 0.999892 | 6.383195 |
0f855e1f-bd7c-49ae-ac7c-8e9f18af1499 | AtishayJain27/DAA-LAB-PCS-409 | Week-1/Lab-1/Q2.cpp | #include <iostream>
#include <vector>
using namespace std;
int arrray(vector<int> arr,int n)
{
int key;
cin>>key;
int left=0;
int right =n-1;
while(left<right)
{
int mid=left+(right-left)/2;
if(arr[mid]==key)
{
return mid+1;
}
else if(arr[mid]>... | ALGO | 0.999879 | 4.27913 |
7ab59255-71c2-4494-83c3-4d2a7fd28f79 | kimgiwoong127/UIS | Project/main project/Mob.cpp | #include "Mob.h"
Mob::Mob(int a, int b, int h, int av, int d, int he,int spd) {
mob = State(a, b, h, av, d, he,spd);
}
void Mob::turn1(Player& player) {
player.act2();
srand(static_cast<unsigned int>(time(0)));
int exhp = player.gHP();
int choose = rand() % 100;
int Bayes[3] = {0,0,0};
bool a = false;
float ... | ALGO | 0.982596 | 4.256538 |
a839cb52-93c1-47c6-a934-81e4d2aaa55e | UHeeJoon/C-study2 | BaekJoon2/2755번.cpp | #include<bits/stdc++.h>
using namespace std;
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
int main()
{
FAST_IO;
int N, sum = 0;
double total = 0.0;
cin >> N;
for (int i = 0; i < N; i++)
{
string name, score;
int times;
double subject_score = 0.0;
cin >> name >> ... | ALGO | 0.999763 | 3.87307 |
54155a4d-12bf-4f99-a94f-126666c6cc7e | nuke705/MiscCplusplus | 525hw1.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <fstream>
#include <cstdlib>
using namespace std;
// if you want to run the code, change the comment to use different methods
float u, p, p_u, p_d, r, K;
float d, downtick_prob;
float S0, T, volatility,target = 9.472992 ;
int N;
float m... | ALGO | 0.999941 | 5.015243 |
6b68cdd9-70e9-4816-ab49-7eec8f89ce1d | hicugi/acmp.ru | 11-20/0147 Числа Фибоначчи.cpp | /*
(Время: 1 сек. Память: 16 Мб Сложность: 16%)
Последовательностью Фибоначчи называется последовательность чисел a0, a1, ..., an, ..., где
a0 = 0, a1 = 1, ak = ak-1 + ak-2 (k > 1).
Требуется найти N-е число Фибоначчи.
Входные данные
Во входном файле INPUT.TXT записано целое число N (0 ≤ N ≤ 30).
Вы... | ALGO | 0.999915 | 4.948098 |
e88a0f90-457c-4d30-bcc4-bd7494ca323c | kovaxis/progcomp | problems/codeforces/700/778/d.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REPGET(_1, _2, _3, NAME, ...) NAME
#define rep3(i, b, n) for (int i = (int)(b); i < (int)(n); i++)
#define rep2(i, n) rep3(i, 0, (n))
#define rep(...) REPGET(__VA_ARGS__, rep3, rep2)(__VA_ARGS__)
#define invrep3(... | ALGO | 0.999592 | 5.048094 |
e5e0b6a6-2c03-4d38-9b7c-66caa6da2298 | Howie-Ye/DAGS | thirdparty/lietorch/lietorch/src/lietorch_cpu.cpp |
#include "lietorch_cpu.h"
#include <Eigen/Dense>
#include <iostream>
#include "common.h"
#include "dispatch.h"
#include "so3.h"
#include "rxso3.h"
#include "se3.h"
#include "sim3.h"
template <typename Group, typename scalar_t>
void exp_forward_kernel(const scalar_t* a_ptr, scalar_t* X_ptr, int batch_size) {
// ... | ALGO | 0.969925 | 6.762569 |
f13516b1-ca41-407c-bae6-363a7394bb82 | om2438164/Leetcode | 0001-two-sum/0001-two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
// Brute force
// vector<int>ans;
// for(int i=0;i<nums.size()-1;i++){
// for(int j=i+1;j<nums.size();j++){
// if(nums[i]+nums[j]==target){
// ans.push_back(i);
... | ALGO | 0.999919 | 6.293703 |
9ea8b1c2-97e5-4573-ac5a-ddb76e464e97 | lost-name-man/ACM-Code | DingPa2025/3/10077.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <cstdlib>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
... | ALGO | 0.999438 | 4.597878 |
13e4616c-db0b-4eb2-8456-5ef83b17540a | huyongxi/blog | third_party/boost/libs/regex/performance/table_helper.cpp | #ifdef _MSC_VER
# pragma warning (disable : 4224)
#endif
#include <boost/regex.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/container_hash/hash.hpp>
#include <vector>
#include <set>
#include <iostream>
#include <sstream>
#include <ioman... | TOOL | 0.939133 | 4.865679 |
a7cfb815-4672-48f1-9a1b-5f961dcc4668 | briantruong777/quic-inverse-multiplex | src/third_party/icu/source/common/bytestrieiterator.cpp | #include "unicode/utypes.h"
#include "unicode/bytestrie.h"
#include "unicode/stringpiece.h"
#include "charstr.h"
#include "uvectr32.h"
U_NAMESPACE_BEGIN
BytesTrie::Iterator::Iterator(const void *trieBytes, int32_t maxStringLength,
UErrorCode &errorCode)
: bytes_(static_cast<const... | ALGO | 0.976838 | 7.579514 |
b7dc1989-711e-4673-bb0d-e74fd0d21f3f | StephanMc/cyanogenmod_android_frameworks_av | media/libstagefright/codecs/mp3dec/src/pvmp3_dequantize_sample.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_dequantize_sample.cpp
Functions:
power_1_third
pvmp3_dequantize_sample
Date: 09/21/2007
--------------------------------------------------------------... | ALGO | 0.999667 | 3.889368 |
e1c6a1c3-e754-4814-a0fa-67b91e4590df | Ishwarendra/Contests | CODEFORCES_CONTEST/888_Div3/F.cpp | #include "bits/stdc++.h"
#ifdef LOCAL
#include "F:\CPP\Debug\debug.h"
#else
#define print(...) 1;
#endif
using i64 = long long;
int getBit(int x, int pos) { return x >> pos & 1; }
int f(int a, int b, int x)
{
return (a ^ x) & (b ^ x);
}
std::array<int, 4> f(std::vector<int> &a, int bit, int x)
{
if (bit < ... | ALGO | 0.999941 | 4.710081 |
88560602-3836-42c2-8230-3752ef1b1185 | pingcap/tiflash | dbms/src/AggregateFunctions/AggregateFunctionMaxIntersections.cpp | #include <AggregateFunctions/AggregateFunctionFactory.h>
#include <AggregateFunctions/AggregateFunctionMaxIntersections.h>
#include <AggregateFunctions/FactoryHelpers.h>
#include <AggregateFunctions/Helpers.h>
namespace DB
{
namespace
{
AggregateFunctionPtr createAggregateFunctionMaxIntersections(
AggregateFunctio... | TOOL | 0.922697 | 7.639073 |
5cc8f451-ccb0-4f6f-91cd-42bd39150673 | manikanta2901/ubuntu | .history/practice/cpp/codeforces/GCDSum_20210406143644.cpp | #include <bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define trav(dataType,DataStruct,name) for(dataType<DataStruct>::itt ip = name.bb(); ip != name.ee(); ip++)
//Pre processors & typedefs
... | ALGO | 0.999846 | 4.536899 |
c59c3655-5c48-4f64-b55b-2a10db683aa5 | alexandraback/datacollection | solutions_1485488_0/C++/Lytton/B.cpp | #include <stdio.h>
#include <iostream>
using namespace std;
#define MAXN (100+10)
#define MAXR (MAXN*MAXN)
#define oo (100000000)
#define xx (1e-6)
const int fx[4][2] = {{0,1},{1,0},{0,-1},{-1,0}};
int f[MAXN][MAXN], c[MAXN][MAXN];
int r,h,n,m,t,l[MAXR][2];
double g[MAXN][MAXN];
bool fl[MAXN][MAXN];
bool ifenter(int... | ALGO | 0.999872 | 3.462024 |
3464b089-0fcb-4539-9327-70d45fc89d50 | Shishank93774/LeetCode-Solutions | 0059-spiral-matrix-ii/0059-spiral-matrix-ii.cpp | class Solution {
public:
vector<vector<int>> generateMatrix(int n) {
vector<vector<int> > arr(n, vector<int>(n));
int cur = 1;
int tr = 0, br = n-1, lc = 0, rc = n-1;
int r = 0, c = 0;
while(tr<=br and lc<=rc){
while(c<=rc){
arr[r][c] = cur++;
... | ALGO | 0.999977 | 5.836947 |
d61f9236-bff1-4cc5-9c58-fc97333cceed | karamu-ser/poo_cpp | rapport_tps/tp3/ex08.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
class Forme
{
public:
virtual double calculerAire() const = 0;
virtual void afficher() const = 0;
virtual ~Forme() {}
};
class Rectangle : public Forme
{
private:
double longueur;
double largeur;
public:
Rectangle(double l, ... | TOOL | 0.916454 | 3.945493 |
39b40f42-9705-4ce2-8174-1373848f89d2 | Harsh-Agrawal-425/Graph_Theory_Powered_Sudoku_Solver | Assignment-01/230855_Q1_Assignment1.cpp | #include <bits/stdc++.h>
using namespace std;
void ConstructAdjacency(vector <int> adj[]) {
adj[0]={1,2};
adj[1]={0,3,4};
adj[2]={0,5,6,10};
adj[3]={1,7,8};
adj[4]={1,9};
adj[5]={2,10};
adj[6]={2,11,12};
adj[7]={3};
adj[8]={3};
adj[9]={4,13,14};
adj[10]={2,5};
adj[11]={6... | ALGO | 0.999778 | 4.673156 |
6911c508-4356-46c5-a2d1-e00645494b64 | Abhijit-Kumar-GitHub/Cipher_Schools_Sem_3 | trial.cpp | #include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
int main() {
int number1 = 54;
int number2 = 24;
int result = gcd(number1, number2);
cout << result;
return 0;
} | ALGO | 0.999792 | 5.795902 |
5b51eaba-b2bb-4078-a83f-220d39e9d002 | Pankaj-krCP/DSA-And-CP | Coding Ninja - CP/22. Advanced Graphs/Airports.cpp | #include <bits/stdc++.h>
using namespace std;
class Edges
{
public:
int src;
int dest;
int weight;
};
class compare
{
public:
bool operator()(Edges const &a, Edges const &b)
{
return a.weight < b.weight;
}
};
int findParent(int *parent, int vertex)
{
if (parent[vertex] == vertex... | ALGO | 0.999837 | 4.494473 |
54c96500-612a-4238-932c-c5aebcaaa476 | hehaodele/acm-icpc | regionals/swerc-2012/A.cpp | // UVALive 6151, Beehives
#include <iostream>
#include <cstdio>
#include <vector>
#include <deque>
const int N = 500;
const int INF = 1 << 30;
typedef std::pair<int, int> Pair;
std::vector <int> neighbors[N];
int depth[N];
int n, m, answer;
void initialise () {
for (int i = 0; i < n; ++ i) {
depth[i] = ... | ALGO | 0.999892 | 4.607223 |
ff4d8570-96b5-4382-b69f-06d958e31f0c | souravbiswassanto/Codeforces | 1245C.cpp | #include <bits/stdc++.h>
using namespace std;
int mod=1e9+7;
int main(){
string s;
cin>>s;
int n=s.size();
int A[n+5];
A[0]=1;
int cntr=1;
if((s[0]=='m'||s[0]=='w')){
cout<<0<<endl;return 0;
}
for(int i=1;i<n;i++){
if((s[i]=='m'||s[i]=='w')||(s[0]=='m'||s[0]=='w')){
c... | ALGO | 0.999967 | 4.487843 |
2cb96c66-2daf-4dc3-ac73-de2838765ad1 | rim0621/Rookie | BOJ/2606_virus.cpp | #include<bits/stdc++.h>
using namespace std;
bool computer[104][104];
int countComputer(int n)
{
vector<int> v;
v.push_back(1);
for(int i=1;i<=n;i++)
{
if(computer[v[0]][i]==true){
v.push_back(i);
}
}
if(v.size()!=1)
{
for(int i=1;i<v.size();i++)
{
for(int j=1;j<=n;j++)
{
if(computer[v[i]]... | ALGO | 0.999828 | 3.707982 |
9259c503-adc9-4005-90d5-60dda23fd44b | Souma-cpp/Cpp-Journey | L21_to_L25/2D_arrays/row_wise_sum.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[3][3];
// Input the 3x3 array elements from the user
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
cout << "Enter the element of arr[" << i << "][" << j << "]: ";
cin >> arr[i][j];
... | ALGO | 0.999197 | 4.633682 |
35b032bd-5b6a-4f38-943b-ab8b4f72844e | Pperez4/C-plus-plus | ch5/paternDisplay.cpp | /*------------------------------------------------------------
Pattern Displays
Write a program that uses a loop to display Pattern A below,
followed by another loop that displays Pattern B.
Pattern A
+
++
+++
++++
+++++
++++++
+++++++
++++++++
+++++++++
++++++++++
Pattern B
++++++++++
+++++++++
++++++++
+++++++
+++... | ALGO | 0.999219 | 4.959284 |
211d3cc9-529f-4f88-b987-6985c595be3d | anshuahi/LeetCode | daily-challenges-2023/01-January/08-jan 149. Max Points on a Line/solution.cpp | class Solution {
public:
int maxPoints(vector<vector<int>>& pt) {
int ans=1;
int n=pt.size();
// slope of every point with selected point
for(int i=0;i<n-1;i++){
map<double,int> mp;
for(int j=i+1;j<n;j++){
//calculating the slope
... | ALGO | 0.999975 | 5.610839 |
c81ff519-d08d-432b-828d-5b9168cb9181 | mmatrosov/FKN2020 | preliminary/B/33905635.cpp |
#include <bits/stdc++.h>
/*#define fori(n) for (int i = 0; i < n; i++)
#define forj(n) for (int j = 0; j < n; j++)
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(), v.end()*/
typedef long long ll;
#pragma GCC optimize("Ofast", "unroll-loops", "no-stack-protector", "fast-math", "O3")
//#... | ALGO | 0.999789 | 4.156028 |
f3a94cb5-98c3-4dc0-9751-ec5201fc2a70 | jmk/jslove | love/src/libraries/Box2D/Dynamics/Joints/b2PulleyJoint.cpp | #include <Box2D/Dynamics/Joints/b2PulleyJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Pulley:
// length1 = norm(p1 - s1)
// length2 = norm(p2 - s2)
// C0 = (length1 + ratio * length2)_initial
// C = C0 - (length1 + ratio * length2)
// u1 = (p1 - s1) / norm(p1 - s1)
// u2 = (p2 -... | ALGO | 0.995059 | 6.996031 |
807c355a-0ae0-4eb6-95d7-764b0281ad87 | blacksea3/leetcode | cpp/leetcode/5115. palindrome-removal.cpp | #include "public.h"
//
//dp
//dp[i][j] ɾõС
//dp[i][j]ڶڲȻп
//arr[i] == arr[j] ô dp[i][j] = min(dp[i - 1][j - 1], dp[i][j])
//ʼdp[i][i] = 1
// dp[i][i + 1] = 2 arr[i] != arr[i + 1] 1
class Solution {
public:
int minimumMoves(vector<int>& arr) {
int aSize = arr.size();
vector<vector<int>> dp(aSize, vector<int>(a... | ALGO | 0.999861 | 5.358933 |
fc1ebe65-f902-4e6b-9c2b-9448792b8a1f | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/swap/merge/test/6b55f4bf-fdf5-4193-97fa-8bf5af978560.cpp | #include <fstream>
#include <string.h>
using namespace std;
ifstream f("swap.in");
ofstream g("swap.out");
char s[50001],s1[50001];
int n,A[200][50001],viz[50001],v[50001],m,i,a,b,arb[200000],ok;
long long sol;
int query(int nod, int st,int dr){
int sol=0;
if(a<=st&&b>=dr)
return arb[nod];
... | ALGO | 0.999796 | 3.195642 |
50a72e95-00c5-4eef-ad81-54ed231e4ee2 | Ujjval-dargar/Leetcode_Logs | 0028-find-the-index-of-the-first-occurrence-in-a-string/0028-find-the-index-of-the-first-occurrence-in-a-string.cpp | class Solution {
public:
vector<int> computeLPS(string s) {
int n = s.size();
vector<int> lps(n, 0);
lps[0] = 0;
int i = 1;
int len = 0;
while (i < n) {
if (s[len] == s[i]) {
len++;
lps[i] = len;
i++;
... | ALGO | 0.999979 | 6.109037 |
f8aae0ae-78dc-42b5-9377-5050b532b2df | AashutoshTrivedi/Data-Structures-and-Algorithms | codes/Algorithms/DS/BST/main.cpp | #include <iostream>
#include<queue>
using namespace std;
class Node
{
public:
int d;
Node *left, *right;
Node(int data)
{
d = data;
left = right = NULL;
}
};
class bst
{
public:
Node *insert(Node *n, int d)
{
if(n == NULL)
{
return new Node(d);
... | ALGO | 0.999953 | 4.9512 |
4e97c019-0a6b-4542-9322-99723d5d112a | raincross7/code-similarity | codes/train_code/problem441/problem441_459.cpp | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
int a, b;
for(ll i = 1; i * i <= n; i++) {
if(n % i == 0) {
a = i... | ALGO | 0.999346 | 4.20975 |
66a019fa-b30c-4fbf-bdef-820971b705aa | ahao214/Algorithm | Ahao.LeetCodeCPP/1611. 使整数变为 0 的最少操作次数.cpp | #include<vector>
#include<string>
#include<unordered_map>
#include <bitset>
using namespace std;
/*
1611. ʹΪ 0 ٲ
*/
class Solution {
unordered_map<string, int>mem;
unordered_map<string, int>mem1;
public:
int minimumOneBitOperations(int n)
{
string str = bitset<32>(n).to_string();
return dfs(str);
}
int df... | ALGO | 0.999977 | 6.180106 |
0a4673e6-a126-4810-989c-4a17639bcccc | polaris-cloud/cpp-primer | test_9_49.cpp | #include<iostream>
#include<string>
#include<fstream>
using namespace std;
//查找第一个字符,查找下一个出现字符
void finda(const string&s1,const string&s2)
{
decltype (s1.size()) cur=0,prev=0;
decltype(s1.size()) len=0,pos=0;
while((cur=s1.find_first_of(s2,cur))!=string::npos)
{
if(cur-prev>len)
{
... | ALGO | 0.970774 | 3.660351 |
f668b5b8-b8ac-46f2-86b0-e1670c9b9ed4 | deepakasu67/leetcode | Old Leetcode/1361. Validate Binary Tree Nodes.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
bool validateBinaryTreeNodes(int rootIdx, vector<int>& leftChild, vector<int>& rightChild, vector<bool>& visited)
{
if (rootIdx == -1)
{
return true;
}
if (visited[rootIdx] == true)
... | ALGO | 0.999963 | 5.563894 |
1047c17f-ebd6-4821-b08a-332ef95c6ebf | atulathome/Algorithms | Heap/MaxWaterTrap3D.cpp | /**
https://leetcode.com/problems/trapping-rain-water-ii/
Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to trap after raining.
Note:
Both m and n are less than 110. The height of each unit cell is greater than 0 and ... | ALGO | 0.999946 | 6.794847 |
43abc99b-687c-4235-8e9e-d0306a7fc6ec | hoangtruong296/Code_DSA | DSA05026 Xem phim.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int n, k, res=0;
cin >> k >> n;
int ar[n+2], br[25001]={0}; for(int i=1; i<=n; i++) cin >> ar[i];
br[0]=1;
for(int i=1; i<=n; i++){
for(int j=k; j>=1; j--){ // xet tu gtri lon nhat ve nho nhat de 1 phan tu k
if(j>=ar[i]) br[j]=max... | ALGO | 0.999976 | 3.658251 |
1535214d-fe2d-424f-9a70-ddb861107315 | Mosina916/CPP_JULY24 | questionpractice/formmatrixxand0.cpp | #include<iostream>
using namespace std;
// void spiralprint(int arr[5][5],int r,int c){
void formmatrix(char arr[100][100],int r,int c){
int sr=0,er=r-1,sc=0,ec=c-1;
char ch='X';
while(sr<=er and sc<=ec){
// forward
for (int i = sc; i <=ec; i++)
{
arr[sr][i]=ch;
}
sr++;
// downward
for (int j = s... | ALGO | 0.999346 | 3.115337 |
0ea5ef85-c69b-4195-b5f5-6824deacd9c0 | Janesh7/CPP_DSA | 24. Graphs/07. Kahn's Algo - IMP/Topological Sort-Kahns.cpp | #include <bits/stdc++.h>
vector<int> topologicalSort(vector<vector<int>> &edges, int v, int e)
{
// Write your code here
unordered_map<int, list<int>> adjList;
vector<int> inDegree(v, 0);
for (auto i : edges)
{
int u = i[0];
int v = i[1];
adjList[u].push_back(v);
/... | ALGO | 0.999986 | 5.311614 |
3e1641a7-26d6-4cf9-bada-6e10c83e8884 | Nwon2464/cpp | april14/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define sfl(a) scanf("%lld", &a)
#define sz(x) (int)(x).size()
const int mod = 1e9 + 7;
template <typename T>
istream& operator>>(istream& is, vector<T>& vec)
{
for (auto& v : vec)
is >>... | ALGO | 0.999305 | 3.851514 |
0aeddca0-d37b-47f9-b481-a26ec9642dcd | abdelhakim96/ROS_UNav-Sim | bluerov2_trajectory/scripts/bluerov2_pipe_following/bluerov_mpc/ACADOtoolkit/examples/code_generation/mpc_mhe/pendulum_dae_nmpc_test.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
#include "acado_common.h"
#include "acado_auxiliary_functions.h"
#define NX ACADO_NX /* number of differential states */
#define NXA ... | ALGO | 0.999114 | 5.266586 |
6886da30-656b-4563-8128-6d6822c8bdbf | Aditya27T/lat-pemdas-pengkondisian | latihan/latihan3.cpp | #include <iostream>
using namespace std;
int main() {
int x;
cout << "Masukkan sebuah angka: ";
cin >> x;
if (x >= 10) {
if (x <= 20) {
cout << "\nNilai" << x << " berada di antara 10 dan 20" << endl;
} else {
cout << "\nNilai " << x << " lebih dari 20" << end... | ALGO | 0.996301 | 4.392893 |
4d619398-8aa5-47c2-bd7f-56a21df26a14 | BitcoinFlashDEV/BitcoinFlash | src/rpcclient.cpp | #include "rpcclient.h"
#include "rpcprotocol.h"
#include "ui_interface.h"
#include "util.h"
#include <set>
#include <stdint.h>
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
#include <univalue.h>
using namespace std;
class CRPCConvertParam
{
public:
std::string methodName; //! method whose p... | CONFIG | 0.979393 | 6.920259 |
c37a59e1-5f4e-4da8-a683-d1520226d42f | frank3215/PKU_homework | 大一下 2022春/cxsjsx 程序设计实习/20220223 - 2022 程序设计实习之位运算作业/b.cpp | #include <iostream>
using namespace std;
int bitManipulation2(int n, int i) {
////////////////////////////////////////
return n ^ (1<<i);
// return ((!((n>>i)&1))<<i) | (n&(~(1<<i)));
////////////////////////////////////////
}
int main() {
int t, n, i;
cin >> t;
while (t--) {
cin >> n >> i;
cout << bitManipu... | ALGO | 0.999948 | 4.258318 |
3c1a6d25-1494-4c9b-9a32-a6606887fabd | vbonnici/grafe-sim | analysis/data/p01267/s513155115.cpp | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) (a).begin(),(a).end()
#define ifnot(a) if(not a)
#define dump(x) cerr << #x << " = ... | ALGO | 0.999517 | 3.133666 |
db1cf589-46d3-4ef7-9299-f87f8ff14e9a | steam7763/ICPC- | cscの板/典型例题/软件包管理.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#define Ls(x) x<<1
#define Rs(x) x<<1|1
using namespace std;
const int MAXN =120010;
struct Edge
{
int from,val,to,nxt;
} E[MAXN*2];
struct Tre
{
int l,r,len;long long val,vis;
}tree[MAXN*4];
int head[MAXN],tot;
void Edge_add(int x,int y)
{
++tot;
E[tot].from=x;... | ALGO | 0.999738 | 3.567562 |
f2f9e8de-3660-4211-aa40-4c54a21fa320 | devjeanfraga/challenges-C- | challenge-calculator.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main () {
char op; float a, b;
cin >>op >> a >> b;
switch (op) {
case '+':
cout << a+b << endl;
break;
case '-':
cout << a-b << endl;
break;
case '/':
cout << fixed << setprecision(1) << a/b << endl;
break... | ALGO | 0.980913 | 3.515891 |
b0f2fd3b-de6b-4a69-af21-3068f158e882 | Evolution-X-AOSP/system_extras | simpleperf/runtest/function_fork.cpp | #include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
constexpr int LOOP_COUNT = 100000000;
volatile int a[2];
void ParentFunction() {
volatile int* p = a + atoi("0");
for (int i = 0; i < LOOP_COUNT; ++i) {
*p = i;
}
}
void ChildFunction() {
volatile int* p = a + atoi("1");
for (int i = 0; i < ... | TOOL | 0.957959 | 5.198478 |
5ec4d4a1-c9c3-42b4-9455-1b8e4659a006 | Fayjul/CP | cf-742_b_2.cpp | /*
verdict:
date_start:
time:
accepted_time:
massege:
*/
#include<bits/stdc++.h>
using namespace std;
#define cheek cout<<"ok i reached here\n";
#define bug(x) cout << #x << " = " << x<<endl;
void solve()
{
//cout << "Bismillah Hir-Rahmanir Rahim" << endl;
long long int n, k, a,b,c=2e6, ans=0;
//cout <<... | ALGO | 0.999983 | 4.176654 |
11884163-478a-43b4-8638-f88e3f04df70 | bhagvadgita/Leetcode | 2707-merge-two-2d-arrays-by-summing-values/merge-two-2d-arrays-by-summing-values.cpp | class Solution {
public:
vector<vector<int>> mergeArrays(vector<vector<int>>& nums1, vector<vector<int>>& nums2) {
int i = 0,j=0;
vector<vector<int>> nums3;
while (i<nums1.size() && j<nums2.size()){
if (nums1[i][0]<nums2[j][0]){
nums3.push_back(nums1[i]);
... | ALGO | 0.999947 | 6.142432 |
bcc396eb-a18f-47f1-b588-42af55e56e3c | AlvyPiper/MoreGreenTea | csgosdk/game/server/point_playermoveconstraint.cpp | #include "cbase.h"
#include "saverestore_utlvector.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#define SF_TELEPORT_TO_SPAWN_POS 0x00000001
//-----------------------------------------------------------------------------
// Purpose:
//------------------------------------... | TOOL | 0.866755 | 5.721498 |
fd1573d1-76dc-426e-ace6-8f5a8e9ae48b | VivekYadav98/DSA | Multiply Matrices - GFG/multiply-matrices.cpp | //{ Driver Code Starts
#include<iostream>
#include<stdio.h>
using namespace std;
void multiply(int A[][100], int B[][100], int C[][100], int N);
int main()
{
int t;
cin>>t;
while(t--){
int N;
cin>>N;
int A[100][100],B[100][100],C[100][100];
int i, j;
for(int i = 0; i < N; i++)
for(int j = 0 ; j <... | ALGO | 0.999579 | 4.053244 |
d3cbf54e-23da-4066-86aa-bc68eaa5b499 | om-mapari/DSA-THE-END | BINARY SEARCH TREE/bst.cpp | #include <iostream>
using namespace std;
#include <bits/stdc++.h>
class node
{
public:
int val;
node *left;
node *right;
node(int data)
{
val = data;
left = right = NULL;
}
};
void printv(vector<int> &v);
void printvv(vector<vector<int>> &v);
/* 8
/ \... | ALGO | 0.999946 | 4.297882 |
f975c9fe-3786-4b83-a9f2-348210c76de3 | rickytan/LeetCode | reverse-nodes-in-k-group/main.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
ListNode(int x, ListNode *n) : val(x), next(n) {}
};
class Solution {
public:
ListNode *reverseKGroup(ListNode *head, int k) {
return reverseList(head, k);
... | ALGO | 0.999972 | 5.369047 |
9c2f057f-1243-4a0b-b9e1-35fc24c265f5 | ishandutta2007/codeforces | tzc_wk/normal/45/A.cpp | #include <bits/stdc++.h>
using namespace std;
const string M[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
string s;
int m;
int main(){
cin>>s>>m;
int cur;
for(int i=0;i<12;i++){
if(M[i]==s) cur=i;
}
cur=(cur+m)%12;
cout<<M[cur... | ALGO | 0.99981 | 3.705581 |
73434b68-7baf-46c4-8005-a6ad07d3922d | blender/blender | source/blender/freestyle/intern/geometry/Grid.cpp | /** \file
* \ingroup freestyle
* \brief Base class to define a cell grid surrounding the bounding box of the scene
*/
#include <stdexcept>
#include "BBox.h"
#include "Grid.h"
#include "BLI_utildefines.h"
namespace Freestyle {
// Grid Visitors
/////////////////
void allOccludersGridVisitor::examineOccluder(Polyg... | ALGO | 0.980921 | 7.651652 |
1c164fd7-7dbf-423c-a7a0-85e5d7d3bf8f | elsewhere/oldscool | matikka.cpp | #include "stuff.hpp"
#include "matikka.h"
void antiRotate(Vector *x, Vector *y, Vector *z)
{
float matrix[16];
glGetFloatv(GL_MODELVIEW_MATRIX, matrix);
*x = (Vector(matrix[0], matrix[4], matrix[8]));
*y = (Vector(matrix[1], matrix[5], matrix[9]));
*z = Vector(matrix[2], matrix[6], matrix[10]);
}
float catmul... | TOOL | 0.958613 | 3.090404 |
00cf582d-200d-45f1-96a8-8dfe4db1b872 | ishandutta2007/codeforces | 4fecta/normal/547/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long
#define int ll
#define ld long double
#defi... | ALGO | 0.999903 | 3.931826 |
491cfb7d-f77d-4959-a1d8-4894abf5b457 | stringing/Federated-LLM-Based-APR | RoPGen/src/coding style attacks/author-style-transform/transform/sources/477.cpp | #include <iostream>
#include <cstdio>
#include <deque>
using namespace std;
const int MAXN = 105;
const int INF = 0x3f3f3f3f;
int d[MAXN][MAXN][4];
bool vis[MAXN][MAXN][4];
int n, m;
string maze[MAXN];
int dis(int *x) {
return min(min(x[0], x[1]), min(x[2], x[3]));
}
void init() {
for (int i = 0; i < MAXN; i++)... | ALGO | 0.999921 | 4.280377 |
4afb9359-5d92-4a2a-a3bf-0351d71bfaf1 | arZamalyutdinov/msu_spring_2019 | 02/calc.cpp | #include "calc.h"
#include <algorithm>
#include <iostream>
#include <stdexcept>
Calc::Calc(const std::string &str) : expr(str) {
expr.erase(std::remove(expr.begin(), expr.end(), ' '), expr.end());
}
int64_t Calc::compute() {
auto curr = expr.begin();
return expression(curr);
}
int64_t Calc::expression(st... | ALGO | 0.999364 | 5.905201 |
53573b89-09c9-4d0d-b705-7fd0834dfa5a | Nikith-S/coding | Strings/PermutationString.cpp | #include <iostream>
using namespace std;
bool checkEqual(int a[26], int b[26])
{
for (int i = 0; i < 26; i++)
{
if (a[i] != b[i])
return 0;
}
return 1;
}
bool checkInclusion(string s1, string s2)
{
int count1[26] = {0};
for (int i = 0; i < s1.length(); i++)
{
in... | ALGO | 0.999995 | 4.96026 |
f01fcea2-000e-445d-9cd4-216bb42c46ea | caipengbo/Coding-Interviews | cpp/11.min_in_rotate_array.cpp | #include<iostream>
#include<vector>
using namespace std;
// LeetCode 154. Find Minimum in Rotated Sorted Array II
// 剑指offer 11题
class Solution {
public:
int minNumberInRotateArray(vector<int> nums) {
int n = nums.size();
if (n == 0) {
return -1;
}
int left = 0;
i... | ALGO | 0.999919 | 5.575002 |
fe8e93f9-37c8-4373-b764-88329b982c3b | zhangfaen/pku-online-judge | 2008/432812_RE.cpp | #include<iostream>
#include<stdio.h>
using namespace std;
int deep(int * a,int b)
{
int level=0;
while(a[b]!=0)
{
level++;
b=a[b];
}
return level;
}
int father(int * a,int b)
{
while(a[b]!=0)
b=a[b];
return b;
}
int main()
{
//freopen("c:\\in.txt","r",stdin);
int T;scanf("%d",&T);... | ALGO | 0.999834 | 3.628154 |
87e902ae-ecb8-4435-adca-7bc1b02ec5b5 | whquddn55/Algorithm_BojSolves | 4000/4354.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename a, typename b>
ostream& operator<<(ostream& os, const pair<a, b>& pai) {
os << pai.first << ' ' << pai.second;
return os;
}
template<typename a, typename b>
istream& oper... | ALGO | 0.998877 | 3.517823 |
38dde915-d762-472d-95f1-ea0370b9f448 | juarezpaulino/coderemite | problemsets/UVA/12190.cpp | /**
*
* Author: Juarez Paulino(coderemite)
* Email: <EMAIL>
*
*/
/***********************************************************************************************************/
/* Declarations, macros, parser functions */
/****************************... | ALGO | 0.999688 | 3.681737 |
181a0b6c-07b0-457f-a715-10d728574112 | AkshatAggarwal14/Competitive-Programming | CodeForces/1007/a.cpp | //1007A
#ifndef ONLINE_JUDGE
#include "Akshat.h"
#else
#include "bits/stdc++.h"
using namespace std;
#define dbg(...)
#endif
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using o_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_... | ALGO | 0.999922 | 4.662993 |
ee9bd91c-66ba-4456-a712-ed805adda312 | sebasgarcep/ComputationalProblems | FibonacciPaths/main.cpp | #include <chrono>
#include <math.h>
#include <stdio.h>
#include <set>
#include <vector>
#include <algorithm>
// Problem parameters
const long n = 10000;
const long m = 10000;
const long mod_size = 1000000000 + 7;
// Algorithm parameters
// Static variables
long mod(long a, long b) {
long r = a % b;
return r... | ALGO | 0.99978 | 5.217793 |
abd9a544-7bc3-41e4-a690-8b3284139791 | shubham4349/Leetcode | 1646-kth-missing-positive-number/kth-missing-positive-number.cpp | class Solution {
public:
int findKthPositive(vector<int>& arr, int k) {
int n= arr.size();
unordered_set<int> temp(arr.begin(), arr.end());
vector<int> pseudo;
for(int i =1; i<=1e4; i++){
if(temp.count(i) ==0) { // agar element nhi h to
pseudo.p... | ALGO | 0.999971 | 5.367626 |
4a76f576-904e-40ff-9450-82cfe5a2a91b | sahuankit010/LeetCode-Solutions | 1047-remove-all-adjacent-duplicates-in-string/1047-remove-all-adjacent-duplicates-in-string.cpp | class Solution {
public:
string removeDuplicates(string s) {
stack<char>st;
st.push(s[0]);
int i=1;
while(i<s.length()){
if(st.empty() || st.top()!=s[i]){
st.push(s[i]);
}
else{
st.pop();
}
i+... | ALGO | 0.999979 | 6.500637 |
1094308c-e869-4440-a6dd-d48548252af9 | raviii21/Leetcode-Codes | minimum-moves-to-reach-target-score/2-11-2023, 10_30_40 PM/minimum-moves-to-reach-target-score.cpp | // Link: https://leetcode.com/problems/minimum-moves-to-reach-target-score
/** Submission Info:
*
* AUTHOR: Ravi Savsani
* TITLE: minimum-moves-to-reach-target-score
* RUNTIME: 1606 ms
* MEMORY: 5.9 MB
* DATE: 2-11-2023, 10:30:40 PM
*
*/
// Solution:
class Solution {
public:
int minMoves(int target,... | ALGO | 0.999964 | 6.156354 |
c5e8d985-e25c-4618-9443-d1a51c5686ad | jun28/ONBOARD-CERTO | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
04bbffc1-2e8b-457c-a33d-2a3a1c8d0549 | Saragog/Bachelor-s-Thesis---Digital-image-forgery-detection | src/DrawingOperations.cpp | /*
* DrawingOperations.cpp
*
* Created on: 11 wrz 2016
* Autor: Andrzej Dackiewicz
*
* Komentarz:Ten plik jest częścią programu wykrywającego fałszerstwa cyfrowe w obrazach, który
* został stworzony w ramach pracy inżynierskiej.
* Ten plik zawiera implementację funkcji klasy DrawingOperations.
*/
... | TOOL | 0.908317 | 5.54565 |
74d9cdbd-9a0d-4e87-ad6e-a99e7610da97 | HLRJ/Cpu0_For_LLVM17 | llvm-project-llvmorg-17.0.6/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity,
// indirect_unary_predicate<projected<I, Proj>> Pred>
// requires permutable<I>
// subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {}); ... | TEST | 0.992432 | 7.929128 |
c567c33f-df56-4436-bee4-7e5ef27d7035 | gunjan192002/LearningCpp | CPcodes/test1.cpp | #include <bits/stdc++.h>
//F047_gunjan_agrawal
//gunjan agrawal
//insta id->_gunjan_agrawal_
#define pi (3.141592653589)
#define M 1e9+7
#define ll long long int
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define f first
#define s second
#define rrep(i, n) for(int i=n-1;i>=0;i--)
#defi... | ALGO | 0.991831 | 4.042666 |
0cd3764c-2657-4242-9e10-f871e085327f | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4112_19.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, i, c = 0, l = 0;
cin >> n;
int a[] = {9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999};
for (i = 0; i < 9; i++) {
if (a[i] <= n) {
c += (a[i] - l) * (i + 1);
l += a[i];
} else
break;
}
if (n <... | ALGO | 0.99911 | 3.455601 |
49ffb769-e4fc-4faf-8e48-756ed645c110 | doublethinkco/boost | libs/spirit/example/x3/num_list/num_list2.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demontrates a parser for a comma separated list of numbers.
//
// [ JDG May 10, 2002 ] spirit1
// [ JDG March 24, 2007 ] spirit2
// [ JDG May 12, 2015 ] spirit X3
//
/////////////////////////////////////////////... | TOOL | 0.960517 | 6.747814 |
66dd6997-5fa7-436d-bb45-70df10fffd7c | sdpa-python/sdpa-multiprecision | mpack/Rsyrk.cpp | /*
Rsyrk performs one of the symmetric rank k operations
C := alpha*A*A' + beta*C,
or
C := alpha*A'*A + beta*C,
where alpha and beta are scalars, C is an n by n symmetric matrix
and A is an n by k matrix in the first case and a k by n matrix
in the second case.
*/
#include <mblas_gmp.h>
void
Rsyrk(const char *upl... | ALGO | 0.999614 | 4.354251 |
a6216573-1ebe-451a-a6e4-2c4ebb226872 | amiiigh/AP_projects | A7-92426/functions.cpp | #include "functions.h"
Transportation* find_path(string _origin,string destination,Time time,vector<int>passengers,vector<string>& seen_cities,vector<Transportation*>& path,vector<Transportation*> tr_list)
{
bool flag = false;
Transportation* a;
// cout << _origin << "->" << destination << endl;
//vector<Transporta... | ALGO | 0.99614 | 3.379645 |
f6cdf731-aee2-4009-b12e-cabd60a467bc | ishandutta2007/codeforces | krijgertje/normal/940/A.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.999989 | 3.962476 |
eeaaecdf-9638-411a-8444-7bea92cc68c5 | leon-junio/AEDS1-PUC | lista_7 - CPP/3.cpp | /*
Exercicio 3 - Faça um procedimento que preencha 2 vetores X e Y com 10 elementos cada um (ocupando
as posições de 0 a 9 em cada vetor). Faça um outro procedimento que receba dois vetores
preenchidos e gera um novo vetor com os elementos desses 2 vetores intercalados de tal
forma que nas posições ímp... | TOOL | 0.986672 | 4.301546 |
7d50e945-a19e-4cfd-9db6-dee60dd1202c | brahmjit24/ADI | HASH-TABLE/hashTable.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
struct Node * next;
};
struct HashTable{
int key;
struct Node * head;
};
struct HashTable * arr[100];
int top=-1;
int exists(int key)
{
if(top==-1)
return -1;
else{
for(int i=0;i<=top;i++)
{
if(arr[i]->key==key)
return i;
}
ret... | ALGO | 0.999485 | 4.370009 |
650a3ec4-4ed5-4840-b89d-9684545e4e00 | Anshul-jolly-joshi/CSA0649---Design-And-Analysis-Of-Algorithm | 17-min and max usind divide &conquer.cpp | #include <stdio.h>
void findMaxMin(int arr[], int low, int high, int *max, int *min) {
int mid, max1, max2, min1, min2;
if (low == high) {
*max = arr[low];
*min = arr[low];
}
else if (high - low == 1) {
if (arr[low] > arr[high]) {
*max = arr[low];
*min =... | ALGO | 0.99998 | 4.897505 |
79c8fc0d-d2d1-4f49-9935-d5b410cc4b76 | swapnilsachan03/cp31 | 900/A_Make_It_Zero.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<int, int>
#define vii vector<pair<int, int>>
void solve() {
int n;
cin >> n;
vi nums(n);
for (int i = 0; i < n; i++) {
cin >> nums[i];
}
if (n & 1) {
c... | ALGO | 0.998999 | 3.23823 |
4b0a1ef8-c664-4496-a751-71e7a22e12e5 | guytreves/122b-project1 | project1/Project1Prompt/BoyerMoore.cpp | #include "BoyerMoore.h"
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <string>
#include "BoyerMoorePreprocessing.h"
// Input: Pattern P, text T, alphabet Sigma used, and a list to store matches
// P is 1-indexed, so we represent the pattern "abc" by P = " abc"
// T is als... | ALGO | 0.999874 | 6.649127 |
754b7153-00fe-4690-a366-9e717f2237b7 | smartzcy/My_vscode | C_learn/HZNU_C/ProblemSet_4/P1257.cpp | #include<iostream>
using namespace std;
int main(){
int n;
while (cin >> n){
int k = 0;
int i = 0;
while (1){
i++;
k = k % n * 10 + 1;
if(k % n == 0){
cout << i << endl;
break;
}
}
}
return 0;... | ALGO | 0.999708 | 3.144539 |
dc3ea7fb-1427-4111-a81d-db4e1ca68b32 | clbond/braid | boost/libs/spirit/example/qi/roman.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A Roman Numerals Parser (demonstrating the symbol table). This is
// discussed in the "Symbols" chapter in the Spirit User's Guide.
//
// [ JDG August 22, 2002 ] spirit1
// [ JDG March 13, 2007 ] spirit2
//
//////////////////////... | TOOL | 0.958182 | 7.780124 |
78299251-44bb-49fb-929e-7b776896a011 | NestZ/competitive-programming | CodeForces/1213B.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
int t;cin >> t;
while(t--){
int n;cin >> n;
vector<int> arr(n);
for(int i = 0;i < n;i++)cin >> arr[i];
int mn = arr[n - 1];
int ans = 0;
for(int i = n - 2;i >= 0;i--){
if(arr[i] > mn)ans++;
else if(arr[i] < mn)mn = ... | ALGO | 0.999805 | 4.7554 |
4330cc57-18dd-4b02-ad74-0fd11d29b06b | RiddhiBarhate/DSA-in-Cpp | leetcode/1940-maximum-xor-for-each-query/1940-maximum-xor-for-each-query.cpp | class Solution {
public:
vector<int> getMaximumXor(vector<int>& nums, int maximumBit) {
int n = nums.size();
vector<int> result(n);
//step-1 : Find the total xor
int XOR = 0;
for(int i = 0; i < n; i++) {
XOR ^= nums[i];
}
//To find flip, first f... | ALGO | 0.999954 | 5.533945 |
30adfb38-711f-40fb-8641-7aeb85428707 | ketan936/college-work | semester7/internet-security/crap/railfence.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
//jumps at 2*(key-1) - 1
char msg[1000];
char data[1000];
char cipher[1000];
char plain_text[1000];
void encrypt()
{
scanf(" %[^\n]",msg);
printf("%s\n",msg);
int i = 0;
int j = 0;
for(i=0;msg[i] != '\0';i++)
{
... | ALGO | 0.999496 | 3.341533 |
b0425def-6cf3-4c9f-a007-7dd1adefe901 | Majrusz/AdventOfCode2022 | days/day03/test.cpp | #include <catch2/catch_all.hpp>
#include "day03.h"
TEST_CASE( "Example input data is handled correctly", "[day03 example]" ) {
using namespace day03;
const std::vector< Rucksack >& container{ util::read< Rucksack >( "days/day03/test.txt", &day03::deserialize ) };
const Rucksacks& rucksacks{ container };
... | TEST | 0.942137 | 6.673599 |
228cc0a7-a2b6-4c98-8eeb-47da254399e4 | HavocR/android_frameworks_av | media/libeffects/lvm/lib/Common/src/BP_1I_D32F32Cll_TRC_WRA_02_Init.cpp | /*-------------------------------------------------------------------------*/
#include "BIQUAD.h"
#include "BP_1I_D32F32Cll_TRC_WRA_02_Private.h"
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* BP_1I_D32F32... | TOOL | 0.991269 | 5.571265 |
f1439e17-e963-44ed-824b-e88a7019dc71 | codeplaysoftware/llvm-leg | lib/CodeGen/MachineTraceMetrics.cpp | #include "llvm/CodeGen/MachineTraceMetrics.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/... | TOOL | 0.981988 | 7.859962 |
234681c8-14a8-4c80-bbf6-0751136142cb | oldground/coding | programmers/코딩테스트 고득점 Kit/그리디/조이스틱.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int solution(string name) {
int answer = 0;
int move = name.length() - 1; // 최악의 경우, 오른쪽으로 끝까지 이동
for (int i = 0; i < name.length(); i++) {
answer += min(name[i] - 'A', 'Z' - name[i] + 1);
... | ALGO | 0.999694 | 4.760231 |
02c38af9-55be-4242-8146-d96d2d5ab59b | sajalpandey/LeetCode_Problems | 22-generate-parentheses/22-generate-parentheses.cpp | class Solution {
public:
void static recursiveFun(vector<string> &result, string str, int l ,int r, int length){
if(str.size()==2*length){
result.emplace_back(str);
return ;
}
if(l<length)
recursiveFun(result, (str+"("), l+1, r,length);
if(r<l)
... | ALGO | 0.999772 | 6.355888 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.