uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
93904849-01ac-4a0a-a592-38d42545eba2 | fanshuoshuo/algorithms | Network Flow/MaxFlow/uva820 - InternetBandwidth.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <cstdio>
#include <map>
#include <algorithm>
#include <cmath>
#include <queue>
#define MAX 150
using namespace std;
class InternetBandwidth{
private:
int s,t;
int n;
int f[MAX][MAX],pre[MAX],c[MAX][MAX];//cֵ f
int a... | ALGO | 0.999886 | 3.914151 |
2fdfeff8-d275-4465-a028-0c88db843cff | Vishal-Agarwal12/Competitive-programming-codes | 1915A.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "debug.h"
#endif
using ll = long long;
using maxheap = priority_queue<ll>; // maxheap
using minheap = priority_queue<ll, vector<ll>, greater<ll>>; // minheap
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#defi... | ALGO | 0.999981 | 5.743454 |
7039dc74-91d4-4a83-a1b3-3cf546ce4c8d | JustJie2002/Leetcode | Problem/Medium/P2487/code.cpp | /********************************************
* author : Jie Chen (3rd Year CS)
* school : Rochester Institute of Technology
* created: 05.05.2024 20:43:16
*********************************************/
using i64 = long long;
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* Lis... | ALGO | 0.999983 | 5.797548 |
ebefa850-2e76-4eab-b923-5b29d04ec18d | happie123happy/DAG-REPRESENTATION | symbol.cpp | #include "symbol.hh"
#include<stdlib.h>
#include<string.h>
SymbolTable::SymbolTable(){
for(int i=0;i<MAX;i++)
hashTable[i]=NULL;
}
//insert into symboltable
int SymbolTable::insert(char *name)
{
//printf("inserting %s into symboltable\n",name);
Bucket *newBucket = (Bucket*)malloc(sizeof(Bucket))... | ALGO | 0.989318 | 3.82743 |
e2b046de-7382-4019-8ddf-0ef63230a8ea | Nabin-09/Data_Structures_and_Algorithms | 7-Stacks-and-Queues/10-Day-Challenge/Stack/Arrays.cpp | // Implementing a stack using arrays
#include<iostream>
using namespace std;
class Stack{
public :
int* arr;
int top;
int size;
Stack(int size){
this->size = size;
arr = new int[size];
top = -1;
}
void push(int element){
if(size - top > 1){
... | ALGO | 0.994247 | 4.992651 |
4b7d70f2-7706-47e8-8817-ea4102d7a997 | Andexenn/Competitive-Programming | TMATH/Các Số Có Tổng Chữ Số Bằng N(HSG 9 TP Vinh).cpp | #include<iostream>
#include<vector>
#include<map>
using namespace std;
void solve(int n){
int cnt=0;
for(int i=1000;i<=9999;i++){
int x=i,sum=0;
while(x>=1){
sum+=x%10;
x/=10;
}
if(sum==n) cnt++;
}
cout<<cnt<<endl;
}
int main(){
int T;cin>>T;
... | ALGO | 0.999404 | 5.516594 |
dfaa219e-84f8-43f9-ab04-76ccc4321cf2 | dhirajpatil2346/compitative | cses/searching_and_sorting/nested_ranges_check.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define endl "\n"
const LL mod = 1e9 + 7;
vector<LL> prefix_function(string s)
{
LL n = (LL)s.length();
vector<LL> pi(n);
for (LL i = 1; i < n; i++)
{
LL j = pi[i - 1];
while (j > 0 && s[i] != s[j])
j = pi[j ... | ALGO | 0.999967 | 3.954664 |
6299c447-7217-4566-bcde-406db485836c | ishandutta2007/codeforces | namnamseo/normal/28/C.cpp | #include <cstdio>
void read(int& a){ scanf("%d",&a); }
void read(double& a){ scanf("%lf",&a); }
template<typename T,typename... Args> void read(T& a,Args&... b){ read(a); read(b...); }
int n,m;
int sz[51];
double dpval[51][51];
double dpcnt[51][51];
double combi[51][51];
void bc(){
int i,j;
combi[0][0]=1;
... | ALGO | 0.999865 | 3.467875 |
2c499802-41d8-42ac-bf55-e913ef0d175b | rinku-mishra/xoopic | physics/ptclgpib.cpp | /*
====================================================================
PARTICLEGROUPIB.CPP
Electrostatic version of ParticleGroup. Assumes infinite B along x1.
Revision History
1.01 kc and dc added to advance particles non-relativistically with and infinte B-field
=================================================... | ALGO | 0.997856 | 4.648233 |
f0c26664-056d-4f9f-a4c3-b2be9db9188d | uditamujumdar/LeetCode | 1325-path-with-maximum-probability/path-with-maximum-probability.cpp | class Solution {
public:
double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succ, int start, int end) {
vector<double>prob(n,0);
vector<vector<pair<int,double>>>adj(n);
for(int i=0;i<edges.size();i++){
int u=edges[i][0];
int v=edges[i][1];
... | ALGO | 0.999931 | 5.53043 |
111de11d-db7c-46bb-97df-5b8fef63dfb2 | papum20/tasks__old | preparazione-OII/[OII]Crazy lights hotel/src/[OII]Crazy lights hotel.cpp | #include <iostream>
using namespace std;
int N, K, mn = 999999999;
bool lights[20];
int t[20];
int turnoff[20][20];
int on = 0;
void ricorsiva(int pos, int tot)
{
cout << pos<<" " <<on<<endl;
for(int i = 0; i<N; i++)
cout<<lights[i];
cout<<endl;
if(pos == N)
return;
else if(on == 1 && lights[K-1] == 1)
m... | ALGO | 0.999732 | 3.490445 |
3ed37f0d-3def-4bab-9e5b-6569e94a3c2d | scbtf/old_shit | src/kernelrecord.cpp | #include "kernelrecord.h"
#include "wallet.h"
#include "base58.h"
#ifdef _MSC_VER
#pragma warning( disable : 4345)
#endif
using namespace std;
bool KernelRecord::showTransaction(const CWalletTx &wtx)
{
if (wtx.IsCoinBase())
{
if (wtx.GetDepthInMainChain() < 2)
{
return false;
... | TOOL | 0.9335 | 5.061444 |
dce7083f-6e92-47dc-a403-cb2cbca3c0c7 | Rajeshnds/Competitive-Programming | codeforces/dragonmas/codeforces(c++)/C_Rotation_Matching.cpp | #include<bits/stdc++.h>
using namespace std;
int n,k,m,a,b;
int main(){
cin>>n;
vector<int>v1(n+1),v2(n);
for(int i=0;i<n;i++)cin>>a,v1[a]=i;
for(int i=0;i<n;i++){
cin>>b;
m=max(m,++v2[(v1[b]-i+n)%n]);
}
cout<<m;
} | ALGO | 0.999878 | 3.670776 |
8a5ea0f3-3cc6-499a-98e8-c78a777f334b | choisw16/algorithm | 10872/main.cpp | #include <iostream>
using namespace std;
int factorial(int n){
if(n==1 || n==0){
return 1;
}
else{
return factorial(n-1)*n;
}
}
int main() {
int n;
cin>>n;
cout<<factorial(n)<<"\n";
return 0;
}
| ALGO | 0.999895 | 5.492582 |
055a5247-926f-4485-866c-0740af3fea0b | snckkund/Cpp | lec42_43_OOPs/types_of_inheritance/hybridInheritance.cpp | #include <iostream>
using namespace std;
// combination of more than one type of inheritance
/**
* [A]
* | \
* | \
* | \
* [B] [C]
* |
* |
* |
* [D]
*/
// hierarchical inherit... | ALGO | 0.985346 | 4.83183 |
833f8e95-89f2-4f46-ab4c-8ecdc020402b | YingnanHan/C-plus-plus-Primer-Plus | Chapter08/08.04 swaps/源.cpp | // swaps.cpp -- swapping with refrence and with pointer
#include<iostream>
using namespace std;
void swapr(int& a, int& b);
void swapp(int* p, int* q);
void swapv(int p, int q);
int main()
{
int wallet1 = 300;
int wallet2 = 350;
cout << "wallet1 = $" << wallet1;
cout << "wallet2 = $" << wallet2 << endl;
cout <... | TOOL | 0.951071 | 5.291828 |
e85c671b-0b02-4188-972f-6109b1d3f7e4 | Avivm122/libfreenect2 | src/registration.cpp | /** @file Implementation of merging depth and color images. */
#define _USE_MATH_DEFINES
#include <math.h>
#include <libfreenect2/registration.h>
#include <limits>
namespace libfreenect2
{
/*
* most information, including the table layout in command_response.h, was
* provided by @sh0 in https://github.com/OpenKine... | ALGO | 0.934479 | 7.304363 |
6ae9ad6d-0e45-4b6c-bec6-831f510b4346 | oxygen-hunter/Flashboom | data/leetcode_cpp/minimum-common-value.cpp | // Time: O(n)
// Space: O(1)
// two pointers
class Solution {
public:
int getCommon(vector<int>& nums1, vector<int>& nums2) {
for (int i = 0, j = 0; i < size(nums1) && j < size(nums2); ) {
if (nums1[i] < nums2[j]) {
++i;
} else if (nums1[i] > nums2[j]) {
... | ALGO | 0.999983 | 5.907052 |
f6ad1c09-9ae8-445b-8bcb-e451e8336ed4 | Technight27/CPP | Stack/reversestack.cpp | #include<bits/stdc++.h>
using namespace std;
void insertatbottom(stack<int>& st, int e){
if(st.empty())
return;
int to=st.top();
st.pop();
insertatbottom(st,e);
st.push(to);
}
void rev(stack<int>& st){
if(st.empty())
return;
int t=st.top();
st.pop();
rev(st);
inser... | ALGO | 0.99992 | 5.220732 |
171e0abb-f1b4-489c-8ba2-a95507890922 | Prajwal-k-tech/cf-solutions | C_War.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const char nl = '\n';
// Author oGhostyyy
/* Thinking: some troy bs , n myrs, i behind i -1 , 0th first , can endure ai
zeus brings them back wtf?
seems obvious so clearly obvious one is TLE, prefix sum to query people dying then binary search correfc... | ALGO | 0.999872 | 4.492936 |
3fc8f0e8-ba4d-4aeb-b61c-5489b2b561c2 | ghts2110/competitive_programing | uva/Tell me the frequencies!/Tell_me_the_frequencies.cpp | #include<iostream>
#include<map>
#include<string>
#include<vector>
#include <algorithm>
using namespace std;
bool comparar2(const pair <int, int>& a, const pair <int, int>& b){
if(a.second < b.second){
return true;
}
else if(a.second==b.second && a.first>b.first){
return true;
}
re... | ALGO | 0.999704 | 3.368224 |
b5ccbe85-7ebb-42aa-afc7-80643646b7e8 | Junbro0708/Python_ForCodingTest | Quiz/071_Train/071_Train.cpp | #include <stack>
#include <iostream>
#include <vector>
using namespace std;
int arr[31];
int main(){
int N;
cin >> N;
for(int i = 0; i < N; ++i){
cin >> arr[i];
}
int curr = 1;
stack<int> list;
vector<char> answer;
for(int i = 0; i < N; ++i){
list.push(arr[i]);
answer.push_back('P');
... | ALGO | 0.999904 | 3.79775 |
45db38b7-7199-477f-8295-bd7ba4ce33b3 | fmorenovr/ComputerScience_UCSP | MCC203-Computacion_Grafica/Trabajo_2_Fast-Winding-Numbers/fast-winding-number-soups/libigl/include/igl/qslim.cpp | #include "collapse_edge.h"
#include "connect_boundary_to_infinity.h"
#include "decimate.h"
#include "edge_flaps.h"
#include "is_edge_manifold.h"
#include "max_faces_stopping_condition.h"
#include "per_vertex_point_to_plane_quadrics.h"
#include "qslim_optimal_collapse_edge_callbacks.h"
#include "quadric_binary_plus_oper... | ALGO | 0.998288 | 6.280062 |
fc9cbc49-129f-4eb2-b705-546319e13c61 | WTlumos/PAT-A | 1065/1065.8.17.cpp | #include<cstdio>
int main()
{
int n;
scanf("%d",&n);
long long a,b,c,sum;
for (int i = 1; i <= n; ++i)
{
scanf("%lld%lld%lld",&a,&b,&c);
sum=a+b;
printf("Case #%d: ", i);
if (a>0&&b>0&&sum<0)
{
printf("true\n");
}else if(a<0&&b<0&&c>=0){
printf("false\n");
}else if(sum>c){
printf("true\n");
... | ALGO | 0.999564 | 3.846212 |
32ce2a3b-fca7-4f3d-bbfa-ff475911f308 | Smeany/Alpecin | Aufgabe 05-04/Aufgabe 05-04.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int ausgabe[9];
int haeufigkeit[] = {0,0,0,0,0,0,0};
for (int i = 0; i < 9; i++)
{
int indexzahl = i + 1;
do
{
cout << "Bitte geben Sie die " << indexzahl << ". Zahl ein: ? ";
cin >> ausgabe[i];
} while (ausgabe[i] > 6 || ausgab... | ALGO | 0.984543 | 3.184572 |
14c9e762-00e1-4b6a-bae1-e61c48e46f90 | ishandutta2007/codeforces | somuchdrama/normal/780/A.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using std::cin;
using std::cout;
using std::cerr;
using std::min;
using std::max;
using std::abs;
using std::pair;
using std::swap;
using std::vector;
using std::set;
using std::map;
using std::string;
using ll = long long;
using pii = pair<int, int>;
... | ALGO | 0.999874 | 3.835444 |
33c258f7-db73-4591-bb65-f346b31787c0 | earlbread/CarND-Extended-Kalman-Filter | src/kalman_filter.cpp | #include <iostream>
#include <cfloat>
#include "kalman_filter.h"
using namespace std;
using Eigen::MatrixXd;
using Eigen::VectorXd;
KalmanFilter::KalmanFilter() {}
KalmanFilter::~KalmanFilter() {}
void KalmanFilter::Init(VectorXd &x_in, MatrixXd &P_in, MatrixXd &F_in,
MatrixXd &H_in, MatrixX... | ALGO | 0.984194 | 5.871673 |
e36607a1-21ce-4fc5-a609-51c33b8a3c3f | hfinkel/llvm-project-cxxjit | llvm/lib/CodeGen/MachineDominators.cpp | #include "llvm/CodeGen/MachineDominators.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
// Always verify dominfo if expensive checking is enabled.
#ifdef EXPENSIVE_CHECKS
static bool VerifyMachineDomInfo = true;
#else
static bool Ve... | ALGO | 0.999409 | 7.725556 |
4880afaf-54c5-47a5-8b7e-927d1aefa320 | sarvex/leetcode-ruby | solution/1400-1499/1461.Check If a String Contains All Binary Codes of Size K/Solution.cpp | class Solution {
public:
bool hasAllCodes(string s, int k) {
int n = s.size();
if (n - k + 1 < (1 << k)) return false;
vector<bool> vis(1 << k);
int num = stoi(s.substr(0, k), nullptr, 2);
vis[num] = true;
for (int i = k; i < n; ++i) {
int a = (s[i - k] - ... | ALGO | 0.999935 | 5.943776 |
dfb57c29-1975-4b48-826f-1990d0f3c320 | baibaixue/acm | hdoj2005②.cpp | #include<stdio.h>
int leap_year(int year)
{
if(year%4==0&&year%100!=0||year%400==0)
return 1;
else
return 0;
}
int main()
{
int year,month,day,days;
int sumdays[12]={0,31,59,90,121,151,181,212,243,273,304,334};
while(scanf("%d/%d/%d",&year,&month,&day)!=EOF)
{
days=sumdays[month-1]+day;
if(leap_year... | ALGO | 0.999925 | 3.219189 |
f6a74a52-1f0c-4d9c-9cda-e5c5c97084ba | Abhijit25Mishra/code-forces | R-834/D_Make_It_Round.cpp | // Aur Bhai Dekhne aagaye ;)
// Author: Abhijit Mishra
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("Ofast")
#pragma GCC optimize(... | ALGO | 0.99991 | 5.107248 |
b242edaf-88f3-4f44-a1c6-12147dceaecc | hokkey621/procon-archive | atcoder.jp/agc018/agc018_a/Main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
int gcd(int a, int b){
if(b == 0)return a;
else return gcd(b, a % b);
}
int main(void){
int n, k;
cin >> n >> k;
vector<int>a(n);
rep(i, n) cin >> a[i];
sort(a.beg... | ALGO | 0.999955 | 4.348531 |
13466f3a-ed24-48e5-b5b8-85e7074468e1 | Rikuya-Matsuo/ProjectEuler | ProjectEuler/ProjectEuler/Task16.cpp | #include "Task16.h"
void Task16::Run()
{
BigNum num(1);
const int base = 2;
const uint32 power = 1000;
for (uint32 i = 0; i < power; ++i)
{
num *= base;
}
num.PrintValue();
uint32 answer = num.CalcDigitSum();
std::cout << "Answer : " << answer << std::endl;
return;
}
const uint16 Task16::BigNum::mSec... | ALGO | 0.999083 | 4.240701 |
790e8e93-730f-404e-b57a-bbd2f7deb889 | samrien005/problem-solving | c++/iteration/fav.cpp.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run a... | ALGO | 0.999835 | 5.356508 |
6201a322-e8d8-4b62-ab47-734974308cbb | Nikhilpri/SPORTS_PROGRAMMING | 3542-maximum-value-sum-by-placing-three-rooks-ii/3542-maximum-value-sum-by-placing-three-rooks-ii.cpp | #include <vector>
#include <array>
#include <algorithm>
#include <climits>
class Solution {
public:
long long maximumValueSum(std::vector<std::vector<int>>& board) {
int numRows = board.size();
int numCols = board[0].size();
long long maxSum = LLONG_MIN;
auto topValues = getTopThre... | ALGO | 0.99966 | 6.54319 |
72efcb3b-e390-4872-b97c-8c528a3ca21e | karroje/RAIDER_eval | RAIDER_current/seqan/share/doc/seqan/html/graph_algo_scc.cpp | #include <iostream>
#include <seqan/graph_algorithms.h>
using namespace seqan;
int main() {
typedef Graph<Directed<> > TGraph;
typedef VertexDescriptor<TGraph>::Type TVertexDescriptor;
typedef EdgeDescriptor<TGraph>::Type TEdgeDescriptor;
typedef Size<TGraph>::Type TSize;
TSize numEdges = 14;
TVertexDescriptor ... | ALGO | 0.997399 | 5.600746 |
b20fca7c-3242-4a6f-8781-607d54a2d701 | openkylin/webkit2gtk | Source/WebCore/rendering/shapes/PolygonShape.cpp | #include "config.h"
#include "PolygonShape.h"
#include <wtf/MathExtras.h>
namespace WebCore {
static inline FloatSize inwardEdgeNormal(const FloatPolygonEdge& edge)
{
FloatSize edgeDelta = edge.vertex2() - edge.vertex1();
if (!edgeDelta.width())
return FloatSize((edgeDelta.height() > 0 ? -1 : 1), 0);... | ALGO | 0.9899 | 7.376407 |
e5f5601e-0ffb-4091-aff6-51cd05ba3cda | Harshpathakjnp/Cplusplus | Untitled-1.cpp | #include <iostream>
using namespace std;
int main()
{
int a[]={1,2,3,4,7,6,11,3};
int size=sizeof(a)/sizeof(int);
int count=0,i;
int p1=0;
int p2;
int maxlength=-1;
for(i=0;i<=size-2;i++)
{
if(a[i]>=a[i+1])
{
p2=i+1;
cout<<p1<<","<<p2-1... | ALGO | 0.999045 | 3.178341 |
16ba7890-1116-43d8-a564-aa30d3765384 | harshprajapati8347/CPP-DSA-CP | Platform Problems/54. Spiral Matrix.cpp | // 54. Spiral Matrix
// Given an m x n matrix, return all elements of the matrix in spiral order.
// Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
// Output: [1,2,3,6,9,8,7,4,5]
// !Algorithm:
// 1. Create a vector to store the result.
// 2. Create four variables to store the boundaries of the matrix.
// 3. While the boun... | ALGO | 0.999987 | 6.661335 |
e6dc0d49-48c0-4b63-850f-cc2d9f3c75c4 | EmptyDust/Algorithm-Codes-and-writeups | codes/-0x10_model/-0x12_sort/merge_a.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int nums[100007];
int cntx(int l,int r){
if(l>=r)return 0;
int mid=l+r>>1;
int ans = cntx(l,mid)+cntx(mid+1,r);
//cout<<ans<<" ";
int k=0,i=l,j=mid+1,tmp[r-l+1];
while(i<=mid&&j<=r){
if(nums[i]<=nums[j])
tmp... | ALGO | 0.999908 | 4.526962 |
8d7ff322-43eb-45ec-8706-eb98162d5fca | Nati892/Defensive_programming_mmn15 | CPPClient/CPPClient/cryptopp/rc2.cpp | // rc2.cpp - originally written and placed in the public domain by Wei Dai
#include "pch.h"
#include "rc2.h"
#include "misc.h"
#include "argnames.h"
NAMESPACE_BEGIN(CryptoPP)
void RC2::Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs ¶ms)
{
AssertValidKeyLength(keyLen);
int eff... | ALGO | 0.952059 | 7.732854 |
84bf5af6-c918-4736-8536-21db0a602910 | manuelTorrealba/ndeAero | cpp_library/EpplerBLFunctions.cpp | /**
* File: EpplerBLFunctions.cpp
* Author: kenobi
*
* Created on Jun 16, 2015, 15:00 PM
*/
#include "EpplerBLFunctions.hpp"
#include <cmath>
#include <algorithm>
namespace nde {
/******************************************************************************/
/* Eppler Regression Functions class *... | ALGO | 0.998579 | 5.76444 |
60ca9a1c-d1f9-4c97-b672-95e4c4653752 | itonsoup/OOP | lab_rab_c++_4/lab_rab_c++_4/lab_rab_c++_4.cpp | #include "student.h"
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <chrono>
using namespace std;
//
#define LOG_DURATION(message, code) \
{ \
auto start_time = chrono::high_resolution_clock::now(); \
code \
auto end_time = chrono::high_resolution_clock::now(); \... | TOOL | 0.989033 | 4.934336 |
29024b47-e16e-4d4e-9055-2749acba41ef | Ayusohm432/Coding | ProblemOfTheDay/Leetcode/2025/05.01.2025_2381. Shifting Letters II.cpp | /*
Problem Link: https://leetcode.com/problems/shifting-letters-ii?envType=daily-question&envId=2025-01-05
*/
/*2381. Shifting Letters II
You are given a string s of lowercase English letters and a 2D integer array shifts where shifts[i] = [starti, endi, directioni]. For every i, shift the characters in s from the in... | ALGO | 0.999956 | 6.862046 |
201bdb99-7e4a-4584-9770-ea28c7ad4523 | DeimosMH/DCH_CppPrimerPlus | exercises/chapter11/ch11_1.cpp | #include <iostream>
#include <cstdlib> // rand(), srand() prototypes
#include <ctime> // time() prototype
#include "ch11_1_vect.h"
#include <fstream>
int main()
{
using namespace std;
using VECTOR::Vector;
srand(time(0)); // seed random-number generator
double direction;
Vector step;
Vector... | ALGO | 0.99305 | 3.503839 |
d8142545-6b6d-4d04-be80-4c16341356e6 | piowik/jimp | lab1/palindrome/Palindrome.cpp | //
// Created by Piotrek on 07.03.2017.
//
#include "Palindrome.h"
#include <iostream>
bool is_palindrome(std::string str) {
const char *characters = str.c_str();
size_t len = str.size();
char reversed[len];
for (int i = 0; i < len; i++) {
reversed[i] = characters[len - 1 - i];
}
rever... | TOOL | 0.902879 | 4.360998 |
fc8a2201-09a7-466f-b9ef-55d4d84dc296 | sju0924/Programing_practice | AlgorithmMembership/0404/boj10162/boj10162.cpp | // boj10162.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include <iostream>
using namespace std;
int main()
{
int A, B, C, D, E, res = 0;
cin >> A >> B >> C >> D >> E;
if (A <= 0) {
res = -C * A + D + B*E;
}
else {
res = (B - A) * E;
}
cout << res;
} | ALGO | 0.999482 | 3.600167 |
20e79458-7063-43a7-9b76-6f2eb3cb8012 | Lydxn/Competitive-Programming | DMOJ/TLE/tle16c6s1.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef pair<int, ll> pill;
typedef pair<pa... | ALGO | 0.999854 | 4.177789 |
b1251589-e2d0-49ad-a3ca-48aadb67c4f3 | ishandutta2007/codeforces | ywwyww/normal/364/D.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<ctime>
#include<utility>
#include<cmath>
#include<functional>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
void sort(int &a,int &b)
{
if(a>b)
swap(a,b);
... | ALGO | 0.999958 | 3.657455 |
2976a309-68fe-4ed5-9928-4c25dd39fdee | safoex/abtm | src/TreeParser.cpp | //
// Created by safoex on 04.03.19.
//
#include "TreeParser.h"
#include "Memory.cpp"
#include <queue>
using namespace std;
namespace bt {
RValueParser::RValueParser(bt::Memory<double> &memory) : m(memory) {}
Action::ActionaryFunction RValueParser::get_actionary_function(std::string const &lvalue,
... | TOOL | 0.889236 | 4.57117 |
dcf6c53b-94db-4c3d-aa88-2352aa9abf84 | raincross7/code-similarity | codes/train_code/problem320/problem320_202.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main(){
int N,M;
cin >> N >> M;
vector<P> item(N);
rep(i,N){ cin >> item[i].first >> item[i].second; }
sort(item.begin(), item.end());
ll ans = 0;
int i=0;
while(M>0){
... | ALGO | 0.999928 | 3.940584 |
749f3a37-94f3-4edf-af25-26ba1825e83a | yida/CodingInterview | simple_list.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class Node {
string value;
Node* next;
Node* prev;
public:
Node(string STR): value(STR), next(NULL), prev(NULL) {}
~Node() {}
void set_str(string STR) { value = STR; }
string get_str() { return value; }
void set_next(Node* n... | ALGO | 0.994242 | 4.80275 |
696fc084-db76-4760-9b87-0d4f632dec13 | sgilliland/4883-Programming_Techniques-Gilliland | Assignments/Easy/11764 - Jumping Mario/source.cpp | // Sarah Gilliland
// UVA 11764 - Jumping Mario
// 4883 - Programming Techniques
#include <iostream>
using namespace std;
int main()
{
int testCases, numWalls, start, height, up, down, i = 0, j;
cin >> testCases;
while (i < testCases)
{
up = 0;
down = 0;
j = 0;
cin >> numWalls;
cin >> sta... | ALGO | 0.999168 | 3.434262 |
25235337-778c-4126-8db3-11b1dc7bf3c7 | amirsuhaill/DSA | 10_STACKS/practice.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int data){
this->data = data;
this->next = NULL;
}
};
class queue{
public:
Node* head;
int size;
queue(){
head = NULL;
size = 0;
}
void push(int data){
Nod... | ALGO | 0.999509 | 4.242941 |
7e531882-c070-454b-b59e-9b592dd25c86 | Amelmal/eagle-eye | libnd4j/include/ops/declarable/helpers/cpu/updaterAdaDelta.cpp | //
// @author Oleh Semeniv (<EMAIL>)
//
#include <ops/declarable/helpers/updatersHelpers.h>
#include <execution/Threads.h>
#include <math/platformmath.h>
#include <math/templatemath.h>
namespace sd {
namespace ops {
namespace helpers {
/////////////////////////////////////////////////////////////////////////////////... | ALGO | 0.99226 | 6.733424 |
b563557f-3ca4-49db-814d-284aa8867a24 | grevutiu-gabriel/calcpi-code | CalculatePIMPFR.cpp | #include "CommonIncludes.h"
#include "CalculatePIMPFR.h"
#include "ProgressIndicatorInterface.h"
const wxString CalculatePIMPFR::algoName_ = wxT("PI: MPFR");
const wxString CalculatePIMPFR::algoDescr_ = wxT("Calculates PI using the routine mpfr_const_pi of the library MPFR.");
const wxString CalculatePIMPFR::copyright... | TOOL | 0.9903 | 5.649332 |
d7628e1a-c2a3-4d3a-8739-602cfb49ad51 | sleeping1943/xzm-gb28181 | 3rd/boost_1_83_0/libs/compute/perf/perf_set_intersection.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/set_intersection.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);... | ALGO | 0.980761 | 5.555636 |
a2ae35e6-1d50-4684-b066-a3283850e9a0 | MaheshSharan/LeetCode_Automation | solutions/0100-0199/0112.Path Sum/Solution.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.999951 | 6.530626 |
1297bdd2-ab8e-45b4-9148-845cabfcfba9 | PeterSommerlad/CPPCourseExpert | workspace/GardenPlanTypeErasure/GardenPlan.cpp | #include "Shapes.h"
#include <algorithm>
#include <iostream>
#include <iterator>
#include <memory>
#include <numeric>
#include <vector>
using namespace std;
using namespace Gardening;
using GardenPlan = vector<Shape>;
void printPlan(GardenPlan const & plan, ostream & out){
copy(plan.begin(), plan.end(), ostream_ite... | ALGO | 0.951017 | 5.988342 |
287a5f44-ca7e-4da9-911a-c5fb73b5f307 | roshandev1/DSA-Implementation | Strings- Char arrays/reverseThe_wordsOfstring.cpp | #include <iostream>
using namespace std;
#include <string.h>
//question is to reverse the words in the string, not characters
//if i/o is "my name is roshan", then o/p will be "roshan is name my"
string getReverse(string temp,int j){
// this is function of getting reverse of a word
int s=j;
int e= temp.length() -1... | ALGO | 0.999894 | 4.634782 |
ec2efda8-edcb-4304-92aa-ae96a8f31504 | RahulK4102/LeetCode | 22-generate-parentheses/generate-parentheses.cpp | class Solution {
public:
void GenParen(int l,int r,vector<string> &ans,int n,string temp){
if(l>n || r>n){
return;
}
if(l<r){
return;
}
if(l==r && r==n){
ans.push_back(temp);
return;
}
temp += '(';
GenPa... | ALGO | 0.999914 | 6.418612 |
f8af073a-00d3-4ec5-9f74-979b963be56f | Wisdom-Labs/Algorand-Unreal-Engine-SDK | Source/Vertices/Private/AES.cpp | #include "AES.h"
#include <string>
AES::AES(const AESKeyLength keyLength) {
switch (keyLength) {
case AESKeyLength::AES_128:
this->Nk = 4;
this->Nr = 10;
break;
case AESKeyLength::AES_192:
this->Nk = 6;
this->Nr = 12;
break;
case AESKeyLength::AES_256:
this->Nk =... | ALGO | 0.914061 | 6.113105 |
2ef6b957-ce68-4058-8de9-3747163e8d88 | FlankerXiong/checkedRM | filter.cpp | #include "filter.h"
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <limits.h>
#include "functions.h"
#include <stdio.h>
bool checkAPath( Par *p,int n,const char * toBeCheck)
{
struct dirent *dp;
DIR * dfd;
if((dfd = opendir(toBeCh... | TOOL | 0.983174 | 3.140568 |
d83aadda-7c9f-4c20-9d09-ed559bc039fb | dotos-next/android_frameworks_av | media/libeffects/testlibs/AudioPeakingFilter.cpp | #include "AudioPeakingFilter.h"
#include "AudioCommon.h"
#include "EffectsMath.h"
#include <new>
#include <assert.h>
#include <cutils/compiler.h>
namespace android {
// Format of the coefficient table:
// kCoefTable[freq][gain][bw][coef]
// freq - peak frequency, in octaves below Nyquist,from -9 to -1.
// gain - gain... | TOOL | 0.978502 | 5.47059 |
f549e881-9329-48fb-9579-a614a3dcc0ef | navanathnavaskar/DataStructure | Tree/SimpleTree/bt_diameter_tree.cpp | #include<iostream>
using namespace std;
struct Node
{
int data;
struct Node* left;
struct Node* right;
};
typedef struct Node node;
node* createNode(int data)
{
node* temp = (node*) malloc(sizeof(node));
temp -> data = data;
temp -> left = temp -> right = NULL;
return temp;
}
int getHeig... | ALGO | 0.999861 | 5.741454 |
35338bbb-346f-46cd-a01a-9faac32385ca | ishandutta2007/codeforces | wiwiho/normal/1180/A.cpp | #include <bits/stdc++.h>
#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define printv(... | ALGO | 0.999871 | 3.662836 |
365154ac-cdfc-4856-99f4-6cf1e9127509 | DeveloperMindset-com/faiss-mobile | faiss/demos/demo_weighted_kmeans.cpp | #include <cstdio>
#include <cstdlib>
#include <memory>
#include <faiss/Clustering.h>
#include <faiss/IndexFlat.h>
#include <faiss/IndexHNSW.h>
#include <faiss/utils/distances.h>
#include <faiss/utils/random.h>
namespace {
enum WeightedKMeansType {
WKMT_FlatL2,
WKMT_FlatIP,
WKMT_FlatIP_spherical,
WKMT... | ALGO | 0.998217 | 6.642188 |
1cd968f3-a85e-47c4-bad0-62859440e360 | kavin23923/Leetcode | contest/199/1.cpp | class Solution {
public:
string restoreString(string s, vector<int>& indices) {
string res = s;
for (int i = 0; i < s.size(); i++) {
res[indices[i]] = s[i];
}
return res;
}
};
| ALGO | 0.998781 | 6.525694 |
d3d6aaac-96ef-4daa-85b8-2c01768438dd | hridaysarder/m-8-dsa-a2 | remove_duplicate.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
void insert_tail(Node *&head, Node *&tail, int val)
{
Node *newNode = new Node(val);
if (head == NULL)
{
head = newNod... | ALGO | 0.999831 | 4.945912 |
9a561342-1ce2-41a8-9af7-aa5850da985b | rahullokhande123/C.plush-plush | Loop Qustion By Me/loopQ2.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cout<<"Enter Number ";
cin>>n;
for(int i=n;i>=1;i--){ // (revarse loop--> for(int i=10;i>=1;i--)
cout<<i<<endl;
}
}
| ALGO | 0.999375 | 3.363247 |
7f14301f-36e0-45e5-b8ed-502051e43e20 | fpGHwd/pat_macos | pat/ANOJ1011.cpp | #include <stdio.h>
#include <queue>
#include <vector>
using namespace std;
static const int max_n = 1000;
static int N, M;
//priority_queue<int, vector<int>, greater<int>> adj[max_n];
static int vis[max_n] = {0};
static vector<int> path, adj[max_n], temp;
static void DFS(int u){ // abstract a n used as a depth and p... | ALGO | 0.999971 | 3.622804 |
fd4a8fc1-b6ed-42fa-b459-f5f3c9dc8033 | Keyu-He/Enhancing-Debugging-Skills-of-LLMs-with-Prompt-Engineering | solutions_correct/algorithms/M/Minimum Operations to Make the Array Alternating/Minimum Operations to Make the Array Alternating.cpp | // Runtime: 775 ms (Top 27.44%) | Memory: 140.3 MB (Top 88.77%)
class Solution {
public:
int minimumOperations(vector<int>& nums) {
int totalEven = 0, totalOdd = 0;
unordered_map<int,int> mapEven, mapOdd;
for(int i=0;i<nums.size();i++) {
if(i%2==0) {
totalEven+... | ALGO | 0.999944 | 5.734756 |
3d65301d-789b-4711-918c-af961c59f1f4 | vladi2703/programming-introduction-fmi | 05-arrays/solutions/03-count.cpp | #include <iostream>
int main() {
const int MAX_NUMBER = 1000;
int count[MAX_NUMBER] =
{}; // съхраняваме броя на срещанията на всяко число от 0 до 999
// count трябва да е нулиран
int N, number;
std::cin >> N;
for (int i = 0; i < N; i++) {
std::cin >> number; // дори не е нужно да съхраним самит... | ALGO | 0.998597 | 5.050223 |
11208b98-0565-4c6e-8331-f078f873178d | farmJun/Programmers_PS | 게임맵최단거리_LV2.cpp | #include<vector>
#include<queue>
#include<tuple>
using namespace std;
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
int dist[101][101];
int solution(vector<vector<int>> maps) {
int n = maps.size();
int m = maps[0].size();
queue<pair<int, int>> q;
q.push({0, 0});
dist[0][0] = 1;
whil... | ALGO | 0.99992 | 5.524922 |
1747f17d-adf9-4596-a1b1-0eb8e793fad0 | akbtech17/dsa | Patterns/pattern-with-zeros.cpp | // pattern - with - zeros.cpp
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
for (int j = 0; j <= i; ++j)
{
if (j == 0 or j == i) cout << i + 1 << "\t";
else cout << 0 << "\t";
}
cout << endl;
}
return 0;
} | ALGO | 0.999878 | 3.650985 |
8c1310f5-5d63-4a18-a0e1-f7878c082ef7 | Falcogiovanni01/Algoritmi-e-strutture-dati | Programmazione_Dinamica/PROVED'ESAME/basemilitare/mio.cpp | #include <bits/stdc++.h>
using namespace std;
// Funzione ricorsiva con memoization
int lisMio(vector<int>& y, vector<vector<int>>& dp, int i, int prevIndex) {
if (i == y.size()) return 0;
if (dp[i][prevIndex + 1] != -1) return dp[i][prevIndex + 1];
// Non prendere y[i]
int noTake = lisMio(y, dp, i +... | ALGO | 0.999989 | 5.595227 |
9cf22a10-99e2-4cc2-aeda-3e4846da79e1 | Elojah/42SchoolProjects | 42/C++/Piscine C++/d07/ex01/src/main.cpp |
#include <string>
#include <iostream>
template<typename T>
void iter(T *array, unsigned int const len, void (*function)(T &t)) {
size_t i(0);
while (i < len)
function(array[i++]);
}
template<typename T>
void stdcout(T &t) {
std::cout << t;
}
int main(void) {
unsigned int a[] = {1138, 42, 1138};
std... | TOOL | 0.915391 | 5.233063 |
f855fee8-3d5a-4610-8e77-66fbb333f6c4 | Bishal16/Codeforces_C | 977C.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long int n,k,i;
cin>>n>>k;
long long a[n];
for(i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
if(k==0)
if(a[0]==1)
{cout<<-1;return 0;}
else
{cout<<1;return 0;}
if(a[k-1]!=a[k] || k==n)
co... | ALGO | 0.999983 | 3.472192 |
b56f5ae0-338f-47ce-8be0-4d767fcfe1bb | coding-school-projects/CPP_Modules | CPP_Solution/cpp02/ex03/bsp.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* bsp.cpp :+: :+: :+: ... | ALGO | 0.998986 | 5.540857 |
3a0b99f3-e331-445f-85a1-316349adc4b6 | sgc109/algorithm_practice | Topcoder/srm505mid.cpp | #include <bits/stdc++.h>
#define REP(i,a,b) for(int i=a;i<=b;++i)
#define FOR(i,n) for(int i=0;i<n;++i)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define inp1(a) scanf("%d",&a)
#define inp2(a,b) scanf("%d%d",&a,&b)
#define inp3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define inp4... | ALGO | 0.997978 | 4.081627 |
db1c2373-eb40-4d32-93d8-9318dac48481 | SergioC20/LAB5 | EJ1_LAB5_SergioCardona_1222419/EJ1_LAB5_SergioCardona_1222419/EJ1_LAB5_SergioCardona_1222419.cpp | // EJ1_LAB5_SergioCardona_1222419.cpp
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include "List.h"
using namespace std;
List* list = new List();
//variables
// Add
int dato_agregar;
// Count
int contador;
// Contains
int buscador;
bool buscar_numero;
// IndexOf
int posicion_inicial;
// LastIndexOf
... | TOOL | 0.990934 | 3.390613 |
6e45105c-5d01-4627-88f3-c9b3e69f66b5 | ishandutta2007/codeforces | andreysergunin/normal/932/B.cpp | #include <iostream>
#include <stdio.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <ctime>
#include <cassert>
#include <unordered_map>
#include <fstream>
#include <random>
#include <cstring>
#inclu... | ALGO | 0.999851 | 3.914795 |
a261adfc-3cf1-40cc-b242-29d020ea237c | rutviknare/Self_DSA_Practice | stack_implementation.cpp | #include<iostream>
using namespace std;
class stack{
public:
int *arr;
int size;
int top;
stack(int v){
this->size=v;
arr=new int[size];
top=-1;
}
void push(int data){
if(size-top>0){
top++;
arr[top]=data;
}
else... | ALGO | 0.997731 | 4.000844 |
bb0c27bb-cd1a-49c8-a30f-acfc8070ee92 | RohitJain3241/Leetcode | DP/Easy/Maximum_Subarray.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums) {
int n = nums.size(),j,mini=-2147483648;
//all negative test case
for(j=0;j<n;j++){
if(nums[j]>=0)
break;
if(nums[j]>mini)
mini = nums[j];
}
if(j==n)
... | ALGO | 0.999964 | 5.877621 |
1b85e80d-8383-4320-a989-dab97faac4a5 | anhdhbn/face-recognition | models/dlib-19.17/dlib/server/server_http.cpp | #include "server_http.h"
namespace dlib
{
// ----------------------------------------------------------------------------------------
namespace http_impl
{
inline unsigned char to_hex( unsigned char x )
{
return x + (x > 9 ? ('A'-10) : '0');
}
const std::string ... | WEB | 0.955014 | 6.005505 |
4b51ae52-e7e7-4fa8-a6f6-382bcab7e3a4 | Stasne/dev-c230 | lab1/src/task4/task4.cpp | #include "task4.h"
#include <random_generator.h>
#include <cmath>
#include <iostream>
#include <thread>
#include <vector>
static size_t ThreadsCount{ 1 };
size_t threadCountialog()
{
const size_t HW_COUNT = std::thread::hardware_concurrency();
size_t threads{ HW_COUNT };
std::cout << "Hardware con... | TOOL | 0.977539 | 4.741008 |
6aac2fed-b930-4353-ba61-5a612b8aa173 | ishandutta2007/codeforces | geothermal/normal/1375/D.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<l... | ALGO | 0.99996 | 4.434275 |
aebc0d0d-e178-4b95-8df2-9e43293d3689 | SharifdotG/SharifdotG-s-CodeVault | Beecrowd/1 - Beginner/2203 - ~/2486 - C Mais ou Menos/2486_CMaisouMenos.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int food;
while (cin >> food && food != 0) {
int total = 0;
while (food--) {
int amount;
string name;
cin >> amount;
getline(cin, name);
if (name == " suco de laranja")
... | TOOL | 0.976918 | 4.170284 |
fbaf734c-0a01-4c3d-9dd7-d15e4d10f4cf | wuguohaoECE/leetcode | 14LongestCommonPrefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
if(strs.size() == 0) return string();
size_t size = strs[0].length();
for(size_t i = 1; i < strs.size(); ++i){
size = min(size, strs[i].length());
}
size_t MaxLength = 0;
while(Max... | ALGO | 0.999672 | 5.702084 |
0234610e-1820-4217-8ec3-5d2ba7848719 | hardik-107/Assignment | C/Array and function/Loop and pattern C/Question 18.cpp | /*
18. Write a C Program to Print the
Multiplication Table
*/
#include<stdio.h>
int main(){
int i,a,n,b;
printf("Enter the number to find table of:");
scanf("%d",&a);
printf("Enter the limit:");
scanf("%d",&n);
for(i=1;i<=n;i++){
b=a*i;
printf("\n %d * %d is %d",a,i,b);
}
} | ALGO | 0.999676 | 3.364605 |
01e44d2a-dfa6-4460-b7dd-9274d6c31c81 | ishandutta2007/codeforces | abc864197532/normal/1605/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
void abc() {cout << endl;}
template <typename T, t... | ALGO | 0.999918 | 4.381902 |
1a6ad5c5-7791-47f2-b1d8-57e42cd8f75a | K14KHaNaSa/bojPractice | 17608.cpp | #include <iostream>
using namespace std;
int h[100000];
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> h[i];
}
int sh = 0;
int ans = 0;
for (int i = n - 1; i >= 0; i--) {
if (h[i] > sh) {
sh = h[i];
ans++;
}
}
... | ALGO | 0.999858 | 3.916358 |
b495bc46-61eb-457f-8d6b-27d77974685a | Muzahid037/Online-Judge-Problems | CodeForces/A. Adding Digits.cpp |
///-----Bismillahir Rahmanir Rahim-----///
#include<bits/stdc++.h>
using namespace std;
///---FAST I/O---///
#define Boost() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
///---DATA TYPE---///
typedef long long ll;
typedef long long int lli;
///vector
typedef vector<int> vi;
typedef vector<ll> vl;
///pair
ty... | ALGO | 0.999513 | 3.134512 |
a3e8002c-a70d-47de-a1f4-d801f1cb3b05 | gim-largerepo/including-investment-59GB | app/stock.cpp | Mind yard push design cut trouble.
Billion attention mention student ago find.
Store everything hope improve far during animal.
Dinner join decade blue agreement.
We recently part.
World body wrong.
Explain stuff positive can significant.
Expert protect appear theory we financial market.
Teacher effect measure easy dev... | TOOL | 0.985116 | 4.455689 |
9b55534f-e8e5-4b1f-89f5-c12d053812db | arsoninstigator/cplusplus | snake-game/main.cpp | #include <iostream>
#include <conio.h>
#include <windows.h>
#include <time.h> // To make spawn value more random
using namespace std;
bool gameOver;
const int width = 20;
const int height = 20;
int x, y, fruitX, fruitY, score;
int tailX[100], tailY[100];
int nTail;
enum eDirecton { STOP = 0, LEFT, RIGHT, UP, DOWN};
eDi... | ALGO | 0.93945 | 4.263096 |
cb525ae9-0920-4498-a21a-25bd3ccb89bc | jrl-umi3218/hsrgbalign | multiSalign_sphericalHomog_hyperspectral2gray.cpp | #include "ceres/ceres.h"
#include "glog/logging.h"
#include "gflags/gflags.h"
//#include "pgm_image.h"
#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/calib3d.hpp>
#include <ceres/cubic_interpolation.h>
#include "multiSre... | TOOL | 0.927092 | 5.210036 |
271dcdc0-f6f8-4d76-9158-5244808616b4 | alexandraback/datacollection | solutions_5652388522229760_0/C++/ksun48/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
main() {
FILE *fin = freopen("A-small-attempt0.in", "r", stdin);
FILE *fout = freopen("A-small-attempt0.out", "w", stdout);
assert( fin!=NULL );
int T;
cin >> T;
for(int t = 1; t <= T; t++){
cout << "Case #" << t << ": ";
int n;
cin >> n;
... | ALGO | 0.999398 | 4.807472 |
6be2eac4-da0b-42b9-a0b8-9c79669cc987 | Yossarian/WesnothAddonServer | game/src/hash.cpp | /* $Id$ */
#include <iostream>
#include <string>
#include "md5.hpp"
#include "hash.hpp"
namespace util {
const std::string itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ;
const std::string hash_prefix = "$H$";
unsigned char* md5(const std::string& input) {
MD5 md5_worker;
md5_worker... | TOOL | 0.90081 | 6.44872 |
5fa2725c-475a-47ae-81f0-468b635159df | smhx/dmoj | a_tree_problem/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
const int MAXN = 5e4+5;
vector<ii> adj[MAXN], ch[MAXN];
int N, dfst = 0, disc[MAXN], finish[MAXN], p[MAXN], c[MAXN];
list<int> s;
void init(int u) {
disc[u] = ++dfst;
for (ii e : adj[u]) {
if (e.second != p[u]) {
p[e.second] = u;
c[e... | ALGO | 0.999986 | 4.142866 |
fca93bbf-280b-434c-9bb4-ebfcf347d5ff | jihunparkme/Problem-Solving | PS_Study/Inflearn/Q22.cpp | #include <cstdio>
int temp[100000];
int main(void)
{
freopen("input.txt", "rt", stdin);
int n, k, i, max = -2147000000, sum = 0;
scanf("%d %d", &n, &k);
for (i = 0; i < n; i++)
scanf("%d", &temp[i]);
for (i = 0; i < k; i++)
sum += temp[i];
for (i = k; i < n; i++)
{
sum = sum + temp[i] - temp[i - k];... | ALGO | 0.999911 | 3.274228 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.