uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
488f8cc0-d748-43bc-8e7b-373d06f545c5 | love-ziji/LanQiaoProvincialCompetition | 2020年第十一届第二场/G.cpp | #include<iostream>
#include<sstream>
using namespace std;
int main()
{
int n;
cin>>n;
int year,month,day;
year=n/10000;
month=n%10000/100;
day=n%100;
day++;
string date,date1,date2,yearStr,monthStr,dayStr;
int monthDay[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int f1=0,f2=0;
while(1) {
if(year%4==0&&ye... | ALGO | 0.999716 | 3.52175 |
4f318505-a6b3-4961-96f8-4d8899e05388 | CD2902/NYUCyberFellowsProgrammingFoundations | C++/Assignments/stringsplitter.cpp | # include <iostream>
# include <string.h>
using namespace std;
string remainingwords(string s)
{
int length = s.length();
string firstword = s.substr(length);
return firstword;
}
int main()
{
string s ;
getline(cin, s);
int middle= s.length()/2;
//cout << "Length " << s.length() << endl;
cout << "Middle chara... | ALGO | 0.999061 | 3.493166 |
f96f8ef3-3d83-473f-8ad3-146216e35419 | Aarush-Shukla/IT | Graphs/Striver/Dijkstra/Cheapest_Flights_Within_K_Stops.cpp | #include <bits/stdc++.h>
using namespace std;
int CheapestFLight(int n, vector<vector<int>> &flights,
int src, int dst, int K)
{
// Create the adjacency list to depict airports and flights in
// the form of a graph.
vector<pair<int, int>> adj[n];
for (auto... | ALGO | 0.999779 | 5.348445 |
c71237be-e20a-4d3f-9039-383b968c0fac | anikruhan7/Algorithm-LabWork | LabWork-4/maxpairproduct.cpp | #include<bits/stdc++.h>
using namespace std;
long pairProduct(int a[],int n){
int la=INT_MIN;
int secla;
for(int i=0; i<n ; i++){
if(a[i]>la)
{
secla=la;
la=a[i];
}else if(a[i]>secla && a[i] !=la)
{
secla=a[i];
}
}
ret... | ALGO | 0.999801 | 4.01116 |
e9f78584-4c2a-4622-8bd5-25377d817856 | ChitrakshiChhabra/Leetcode-Daily-Problems | decodeTheMsg.cpp | #include <iostream>
#include <map>
using namespace std;
int main()
{
string key = "eljuxhpwnyrdgtqkviszcfmabo";
string message = "zwx hnfx lqantp mnoeius ycgk vcnjrdb";
string answer;
map <char, char> subsTable;
int num = 97, count = 0;
for(int i = 0; i < key.size(); i++)
{
if(key[... | ALGO | 0.999961 | 4.305572 |
a825204a-d050-462f-9033-700967fa14bc | yuforest/contests | square_869120_006/a/main.cpp | // ここは競プロではサボりがちです
#include <bits/stdc++.h>
using namespace std;
// デバッグ用マクロです。詳しくは https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
// 節操ないですが、競プロでは便利です。
using ll = long ... | ALGO | 0.999925 | 3.996393 |
dd020cc2-8883-4da6-a164-2f35381b99f2 | poby123/studyAlgorithm | 백준/1701.cpp | // https://www.acmicpc.net/problem/1701
#include <bits/stdc++.h>
using namespace std;
#define fastio cin.tie(0)->sync_with_stdio(0)
#define endl '\n'
#define MAX 5000
int ans;
vector<int> getPartialMatch(const string &N)
{
vector<int> pi(N.size(), 0);
int begin = 1, matched = 0;
while (begin + matched <... | ALGO | 0.999978 | 4.410248 |
ff466612-8e43-4dd0-88ca-bc55482a0e03 | QuickSorting/Codeforces | Ozon Tech Challenge 2020/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int kN = 1007;
set<int> adj[kN];
int dfs(int u, int par = -1){
int cnt = 1;
for(int to: adj[u]){
if(to == par)
continue;
cnt += dfs(to, u);
}
return cnt;
}
pair<int, int> dfs2(int u, int par = -1){
pair<int, int> ret = {u, 0};
for(int to: adj[u]){
... | ALGO | 0.999967 | 3.926041 |
bd32d5cd-f164-4ef4-9b60-0707cdedd575 | chengyiwei/algorithm | xcpc/CCPC2022chongqing/G/G0.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn=1e5+5;
int n;
int read(){
int ret=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-f;ch=getchar();}
while(ch<='9'&&ch>='0')ret=ret*10+ch-'0',ch=getchar();
return ret*f;
}
struct Edge{
int from,to;
LL w;... | ALGO | 0.999969 | 3.771807 |
39972b0b-ed36-410a-8c93-1d980de2dff6 | PrinceSah09/My_LeetCode-Solutions | Finding middle element in a linked list - GFG/finding-middle-element-in-a-linked-list.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void printList(Node* node)
{
while (node != NULL) {
cout << node->data <<" ";
... | ALGO | 0.999747 | 6.122935 |
09205f66-47e6-420b-a8e1-6495a26b21a4 | Baibhavsingh07/Data-structures | 733-flood-fill/flood-fill.cpp | class Solution {
public:
vector<vector<int>> floodFill(vector<vector<int>>& a, int sr, int sc, int color) {
int n=a.size(),m=a[0].size();
vector<vector<int>>ans(n,vector<int>(m,0));
vector<vector<int>>v(n,vector<int>(m,0));
int col = a[sr][sc];
for(int i=0;i<n;i++)
... | ALGO | 0.986512 | 5.617754 |
482f1fd6-e03f-4e20-90ff-f7c4ebc40fa1 | XessX/Angry_Bird_Alike | boost/libs/sort/benchmark/parallel/benchmark_numbers.cpp | //----------------------------------------------------------------------------
/// @file benchmark_numbers.cpp
/// @brief Benchmark of several sort methods with integer objects
///
/// @author Copyright (c) 2017 Francisco José Tapia (<EMAIL> )\n
/// Distributed under the Boost Software License, Version 1.0.\n
/... | TEST | 0.990403 | 6.088411 |
07c84ae5-36e3-4c01-b7ed-2566a3964e9e | fer9828/Cpp_Course | Seccion5_Arreglos y Vectores/Clase 56 - Imprimir un arreglo en orden inverso.cpp | /* Escribe un programa que defina un vector de numeros y muestre
en la salida estandar el vector en orden inverso - del ultimo
al primer elemento */
#include<iostream>
using namespace std;
int main(){
int numeros[] = {1,2,3,4,5};
for (int i = 4; i >= 0; i--)
{
cout<<numeros[i]<<endl;
... | ALGO | 0.999669 | 3.184064 |
947c3798-c399-47c0-855d-6f971f587635 | yaofanghao/cpp | OpenCV/StudyOpenCV/2_16_HoughLine.cpp | // https://docs.opencv.org/4.x/d9/db0/tutorial_hough_lines.html
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
// Declare the output variables
Mat dst, cdst, cdstP;
const char* default... | ALGO | 0.99517 | 5.693481 |
36b2cbf1-1b3f-4259-9211-b35578867bb4 | wtripp/CarND-Extended-Kalman-Filter-Project | src/tools.cpp | #include "tools.h"
#include <iostream>
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/**
* TODO: Calculate the RMSE he... | ALGO | 0.987706 | 6.218879 |
44a96d5a-21c1-4173-81be-49e56bfa7ed7 | T1duS/CompetitiveProgramming | Olympiad/COCI/09-ograda.cpp | /*
Soln: https://github.com/mostafa-saad/MyCompetitiveProgramming/blob/master/Olympiad/COCI/official/2010/contest4_solutions/solutions.pdf
*/
// --------------------------------------------------<TEMPLATE>--------------------------------------------------
// --------------------<optimizations>--------------------
/*
... | ALGO | 0.999827 | 4.244781 |
15b386f0-2a23-4b91-a426-4d44a27e6646 | wyolum/ultim8x8 | arduino/libraries/SD/src/SD.cpp | /*
Implementation Notes
In order to handle multi-directory path traversal, functionality that
requires this ability is implemented as callback functions.
Individual methods call the `walkPath` function which performs the actual
directory traversal (swapping between two different directory/file handles
a... | TOOL | 0.970573 | 5.033165 |
fda3a232-8043-4be4-bbfe-20a9a5fb548d | ishandutta2007/codeforces | laakeri/normal/715/B.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define X real()
#define Y imag()
using namespace std;
typedef long long ll;
typedef long double ld;
int n,m,s,t;
vector<pair<int, int> > g[1010];
ll w[10101];
int a[10101];
int b[10101];
int u1[1010];
ll di1[1010];
int u2[1010];
ll di2[1010];
int is(int id, ... | ALGO | 0.999984 | 3.303378 |
48cfb495-7679-4d4d-8c4b-b8b4c8c3a4dd | ChaerinKim12/LeetCode | 0232-implement-queue-using-stacks/0232-implement-queue-using-stacks.cpp | #include <stack>
class MyQueue {
private:
std::stack<int> stack1, stack2;
public:
MyQueue() {
}
void push(int x) {
stack1.push(x);
}
int pop() {
peek();
int front = stack2.top();
stack2.pop();
return front;
}
int peek() {
... | ALGO | 0.996605 | 5.712378 |
08d4456b-1c11-4420-9777-806ab6293e34 | Manav-Agg/Coding-Blocks-2023 | Data Structure and Algorithm/October 2023/October 09 Stack QPS/Histogram.cpp | #include<iostream>
#include<stack>
using namespace std;
int main(){
int heights[] = {2, 1, 5, 6, 2, 3};
int n = sizeof(heights) / sizeof(int);
int ns[1000], ps[1000];
// Finding Next Smaller
stack<int> s;
s.push(0);
for(int i = 1; i < n; i++){
int ch = heights[i];
while(!s.e... | ALGO | 0.999979 | 4.490166 |
dd13d1ec-66f8-40c9-b468-7dd42e407188 | sarvex/leetcode-rockstar | lcof/面试题43. 1~n整数中1出现的次数/Solution.cpp | class Solution {
public:
int countDigitOne(int n) {
int a[12]{};
int f[12][12];
memset(f, -1, sizeof f);
int i = -1;
for (; n; n /= 10) {
a[++i] = n % 10;
}
function<int(int, int, bool)> dfs = [&](int pos, int cnt, bool limit) -> int {
... | ALGO | 0.999933 | 6.497475 |
bf8910fa-4671-486d-a6fb-711913cebebd | ChillingLiu/Chebyshev-Polynomial-based-Cryptosystem | chebyshev_encryption_evp.cpp | // Author: Xiaoqi LIU, GTIIT
// Date: September 2024
// This program aims test the encryption & decryption of the eveloping method we metioned in paper (we use evp from OpenSSL).
// In order to compile and run this program, you need to install THREE libraries: GMP, MPFR and OpenSSL.
// Compile: g++ -o chebyshev_encry... | ALGO | 0.99932 | 3.211914 |
0a286afc-e73b-48db-935e-3f47a9c340e2 | Ananditha-phindla/LeetCode-DSA | 200-number-of-islands/number-of-islands.cpp | class Solution {
public:
void dfs(vector<vector<char>>& grid,int i,int j){
if(i < 0 || i >= grid.size() || j < 0 || j >= grid[0].size() || grid[i][j] == '0')
return;
grid[i][j] = '0';
dfs(grid,i+1,j);
dfs(grid,i,j+1);
dfs(grid,i-1,j);
dfs(grid,i,j-1);
... | ALGO | 0.999991 | 6.724022 |
171804d3-8d80-48c2-bbcd-4eea6a161a54 | svn2github/CodeBlocks | src/plugins/codecompletion/parser/expression.cpp | #include <sdk.h>
#include <stack>
#ifndef CB_PRECOMP
#include <wx/wx.h>
#endif
#include <logmanager.h>
#include <manager.h>
#include "cclogger.h"
#include "expression.h"
#include "token.h"
#define CC_EXPRESSION_DEBUG_OUTPUT 0
#if defined(CC_GLOBAL_DEBUG_OUTPUT)
#if CC_GLOBAL_DEBUG_OUTPUT == 1
#und... | TOOL | 0.90184 | 4.587986 |
0d7c2c13-7a18-476b-a789-9292e7c417a0 | vikaskumarsingh20/DataStructure-Algorithms | DataStructure-Algorithms/Graphs/minimumKnightMoves.cpp | Input:
N=6
knightPos[ ] = {4, 5}
targetPos[ ] = {1, 1}
Output:
3
Explanation:
Knight takes 3 step to reach from
(4, 5) to (1, 1):
(4, 5) -> (5, 3) -> (3, 2) -> (1, 1).
Your Task:
You don't need to read input or print anything. Your task is to
complete the function minStepToReachTarget() which takes the initial po... | ALGO | 0.999938 | 5.84701 |
cf457602-6c2c-4c11-8245-4e234a8da069 | thalium/icebox | third_party/retdec-3.2/src/bin2llvmir/analyses/traversal/traversal_analysis.cpp | /**
* @file src/bin2llvmir/analyses/traversal/traversal_analysis.cpp
* @brief Implementation of base class for traversal analyses.
* @copyright (c) 2017 Avast Software, licensed under the MIT license
*/
#include <llvm/Support/raw_ostream.h>
#include "retdec/bin2llvmir/analyses/traversal/traversal_analysis.h"
using n... | TOOL | 0.957833 | 6.774346 |
499bbc3f-dd88-472d-9708-1de812802d52 | EESHAN3404/EESHAN_KURHE_FBS_work | C PROGRAMMING/ASSIGNMENTS /ASSIGNMENT 3/Q9.cpp | //Check the given number is Palindrome number or not. Input: n = 121 Output: Palindrome
#include<stdio.h>
int main()
{
int n,rem,sum=0,temp;
printf("Enter the Number :");
scanf("%d",&n);
temp=n;
while(n>0)
{
rem=n%10;
sum=sum*10+rem;
n=n/10;
}
if(temp==sum)
{
printf("Palindrome");
}
else
{
print... | ALGO | 0.999214 | 3.466879 |
bf800593-cbf1-4b1e-8035-752f5790496a | TIPatle/Practice | Practice/likeExpression.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--)
using namespace std;
bool isMatch(string s, st... | ALGO | 0.99992 | 4.371095 |
04c6576c-d562-4586-8398-304639412d56 | vijaymanikantareddy/LeetCode_GFG_solved | 0046-permutations/0046-permutations.cpp | class Solution {
public:
void fun(vector<vector<int>> &res, vector<int> nums, vector<bool>&vis, vector<int> &temp){
if(temp.size() == nums.size()){
res.emplace_back(temp);
return;
}
for(int i = 0 ; i < nums.size() ; i++){
if(!vis[i]){
vis[i... | ALGO | 0.999999 | 6.310343 |
6f9415fb-1b4c-4574-9a15-28edab68a366 | lucasamparo/curso_visao_cimatec | aula_5/src/epipolar.cpp | #include <iostream>
#include <opencv2/opencv.hpp>
int main(int argc, char ** argv) {
cv::Mat image1 = cv::imread(argv[1], 0);
cv::Mat image2 = cv::imread(argv[2], 0);
// vector of keypoints
std::vector<cv::KeyPoint> keypoints1;
std::vector<cv::KeyPoint> keypoints2;
// Construction of the ORB feature dete... | ALGO | 0.962608 | 5.009037 |
122fa728-f18f-427a-9000-14270e9f2077 | ananta-shinde/sep-23 | studentResult.cpp | #include<stdio.h>
int main(int argc, char const *argv[])
{
int p,c,m;
// getting maeks from user
printf("Enter makes in physics :");
scanf("%d",&p);
printf("Enter makes in Chem :");
scanf("%d",&c);
printf("Enter makes in Maths :");
scanf("%d",&m);
int sum = p+c+m;
if(sum >... | ALGO | 0.991165 | 3.805601 |
5cbc2f30-ecc1-4568-8717-ae813a97ca56 | SovietPower/My-OI-ACM | 其它/Hash/BZOJ.4298.[ONTAK2015]Bajtocja(Hash 启发式合并).cpp | /*
75500kb 4628ms
Ҫֻ֪ÿԵ֮ǷͨͬһͼͨǷһ
ǶÿdͼͨŽйϣϣҪܿɾһ һ
ϣֵͬôdͼжͨٶϣֵһϣͬϣֵĸ
ʱʽϲÿνsizeСͨȫfaܸӶO(dnlogn)
*/
#include <cstdio>
#include <cctype>
#include <algorithm>
#define gc() getchar()
typedef unsigned long long ull;
const int N=5005,D=205,M=1e6+5,mod=2e6;
const ull seed=769;
int n,m,d,H[D][N],Enum,to[M<<1],nxt[M<<1],fa[D... | ALGO | 0.999949 | 3.898086 |
e7fd2a5c-91f8-42ec-b98e-50cd2321079b | leonardoAnjos16/Competitive-Programming | Spoj/the_last_digit.cpp | #include <bits/stdc++.h>
using namespace std;
#define size(ds) (int) (ds).size()
#define vi vector<int>
#define pb push_back
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t; cin >> t;
while (t--) {
int a, b;
cin >> a >> b;
vi digs;
int cnt[10] = {... | ALGO | 0.999521 | 4.864084 |
3c73a050-f0fa-40dd-a128-90f18a1a586a | jainhardik120/CodeX | CPP/PrefixEvaluation.cpp | #include <iostream>
#include <stack>
#include <math.h>
using namespace std;
int prefixEvaluation(string s)
{
stack<int> st;
for (int i = s.length() - 1; i >= 0; i--)
{
if (s[i] >= '0' && s[i] <= '9')
{
st.push(s[i] - '0');
}
else
{
int op1 = s... | ALGO | 0.999939 | 4.526977 |
b4474438-4503-4a33-9c0e-a6aadafc9070 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3800_13.cpp | #include <bits/stdc++.h>
int main() {
int n, x;
while (scanf("%d %d", &n, &x) != EOF) {
int cnt = 0;
for (int i = 1; i <= n; i++) {
if (n % i == 0 && (x / i) <= n) cnt++;
}
printf("%d\n", cnt);
}
}
| ALGO | 0.999684 | 3.965652 |
003bf7ce-c008-4dc4-82bf-dde1b82e521e | ishandutta2007/codeforces | pyqe/normal/484/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fr first
#define sc second
long long n,nn[2];
pair<long long,long long> sk[2][1000069];
struct segtree
{
long long l,r,mx,lz=0;
segtree *p[2];
void bd(long long lh,long long rh)
{
l=lh;
r=rh;
if(l==r)
{
mx=0;
}
else
{
... | ALGO | 0.99998 | 3.501066 |
9cd7761f-caa4-41b7-8906-413b22bb94d1 | markdellostritto/ann | src/torch/integrator.cpp | // c
#include <cstring>
// c++
#include <iostream>
#include <string>
// str
#include "str/string.hpp"
// torch
#include "torch/integrator.hpp"
//***********************************************************
// Name (Integrator)
//***********************************************************
Integrator::Name Integrator::N... | ALGO | 0.906338 | 5.695124 |
e8de002a-2db8-4f4c-9326-885def4aa4b7 | ZhekLu/Yandex-Algorithms-Training | contest6/D.cpp | #include <iostream>
using namespace std;
inline bool checkSize(long long protecSize, const long long* params)
{
long long horizontalLocation = (params[3] / (params[1] + 2 * protecSize)) * (params[4] / (params[2] + 2 * protecSize));
long long verticalLocation = (params[3] / (params[2] + 2 * protecSize)) * (pa... | ALGO | 0.998406 | 3.531702 |
375eb381-826b-42e8-99c2-af13c99bd67b | LeHaiDangSPKT/Nam1-Nam2 | 1. Freshman_HKI/NMLT/BT Tuan2 C/Bai 35/Bai 35.cpp | #include <stdio.h>
void nhap(int &a, int &b, int &c, int &d);
int tinh(int a, int b, int c, int d, int &tu, int &mau);
void xuat(int tinh, int tu, int mau);
void main()
{
int a,b,c,d, tu, mau;
nhap(a,b,c,d);
int kq=tinh(a,b,c,d,tu,mau);
xuat(kq, tu, mau);
}
void nhap(int &a, int &b, int &c, int &d)
{
scanf("%d... | ALGO | 0.999726 | 4.079588 |
23366161-329e-479e-84b6-b006f0c0f0dc | chin-may/elevatorsim | cppelev/elevator.cpp | #include <cstdio>
#include <cstdlib>
#include "elevator.h"
#include "consts.h"
#include "queue.h"
#include "Person.h"
elevator::elevator(){
int i;
for(i = 0; i < ELEVATOR_CAP; i++){
passengers[i] = 0;
}
pnum = 0;
location = 0;
delay = 0;
for(i = 0; i< FLOORNUM; i++){
dest[i]... | ALGO | 0.930757 | 3.686522 |
d5bd7f0d-0f01-4e95-820f-0b4b3434a79b | jzakka/LeetCode | 0312-burst-balloons/0312-burst-balloons.cpp | class Solution {
private:
vector<int> nums;
unordered_map<uint64_t , int> DP;
public:
uint64_t hashFourInts(int a, int b, int c, int d) {
return ((uint64_t)a << 48) | ((uint64_t)b << 32) | ((uint64_t)c << 16) | d;
}
int coin(int start, int end, int leftIdx, int rightIdx){
int hashed... | ALGO | 0.999984 | 5.203401 |
0892f8f5-af6d-4b6d-85f1-1e8a41148012 | aritra741/Competitive-Programming | Codeforces/Effective.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long int vas=0,pet=0;
long long int n;cin>>n;
long long int arr1[n];
map <long long int, long long int> pos;
for(long long int i=0;i<n;i++)
{
cin>>arr1[i];
pos[arr1[i]]=i+1;
}
long long int m;
cin>>m;
... | ALGO | 0.999888 | 3.857003 |
131cf8e8-1f9e-4640-ad36-c1c3ade2fbc4 | Satya-100/Leetcode-solved-problems | 0114-flatten-binary-tree-to-linked-list/0114-flatten-binary-tree-to-linked-list.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999974 | 5.93152 |
aee00301-10c6-4e4e-a44d-730da00de2f4 | thegamer1907/Code_Analysis | contest/1542503078.cpp | #include<bits/stdc++.h>
#define optimize ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define pb push_back
using namespace std;
int main()
{
optimize;
double h,m,s,t1,t2,ans = 0;
cin>>h>>m>>s>>t1>>t2;
m= m/5;
s=s/5;
if(h==12) h=0;
if(t1==1... | ALGO | 0.999859 | 3.05742 |
c443a080-1cf6-4fdf-bcde-578e53836928 | AAZZAZRON/DMOJ-Solutions | gfddoc1s4.cpp | #include <iostream>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#define ll long long
#define pii pair<int, int>
#define boost() cin.tie(0); cin.sync_with_stdio(0)
#define scan(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;
#define MAX ... | ALGO | 0.99709 | 4.249461 |
c1a72a99-d2a6-4f90-bd83-9feb2d2c89d4 | roobiul/codeforce | A. Restoring Three Numbers.cpp | #include<iostream>
#include<string>
#include<bits/stdc++.h>
using namespace std;
int main () {
int arr[4];
for (int i=0; i<4; i++)
{
cin >> arr[i];
}
sort(arr,arr+4);
int a,b,c;
c=arr[3]-arr[0];
b=arr[2]-c;
a=arr[3]-(b+c);
cout << a << " "<<b <<" "<< c<< " "<< endl;
return 0;
} | ALGO | 0.999664 | 3.320323 |
8f6ac7f6-020d-4abb-8357-d411eae2432b | raincross7/code-similarity | codes/train_code/problem097/problem097_487.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long h,w;cin>>h>>w;
if(h==1 || w==1){cout<<1;return 0;}
if(h%2==0 || w%2==0)cout<<(h*w)/2;
else cout<<(h*w)/2+1;
} | ALGO | 0.999863 | 3.832952 |
2cb6431a-4bf3-461b-8499-95f456e49aa0 | skullboyers/touchgfx_stm32f429_iios | Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.914648 | 7.471897 |
a12fd138-2788-4c1e-81eb-ea43611e1a49 | dcxcn/leetcode-solutions | 20.valid-parentheses/solution2/main.cpp | #include <algorithm>
#include <iostream>
#include <stack>
using namespace std;
class Solution {
public:
bool isValid(string s) {
}
};
int main() {
Solution s;
std::cout << "OK!" << std::endl;
}
| ALGO | 0.996498 | 4.950469 |
bb3d1531-95e7-4a90-ab61-8823c86cfc0a | raincross7/code-similarity | codes/train_code/problem002/problem002_303.cpp | #include <bits/stdc++.h>
using namespace std;
using in6 = int64_t;
using ind = double;
using vi = vector<in6>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<in6,in6>;
using psi = pair<string,in6>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++... | ALGO | 0.999878 | 3.801686 |
692bcb8e-ea85-4318-8a52-add827df4ff6 | Kupchinsky/Programming | Lab3/main.cpp | #include <iostream>
#include <iomanip>
#include "binarytree.hpp"
using namespace std;
#define out(x) wcout << x << endl
#define strbool(x) (x ? L"Да" : L"Нет")
int main()
{
setlocale(LC_ALL, "Russian");
BinaryTree *mytree = new BinaryTree();
// Заполненное
mytree->push(10);
mytree->push(13);
... | ALGO | 0.985304 | 4.118447 |
8ddc6f32-619c-4f8f-a51e-f8edc93cd75c | TangYuan96/kau-uav-qgc | libs/qwt/qwt_spline.cpp | #include "qwt_spline.h"
#include "qwt_math.h"
class QwtSpline::PrivateData
{
public:
PrivateData():
splineType( QwtSpline::Natural )
{
}
QwtSpline::SplineType splineType;
// coefficient vectors
QVector<double> a;
QVector<double> b;
QVector<double> c;
// control points
... | ALGO | 0.99901 | 6.223684 |
d1b52144-19f2-4add-a796-0ae728998bec | Archangel983/cf-practice | 337A - Puzzles.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
int arr[m];
for (int i = 0; i < m; i++)
{
cin >> arr[i];
}
sort(arr, arr + m);
int least = arr[n - 1] - arr[0];
for (int i = 1; i <= m - n; i++)
{
if (arr[i + n - 1] - arr[i] < lea... | ALGO | 0.999991 | 3.735867 |
071f0bf4-6bbd-48c5-9280-d9617fa02aba | SharathHebbar/Programs | dsa/nnto1rec.cpp | #include<iostream>
using namespace std;
void fun(int n){
if(n <= 0) return;
else
cout<<n<<endl;
fun(n-1);
}
int main(){
fun(5);
return 0;
} | ALGO | 0.999881 | 4.375302 |
714196cf-b83a-45dc-9e22-46f865fd2462 | Nemironov/bioinformatics | Bioinformatics/MotifEnumeration.cpp | #include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
using namespace std;
int HammingDistance(string dna1, string dna2)
{
int hammingdistance = 0;
for (int i = 0; i < dna1.length(); i++) {
if (dna1[i] != dna2[i]) hammingdistance++;
}
... | ALGO | 0.999262 | 5.11384 |
5c1e3544-ea26-4a98-bd3b-b6c295d76450 | Ansh718/LeetCode | 2024/May 24/11-05-24.cpp | class Solution
{
public:
double mincostToHireWorkers(vector<int> &quality, vector<int> &wage, int k)
{
int n = quality.size();
vector<pair<double, int>> workers;
for (int i = 0; i < n; ++i)
{
workers.emplace_back(static_cast<double>(wage[i]) / quality[i], quality[i]);... | ALGO | 0.999925 | 5.042636 |
a7d41a2e-4b4d-4fad-8248-5a7d973067a9 | tiger0132/code-backup | Codeforces/1000~1999/1141/D.cpp | #include <algorithm>
#include <cstdio>
#include <queue>
const int N = 2e5 + 52;
std::queue<int> p[27], q[27], a1, a2;
char a[N], b[N];
int n;
int main() {
scanf("%d%s%s", &n, a, b);
for (int i = 0; i < n; i++) {
p[a[i] == '?' ? 26 : a[i] - 'a'].push(i + 1);
q[b[i] == '?' ? 26 : b[i] - 'a'].push(i + 1);
}
for ... | ALGO | 0.99999 | 3.234491 |
4b193fe3-8c0c-4491-bfca-040bda9a47d0 | mertpasacukur/riscv_llvm | llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | #include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/TargetT... | TOOL | 0.978936 | 3.091049 |
3a3de1c7-972c-4541-ba11-12ae6dd2ffde | asu-crypto/mpsica | thirdparty/linux/boost/libs/spirit/example/x3/calc/calc4c/grammar.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A Calculator example demonstrating generation of AST. The AST,
// once created, is traversed, 1) To print its contents and
// 2) To evaluate the result.
//
// [ JDG April 28, 2008 ] For BoostCon 2008
// [ JDG February 18, 20... | ALGO | 0.862876 | 7.761004 |
86671876-ec13-4c70-b5d0-a9b8cbdec78e | xaemonn/xmon-leetcode | 2150-kth-smallest-product-of-two-sorted-arrays/kth-smallest-product-of-two-sorted-arrays.cpp | class Solution {
public:
typedef long long ll;
ll check(ll x, vector<int>& nums2, long long prod){
ll n2=nums2.size();
ll l=0;
ll r=n2-1;
while(l<=r){
ll mid=(l+r)/2;
if((x<0 && nums2[mid]*x>prod) || (x>=0 && nums2[mid]*x<=prod)){
l=mid+1;
}else{
... | ALGO | 0.999947 | 5.31592 |
a6743eb3-c706-4b01-9840-f949a58b17a5 | heturing/Cpp_primer_solution | ch5/ex5_17.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> v1 = {0,1,1,2};
vector<int> v2 = {0,1,1,2,3,5,8};
auto iter1 = v1.begin();
auto iter2 = v2.begin();
while(iter1 != v1.end()){
if(*iter1 != *iter2){
cout << "false" << endl;
return 0;
}
++iter1;
++iter2;
}
cout <<... | ALGO | 0.996199 | 3.250651 |
762498a6-5da7-4cbe-9995-730232f76b1f | aman-harness/Sports-Programming | spoj/LINEUP.cpp | #include <bits/stdc++.h>
using namespace std;
// ifstream cin("input.txt");
int maxi = 0;
int score[11][11];
int eval(int str, int from, int sum){
if (str == 2047){
if (sum > maxi) maxi = sum;
return 0;
}
for(int temp = 0; temp < 11; temp++){
if(!score[temp][from]) continue;
if(((1 << (temp)) & str)) conti... | ALGO | 0.998 | 4.139757 |
079f7bdc-95ac-4793-9857-8bab58dcc173 | nilay2207/CP | LeetCode/reverse-linked-list/Runtime Error/2-21-2022, 7_16_27 PM/Solution.cpp | // https://leetcode.com/problems/reverse-linked-list
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
... | ALGO | 0.999765 | 5.804762 |
faa5f2bf-f332-45e1-977d-81eb62e6074c | grantathon/nquantlib64 | QuantLib/ql/models/marketmodels/products/onestep/onestepforwards.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/models/marketmodels/products/onestep/onestepforwards.hpp>
#include <ql/models/marketmodels/curvestate.hpp>
#include <ql/models/marketmodels/utilities.hpp>
namespace QuantLib {
OneStepForwards::OneStepForwards(const std::... | ALGO | 0.958016 | 7.72522 |
374fb2b5-fb14-4ad9-aeb6-6653492adc6f | IDA-TUBS/lwW2RP | thirdparty/boost_1_73_0/libs/compute/example/simple_kernel.cpp | #include <iostream>
#include <boost/compute/core.hpp>
namespace compute = boost::compute;
// this example demonstrates how to use the Boost.Compute classes to
// setup and run a simple vector addition kernel on the GPU
int main()
{
// get the default device
compute::device device = compute::system::default_d... | ALGO | 0.985981 | 5.305225 |
85a6e1ac-edab-4c99-bb98-562b4f8e6509 | ishandutta2007/codeforces | theoneyouwant/normal/1267/K.cpp | //By Tushar Gautam
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#define... | ALGO | 0.999728 | 4.014795 |
9ec1ed5f-64a3-4f87-ba5e-c7bfce4fe7fc | christophers090/learningC | leetCode/backtracking/permutations.cpp | class Solution
{
public:
vector<vector<int>> permute(vector<int> &nums)
{
vector<vector<int>> res;
vector<bool> used(nums.size(), false);
vector<int> cur;
dfs(nums, cur, used, res);
return res;
}
dfs(vector<int> &nums, vector<int> &cur, vector<bool> &used, vector... | ALGO | 0.999991 | 6.457984 |
42c070ad-7932-48f2-bed2-1e2622430997 | Developer-Rajesh100/Phitron-CSE | Source Code/Introduction to Algorithms/Module 9/Number_of_Islands.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int n, m;
bool vis[305][305];
vector<pair<int, int>> d = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}};
bool valid(int ci, int cj)
{
if (ci >= 0 && ci < n && cj >= 0 && cj < m)
return true;
else
retu... | ALGO | 0.999954 | 5.759013 |
6ed471e7-9704-40bd-a6a1-4a2ac84a71ca | changsongzhu/leetcode | C++/per_day/07-11-2017/214_h.cpp | /**
214[H]. Shortest Palindrome
Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.
For example:
Given "aacecaaa", return "aaacecaaa".
Given "abcd", return "dcbabcd".
**/
class Solut... | ALGO | 0.999897 | 6.521619 |
1ea81ee7-bea5-48a2-ada5-3530bf3e8036 | Y0NEKO/NanoStereoSeq | FMIndex_build.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <thread>
#include <mutex>
#include <seqan3/search/fm_index/all.hpp>
#include <seqan3/search/fm_index/bi_fm_index.hpp>
#include <seqan3/search/search.hpp>
#include <map>
#include <unordered_set>
#include <cereal/types/unordered_map.hpp>
... | DATA | 0.929886 | 3.849064 |
c6358ab5-3434-4fc7-9baf-4c39af96e6dc | a-farooq/ProblemsAndSolutions | DataStructuresAndAlgorithms/graph/knight-walk-2.cpp | /****
Given a square chessboard of N x N size, the position of Knight and position of a target is given. We need to find out minimum steps a Knight will take to reach the target position.
Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case co... | ALGO | 0.999979 | 5.723274 |
a8b8fb72-5380-4481-9527-c51e2cd0a9eb | Generalnuh/open-cv | modules/features2d/src/fast.avx2.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"
#include "fast.hpp"
#include "opencv2/core/hal/intrin.h... | ALGO | 0.998439 | 6.417374 |
49d0b473-cfcf-4f8f-bf3c-59c85e176f29 | RyanYunruiYang/notes | c++lippman/ch_12/12.06.cpp | /*
Exercise 12.6: Write a function that returns a dynamically allocated vector of ints.
Pass that vector to another function that reads the standard input to give values to
the elements. Pass the vector to another function to print the values that were read.
Remember to delete the vector at the appropriate time.
*/
#in... | TOOL | 0.876776 | 5.262555 |
d9b2e96e-5658-4705-be65-ac1d3ef50877 | holykimmy/Algorithms | backtracking/subset2.cpp | #include <iostream>
using namespace std;
void print_sol(int x[], int arr[], int n,int target)
{
for (int i = 1; i <= n; i++)
{
cout << x[i] << " " ;
}
}
void subset2(int x[], int arr[], int l, int r, int n)
{
if (l == r)
{
print_sol(x, arr, r,n);
int j = (l==0) ? 1... | ALGO | 0.999879 | 4.088727 |
74aeacbd-14ab-460c-8820-221c457db342 | ishandutta2007/codeforces | kirill22/normal/1520/A.cpp | #include<bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const st... | ALGO | 0.999939 | 4.464664 |
4a7221a6-4120-4696-9357-6a688bbd3e99 | niveditavb05/Problem-Solving-practice | trees problem using binary search predicate function.cpp | //SPOJ.com EKO prblem
#include<bits/stdc++.h>
using namespace std;
const int N= 1e6+10;
int n;
long long m;
long long trees[N];
bool iswiidsufficient(int h){
long long wood=0;
for(int i=0;i<n;++i){
if(trees[i] >= high){
wood+=(trees[i]-h);
}
}
return wood >= m;
}
int main(... | ALGO | 0.999995 | 4.627063 |
d0c50368-a516-4cb5-8341-f1ddedf9992b | roy4801/solved_problems | leetcode/1457.cpp | /*
* Leetcode Medium 1457. Pseudo-Palindromic Paths in a Binary Tree
* author: roy4801
* AC(C++)
*/
#include <bits/stdc++.h>
using namespace std;
#include "helper.h"
typedef pair<int, int> P;
typedef long long int LL;
#define arr array
#define PB push_back
#define MP make_pair
#define X first
#define Y second
cla... | ALGO | 0.999886 | 5.261625 |
6606dd6e-d941-4026-8446-f054d79cd8a1 | ymrief/Project-WeatherApp | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
a05ec8f0-e4b9-4d1f-a238-1f708de98cf0 | showmanlee/HowCanISolveThisQuestion | BOJ/1000/1068.cpp | // 트리
// https://www.acmicpc.net/problem/1068
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int main(void) {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
vector<vector<int>> tree(n);
queue<int> q;
for (int i = 0; i < n; i++) {
int p;
... | ALGO | 0.999917 | 4.379594 |
9bf155a1-9484-462c-9578-b8424aa52c12 | MohammadFahad1/Basic_Data_Structures | Remember_Previous_Queries.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
list<int> myList;
int q;
cin >> q;
while (q--)
{
int x, v;
cin >> x >> v;
if (x == 0)
myList.push_front(v);
else if (x == 1)
myList.push_back(v);
else if (x == 2 && int(v) < in... | ALGO | 0.999529 | 3.423555 |
561fdaef-cb62-40b5-9b0f-a77fce8fb128 | ishandutta2007/codeforces | yyt16384/normal/258/D.cpp | #include <cstdio>
#ifdef _WIN32
#define LLFORMAT "I64"
#else
#define LLFORMAT "ll"
#endif
const int MAXN = 1005;
const int MAXM = 1005;
int n, m;
int a[MAXN];
int q[MAXM][2];
double f[MAXN][MAXN];
void init()
{
scanf("%d%d", &n, &m);
for (int i = 0; i < n; ++i)
scanf("%d", &a[i]);
for (int i = 0; i < m; ++i)
... | ALGO | 0.999811 | 3.917576 |
655d94f8-627d-450f-873d-279d88a94234 | iliyian/LuoguOJ | T9391/Part3/P1443/main.cpp | #include <bits/stdc++.h>
using namespace std;
queue<pair<int, int>> q;
array<array<int, 400>, 400> step{};
int dx[] = {-2, -2, -1, 1, 2, 2, 1, -1}, dy[] = {-1, 1, 2, 2, 1, -1, -2, -2};
int main() {
ios::sync_with_stdio(false);
int n, m, x, y;
cin >> n >> m >> x >> y;
x--, y--;
q.push(make_pair(x, y));
s... | ALGO | 0.999688 | 4.881622 |
2d77181c-df7c-4402-b905-b67e48716c4f | Aryan-Jhaa/DSA_C- | neetcode/A3.two_sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
for(int i=0; i<nums.size(); i++){
for(int j=i+1; j<nums.size(); j++){
if(nums[i] + nums[j] == target){
return {i,j};
}
}
}
return {};
}... | ALGO | 0.999809 | 6.214822 |
fedaf618-718b-44ac-9d2a-011215f06e48 | gim-largerepo/including-investment-59GB | src/middle.cpp | Debate the draw will ok.
Discover along total really admit strategy themselves.
Strong bill race city someone who.
Sure your article response agreement control almost give.
Daughter ground partner box until rather.
Stock natural American.
The spring as popular particularly.
Push more game in theory.
A sense TV find joi... | ALGO | 0.945729 | 5.813176 |
e2678327-591d-4470-a7f8-2bc3380e34c9 | oalhait/PictoCal | libraries/tess-two/jni/com_googlecode_tesseract_android/src/classify/adaptmatch.cpp | /*-----------------------------------------------------------------------------
Include Files and Type Defines
-----------------------------------------------------------------------------*/
#ifdef HAVE_CONFIG_H
#include "config_auto.h"
#endif
#include <ctype.h>
#include "shapeclassifier.h"
#include "ambigs.... | ALGO | 0.914505 | 6.138213 |
b3a89ee2-a3e2-44e5-aed9-4dacbd5a6f58 | rockychowdhury/Problem_Solving | A_Doremy_s_Paint_3.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define In_range(i, s, n) for (int i = s; i < n; i++)
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const int N = 1e5 + 5;
const int M = 1e3 + 5;
int i, j;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.... | ALGO | 0.999958 | 4.593171 |
9cc99a9a-9046-4ee4-a4c9-e25ce925a97c | tamofplease/atcoder_abc | 158/D.cpp | #include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
long long modinv(long long a, long long m=MOD) {
long long b = m, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b; swap(a, b);
u -= t * v; swap(u, ... | ALGO | 0.999986 | 3.976688 |
4b8fb7fa-1df1-4633-a37a-4e93eac3d803 | ssudharsan93/graduate_program | Spring 2023/CS 5343/assignment1/hw1_ternary_search.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
// prints the contents of the array, where each element
// is separated by a space and the entire array range
// is determined by the start and end values.
void print_arr_contents(int input[], int start, int end) {
cout... | ALGO | 0.999721 | 5.449056 |
3d88d776-68de-4842-a703-76d0d855eac9 | RuiSiang/chatNT | peer/base64.cpp | #include "base64.h"
#include <algorithm>
using namespace std;
//define charset
static const char *charSet = {"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"};
//transform charset back to short
static unsigned int transform(const unsigned char character)
{
if (character >= 'A' && character <= 'Z... | TOOL | 0.87765 | 5.371736 |
fc2a5faa-f469-4e7b-b227-319b16fd5ba9 | fkfkya/YourDoctor | 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.998733 | 6.76775 |
d0904097-2cb4-48ce-bdbe-c851245e73b2 | lzb991435344/CPlusPlusThings | 02Cplusplus/06practice_exercise/02daypractice/02day02/05汉诺塔.cpp | #include<iostream>
using namespace std;
void move(char A, char B);
void hanoi(int n, char A, char B, char C);
void move(char A, char B)
{
cout << A << "->" << B << endl;
}
void hanoi(int n, char A, char B, char C)
{
if (n == 1)
{
move(A, C);
}
else
{
hanoi(n - 1, A, C, B);
move(A, C);
hanoi(n - 1, B, A,... | ALGO | 0.999954 | 4.905925 |
47bbf02b-36e1-4e38-8f5d-59befe2a4a1c | adityarana14/Linked-List | add_two_linked_list.cpp | class Solution
{
public:
//Function to add two numbers represented by linked list.
struct Node* reverse(struct Node* start)
{
struct Node* current=start;
struct Node* prev=NULL;
struct Node* next=NULL;
while(current!=NULL)
{
next=current-... | ALGO | 0.999939 | 5.78622 |
8e38c88b-0916-4f1f-9afa-2dbf781898f8 | Anamicca23/Leetcode-for-DSA | 3342-find-minimum-time-to-reach-last-room-ii/3342-find-minimum-time-to-reach-last-room-ii.cpp | using namespace std;
struct Pair {
int steps, i, j, move;
Pair(int steps, int i, int j, int move) : steps(steps), i(i), j(j), move(move) {}
bool operator>(const Pair& other) const {
return steps > other.steps;
}
};
class Solution {
public:
static int minTimeToReach(vector<vector<int>>& mov... | ALGO | 0.999984 | 5.966974 |
6047d01a-57bf-4cba-b42f-c145509f1e90 | hasnobrains/cpp | cpp-yellow/week-1/find_max_repetition_count.cpp | #ifdef MYENV
#include <iostream>
#include <map>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
enum class Lang
{
DE,
FR,
IT
};
struct Region
{
string std_name;
string parent_std_name;
map<Lang, string> names;
int64_t population;
};
#endif
auto TieRegionFields... | ALGO | 0.997397 | 4.962114 |
d94837df-0ddd-4fbe-b6d7-d6bf61a1b007 | Colloportus0/MLIRSmith11 | libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// template<input_iterator I, sentinel_for<I> S, weakly_incrementable O>
// requires indirectly_copyable<I, O>
// constexpr ranges::copy_result<I, O> ranges::copy(I first, S last, O result);
// template<input_range R, weakly_incrementable O>
// requires ... | TEST | 0.968119 | 7.597249 |
fc9ee814-b282-4178-aaf7-9a2923842cf2 | EraYaN/ESL | src/tracking-final/main.cpp | #include "meanshift.h"
#include <timing.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#ifndef ARMCC
#include "markers.h"
#endif
#if defined DSP_ONLY && defined FIXEDPOINT
#define VARIANT "final-dsponly-fp"F_IDENT
#elif defined DSP_ONLY
#define VARIANT "final-dsponly"
#elif defined DSP && defined FIXEDPO... | ALGO | 0.882786 | 5.188203 |
7bac46fe-fa27-490d-930e-94223dd4c046 | navmou/strainphobic_swimmer | random_flow/training/2regions/one_one_reward/gradient_xy_trSS.cpp | /***
Strainphobic swimmer
The goal is to train a swimmer that is capable of avoiding high strain regions
The reward function is defined with a trade-off parameter \beta in the way that
\beta = 1 corresponds to a swimmer with the only goal of avoiding high strain regions
and \beta = 0 corresponds to ... | ALGO | 0.998797 | 4.092742 |
d15a4550-7c5f-4edb-9708-c2e119ac848c | Mumbaikar007/Code | CodeChef/Practice/DELISH.cpp | //
// Created by optimus on 11/1/18.
//
# include <iostream>
#include <vector>
using namespace std;
int main(){
int t;
cin >> t;
while ( t -- ){
int n;
cin >> n;
vector <long long> vec(n);
for ( int i = 0 ; i < n ; i++)
cin >> vec[i];
vector <long ... | ALGO | 0.999838 | 4.834171 |
80e0a892-db8a-4ee0-8959-646c7aea3fe5 | youssifalshafey/AlgorithemAndProblemSolving | problemsFrom 41 To 45/turningSecondsToDaysAndOthers.cpp | #include <iostream>
using namespace std;
struct strdaysandOther
{
int days, hours, minuts, seconds;
};
int readAPositiveNumber(string msg)
{
int numebrOfSeconds;
do
{
cout << msg;
cin >> numebrOfSeconds;
} while (numebrOfSeconds <= 0);
return numebrOfSeconds;
}
strdaysandOther... | TOOL | 0.864322 | 4.259269 |
b9e6a129-caa6-4bc7-80f5-73eca98fabbf | yubinbai/pcuva-problems | UVa 12086 - Potentiometers/sol.cpp | #include <cstdio>
#include <vector>
#include <cstring>
using namespace std;
int LSOne(int n)
{
return n & (-n);
}
class FenwickTree
{
private:
vector<int> ft;
public:
FenwickTree(int n)
{
ft.assign(n + 1, 0);
}
int rangeSum(int b)
{
int sum = 0;
for (; b; b -= LSOne... | ALGO | 0.998577 | 3.650608 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.