uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
32b97af1-6b9f-407a-af5d-ebe46777a2ba | KalshuCodes/Previous-Codes-and-Solves-Competitive | Horse_and_Barns.cpp | // Problem
//
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define bs binary_search
#define fs first
#define sn second
#define gri greater<int>
#define cnl(x) cout << x << endl
#define csp(x) cout << x << " "
#define read(x) cin >> x
#define all(v) v.b... | ALGO | 0.999907 | 4.271721 |
91f7f09b-5442-4d7b-9f33-8d9813dfa242 | tasnim-zeba/Problem-Solving | Codeforces/1165D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll t,n,i,j,x,f;
cin>>t;
while(t--)
{
cin>>n;
vector<ll>d(n);
for(i=0;i<n;i++)
{
cin>>d[i];
}
sort(d.begin(),d.end());
x=d[0]*d[n-1];
vector<ll>v;
... | ALGO | 0.999926 | 3.78655 |
958a8b44-dcf7-4d97-8b93-5e234bc7e988 | sanketgautam/Hackerrank_Submissions | submissions/Vector-Erase.cpp | /*-----------------------------------------------------------------------
Problem Title: Vector-Erase
Problem Link: https://www.hackerrank.com/challenges/vector-erase
Author: sanketgautam
Language : C++14
-----------------------------------------------------------------------*/
#include <cmath>
#include <cstdio>
#in... | ALGO | 0.999603 | 4.117135 |
e5811848-c083-4bed-bdd2-685bfe7826d5 | MFHandSimon/C- | 递推算法/昆虫繁殖.cpp | #include<bits/stdc++.h>
using namespace std;
long long int x,y,z,a[101]={0},b[101]={0};
main(){
cin>>x>>y>>z;
for(int i=1;i<=x;i++){
a[i]=1;
b[i]=0;
}
for(int i=x+1;i<=z;i++){
b[i]=y*a[i-x];
a[i]=a[i-1]+b[i-2];
}
cout<<a[z+1]<<endl;
return 0;
}
| ALGO | 0.999987 | 3.209156 |
9c76135e-463d-481d-b16f-c5087b9b142a | lyccrius/OI-Solution | Luogu/P2676 [USACO07DEC]Bookshelf B.cpp | #include <cstdio>
#include <algorithm>
const int maxN = 20000 + 10;
int N, B;
int H[maxN];
long long S = 0;
int main() {
scanf("%d%d", &N, &B);
for (int i = 1; i <= N; i++) scanf("%d", &H[i]);
std::sort(H + 1, H + N + 1);
for (int i = N; i >= 1; i--) {
S += H[i];
if (S >= B) {
printf("%d\n", N - i + 1);
... | ALGO | 0.99994 | 4.209331 |
c555cd70-100b-466d-8ac2-681bc403aefc | danielfmcosta/esda2semestre | TP10/ex02/graph.cpp | /*****************************************************************/
/* Grafo c/ lista de adjacencias | ESDA | LEEC | 2022/23 */
/*****************************************************************/
#include <iostream>
#include <vector>
#include <algorithm>
#include "graph.hpp"
Graph::Graph(int v)
{
if ... | ALGO | 0.998691 | 5.012537 |
24a0d61f-f8d6-4418-ace0-efacf1d01c84 | MohammadAasim/C- | BinarySearch.cpp | #include <bits/stdc++.h>
using namespace std;
int BinarySearch(int n,int arr[],int key){
int s=0;
int e=n-1;
int mid;
while(s<=e){
mid=s+(e-s)/2;
if(arr[mid]==key){
return mid;
}else if(arr[mid]<key){
s=mid+1;
}else{
e=mid-1;
}
... | ALGO | 0.999934 | 5.958806 |
5a9687b6-1eef-49e6-9fbf-ba4684cc7719 | EthanCornell/Cache-replacement-policies | CacheReplacementSimulator.cpp | #include "CacheReplacementSimulator.hpp"
#include <sstream> // For std::ostringstream
#include <iomanip> // For std::setw, std::setprecision
#include <ranges> // For std::ranges::find_if, std::ranges::min_element, etc.
#include <chrono> // For std::chrono::steady_clock, high_resolution_clock
#incl... | ALGO | 0.996655 | 6.08065 |
b51e56d1-a48a-4dcf-917d-0d63fe6ba962 | alexandraback/datacollection | solutions_2645486_0/C++/imzk/1.cpp | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int _max(int a,int b)
{
return a>b?a:b;
}
int main()
{
freopen("T.txt", "w", stdout);
int t,e,r,n;
int v[23];
int dp[55][55];
int i,j,k;
cin>>t;
int ca=1;
while(t--)
{
cin>>e>>r>>n;
for(i=0;i<n;i++)
{
cin>>v[i]... | ALGO | 0.999949 | 3.452843 |
861e9dce-d0e6-4cf3-ab84-b566b79d3773 | ishandutta2007/codeforces | belonogov/normal/144/A.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int a[1000];
int main()
{
// freopen("in", "r", stdin);
// freopen("out", "w", stdout);
int n, i, Min = 10000, Max = -1, pmin, pmax, ans;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%d", &a[i]);
if (a[i] > Max){
... | ALGO | 0.999919 | 3.601952 |
2977a998-e181-4c48-9803-fc9e1a9bf360 | DimensionDev/LatinIME | native/jni/src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.cpp | #include "dictionary/structure/v4/content/dynamic_language_model_probability_utils.h"
namespace latinime {
// Used to provide stable probabilities even if the user's input count is small.
const int DynamicLanguageModelProbabilityUtils::ASSUMED_MIN_COUNTS[] = {8192, 2, 2, 1};
// Encoded backoff weights.
// Note that ... | TOOL | 0.973899 | 7.82555 |
5e53d98d-90ca-4269-93cd-a99235b1f9b1 | dementrock/acm | poj/Archives/1737/7094356_AC_47MS_9520K.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAXN 10000
int n,g[51][MAXN],f[51][MAXN],comb[51][51][MAXN],vis[51][51],tmp[MAXN];
inline int max(int a, int b){return a>b?a:b;}
void print(int f[])
{
int len=f[0];
printf("%d",f[len]);
for(int i=len-1;i>=1;--i)
{
if(f[i]<1000) printf("0");
if(f[i]... | ALGO | 0.999935 | 3.665817 |
dfbb9967-e4b0-4c8b-bcdc-47b5c66691b3 | Neoustc/Interview | Leetcode/110.balancedBinaryTree/110.cpp | //bottom up O(n)
bool isBalanced (TreeNode *root)
{
return dfsHeight(root) != -1;
}
int dfsHeight (TreeNode * root)
{
if (root == NULL) return 0;
int leftHeight = dfsHeight(root -> left);
if (leftHeight == -1) return -1;
int rightHeight = dfsHeight(root -> right);
if (rightHeight == -1) return -1;
... | ALGO | 0.999535 | 5.624332 |
251cba35-7f3e-486e-932a-13ce5ce46b55 | ishandutta2007/codeforces | wxhtzdy/normal/1470/A.cpp | /**
* author: milos
* created: 05.01.2021 19:55:22
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
while (tt--) {
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
... | ALGO | 0.999969 | 3.783619 |
d93a09c6-c3ec-4f08-acaa-4043389a6c71 | HusseinYoussef/Interview-Preparation | leetcode/Medium/Stone Game.cpp | #include <vector>
#include <cstring>
using namespace std;
int n;
int dp[2][505][505];
int solve(vector<int>& piles, bool player, int l, int r)
{
if(r < l)
return 0;
int &ret = dp[player][l][r];
if(~ret)
return ret;
if(player == 0)
return ret = max(solve(piles, 1, l+1, r) + pi... | ALGO | 0.999944 | 4.70651 |
a4855062-34e8-48ba-8d8e-c326dade0d05 | bas4r/certifyport | contract/certify.cpp | #include <eosio/eosio.hpp>
#include <string>
#include <vector>
using namespace std;
using namespace eosio;
CONTRACT certify : public eosio::contract
{
public:
struct signer
{
name name;
bool issigned;
};
private:
TABLE certificate
{
uint64_t id;
string certificatename;
vector<name> participants;
vect... | TOOL | 0.933268 | 6.198434 |
5ecf8b9d-15b2-414e-9596-57b025c6f27b | ankitanshu2020/DSA-Practice-Love-Babbar-course- | To_print_pattern_33.cpp | // To print pattern like this
// 1
// 2 3 2
// 3 4 5 4 3
// 4 5 6 7 6 5 4
// 5 6 7 8 9 8 7 6 5
// for input = 5
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cout << "Please enter the value of n : ";
cin >> n;
for (int i = 1; i <= n; i++)
... | ALGO | 0.999847 | 4.578312 |
7b2916a8-44f0-40eb-840a-94b4a0522d02 | shaktimaan00/30-Days-of-Code | Day1 and Day2/NextSmallerElement.cpp | #include<bits/stdc++.h>
using namespace std;
// #include<bits/stdc++.h>
vector<int> nextSmallerElement(vector<int> &arr, int n)
{
vector<int> v(n);
stack<int> s;
s.push(-1);
for(int i=n-1; i>=0; i--){
while(s.top() >= arr[i])
s.pop();
v[i] = s.top();
s.push(arr[... | ALGO | 0.999998 | 5.266454 |
b470340e-806c-4fb8-be72-4d73493f18a0 | tommytracey/Udacity-CarND-Term3 | p11-path-planning/src/Eigen-3.3/bench/sparse_product.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.980233 | 4.17358 |
7e21988f-4a2b-41b7-8b2c-4e93a6b6596d | hyp3rflow/ProblemSolving | Baekjoon/2749.cpp | #include <iostream>
#include <algorithm>
using namespace std;
unsigned long long n;
int fib[1500000] = {0, 1, 1}, result;
const int R = 1000000;
const int period = 1500000;
int main(){
cin >> n;
for(int i=3; i<period; i++){
fib[i] = (fib[i-1] + fib[i-2])%R;
}
result = fib[n%period];
cou... | ALGO | 0.999971 | 4.297062 |
2107b99f-4029-41d4-962e-e89b341bc9c0 | BlackFrogKok/test | src/libigl/igl/normalize_row_sums.cpp | template <typename DerivedA, typename DerivedB>
IGL_INLINE void igl::normalize_row_sums(
const Eigen::MatrixBase<DerivedA>& A,
Eigen::MatrixBase<DerivedB> & B)
{
#ifndef NDEBUG
// loop over rows
for(int i = 0; i < A.rows();i++)
{
typename DerivedB::Scalar sum = A.row(i).sum();
assert(sum != 0);
}
#e... | ALGO | 0.984007 | 3.816029 |
18237edd-bfcf-481d-ba71-371cb8ee23c0 | MBMariana/face | samples/cpp/videostab.cpp | #include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdexcept>
#include "opencv2/core.hpp"
#include <opencv2/core/utility.hpp>
#include "opencv2/video.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/videostab.hpp"
#inc... | TOOL | 0.90305 | 5.876026 |
1a8e54d0-73ff-4713-ae89-1402f9b1497d | amumu-dev/nokuno | cc/topcoder/StepperMotor.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include... | ALGO | 0.999892 | 4.855272 |
1920c8ac-4cdd-4761-b071-a94e9e564138 | SLIIT-FacultyOfComputing/tutorial-03b-it21803420 | exercise01.cpp | #include <iostream>
using namespace std;
int main() {
float marks[] = {78.4, 90.6, 45.9, 72.2, 54.4};
char names[][20] = {"Ajith", "Wimal", "Kanthi", "Suranji", "Kushmitha"};
cout << "No" << "Name" << "Marks" << endl;
for (int r = 0; r < 5; r++) {
cout << r+1
<< names[r]
<< marks[r] << e... | TOOL | 0.86736 | 3.257607 |
75e3177e-1242-4b0a-8912-4d64d822952e | Alberto1Artoni/intersection | lib/CGAL-5.5.2/examples/Point_set_processing_3/hierarchy_simplification_example.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/IO/read_points.h>
#include <CGAL/IO/write_points.h>
#include <CGAL/hierarchy_simplify_point_set.h>
#include <CGAL/Memory_sizer.h>
#include <CGAL/Timer.h>
#include <vector>
#include <fstream>
// types
typedef CGAL::Exact_predicates_inexact... | ALGO | 0.972815 | 7.429084 |
fda7152b-99cf-4eea-9727-21711e3bc2dc | sahil-sj/DSA-Love-Babbar- | Lecture063 Tree Interview Questions Day1/height.cpp | //Initial template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Function to Build Tree
Node* buildTree(string str)
{
// Corner Case
if(str.... | ALGO | 0.999322 | 6.2516 |
3fbb29dd-2f76-4eb3-b173-304390576ab2 | hieuh0/tesseract-opencv-detect | app/src/main/cpp/tesseract/src/src/training/common/networkbuilder.cpp | #include "networkbuilder.h"
#include "convolve.h"
#include "fullyconnected.h"
#include "input.h"
#include "lstm.h"
#include "maxpool.h"
#include "network.h"
#include "parallel.h"
#include "reconfig.h"
#include "reversed.h"
#include "series.h"
#include "unicharset.h"
namespace tesseract {
// Builds a network with a n... | TOOL | 0.971256 | 6.666568 |
a040ad93-0dd5-422b-9b2b-808890269a15 | ishandutta2007/codeforces | jdurie/normal/1338/C.cpp | #pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
template<class T, class S>
ostream& operator << (ostream &o, const pair<T, S> &p) {
return o << '(' << p.first << ", " << p.second << ')';
}
template<template<class, class...> ... | ALGO | 0.999952 | 3.973512 |
76a1a50f-a7b3-4fc4-9c39-b880626f7b59 | KBentley57/libnoise | src/module/curve.cpp | #include "../interp.h"
#include "curve.h"
#include <algorithm>
using namespace noise::module;
Curve::Curve ():
Module (GetSourceModuleCount ()),
m_pControlPoints (nullptr)
{
m_controlPointCount = 0;
}
Curve::~Curve ()
{
delete[] m_pControlPoints;
}
void Curve::AddControlPoint (double inputValue, double outp... | ALGO | 0.989745 | 7.073346 |
b6867cb0-3f9d-49f8-ba2b-1695105fb24e | milacs1402/unesp | Lab_Program_Comp/Contest-4/A.cpp | #include<bits/stdc++.h>
using namespace std;
int verifica_ano(string num, int y){
num = to_string(y);
if(num[0]!=num[1] && num[0]!=num[2] && num[0]!=num[3] && num[1]!=num[2] && num[1]!=num[3] && num[2]!=num[3]){
return y;
}else{
y++;
return verifica_ano(num, y);
}
}
int main() {... | ALGO | 0.999348 | 3.663526 |
a0b93257-844a-488e-977f-20100e764002 | chiragbalicpp/cpp | pattern(7).cpp | /*
1*****
12****
123***
1234**
12345*
*/
#include<iostream>
using namespace std;
int main()
{
int n; cin>>n;
int i = 1;
for (i=1; i<=n; i++){
int j=1;
for (j=1; j<=i; j++) cout << j;
for (int k=n-i+1; k>1; k--) cout << "*";
cout << endl;
}
}
| ALGO | 0.99995 | 3.712527 |
55ae4489-0f01-450a-9508-d36408ddfc56 | Bogda165/Library | Library/Library.cpp | //
// Library.cpp
// Library
//
// Created by Богдан Коваль on 23.08.2023.
//
#include "Library.hpp"
Library::Library(){
name = "None";
}
Library::Library(string _name){
name = _name;
}
void Library::add(Publication* obj){
inventory.push_back(obj);
}
void Library::del(int index){
inventory.erase(... | TOOL | 0.988503 | 3.927288 |
69aa82c7-70a5-4a03-be1d-8b2ac783e558 | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Secure/7731e8dfbe4a56773be5dc94d631611211156659-10.cpp | Graph* GetConstantGraph(
const Graph* orig_graph, const std::vector<Node*>& nodes,
const std::unordered_map<const Node*, std::vector<Tensor>>&
shape_replacement_map,
std::map<NodeAndOutput, NodeAndOutput>* tensors_to_fetch,
const ConstantFoldNameGenerator& generate_new_name) {
Graph* constant_... | TOOL | 0.934769 | 7.361789 |
a4190067-ff10-4b3d-8ffe-2262a651528b | ruby-kim/Algorithm | [N현직자 특강] All-in-One 직무역량 「알고리즘 교육프로그램」/4주차(190509)/is_sorted.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
template <typename Iter>
void print(Iter begin, Iter end)
{
while (begin != end) {
cout << *begin << " ";
begin++;
}
cout << endl;
}
struct int_compare
{
bool operator()(const int& a, const int& b) const { return a < b... | ALGO | 0.999803 | 5.456515 |
59b46bee-90e9-4543-b37e-e3a4cec9157a | openbsd/src | gnu/llvm/lldb/source/Host/common/FileSystem.cpp | #include "lldb/Host/FileSystem.h"
#include "lldb/Utility/DataBufferLLVM.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/Threading.h"
#include ... | TOOL | 0.870778 | 5.006582 |
c116a9d1-b4e7-4b22-beef-9d7146c760f6 | Sapu30/Data-Structure | Practice C++/functions/functionPrototype.cpp | #include<bits/stdc++.h>
using namespace std;
//Function Prototype : A function prototype is a declaration of the function that tells
// the program about the type of the value returned by the function and
// the number and type of arguments.
//syntex : type function-name (argu... | TOOL | 0.991972 | 3.737257 |
435473da-8bdf-4cc0-8fe3-c956f24150a4 | akashydv311/180-Days-Of-Code | Coder Army/Day-23/classwork/ReverseArray.cpp | #include <iostream>
using namespace std;
void reverseArray1(int arr[], int size)
{
int val;
// reverse
for (int i = 0, j = size - 1; i < size / 2; i++, j--)
{
val = arr[i];
arr[i] = arr[j];
arr[j] = val;
}
// print
for (int i = 0; i < size; i++)
{
cout <<... | ALGO | 0.999661 | 5.010434 |
29e7ef1d-a060-434f-9447-9368ff792f30 | natsukagami/kjudge-api | src/tests/Sandbox/code.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int N;
int A[20];
int main() {
cin >> N;
for (int i = 1; i <= N; ++i) cin >> A[i];
sort(A + 1, A + N + 1);
for (int i = 1; i <= N; ++i) cout << A[i] << ' ';
cout << endl;
}
| ALGO | 0.998961 | 3.777301 |
59fe6167-b8cb-4868-84a6-7fbec5755521 | QaShah07/System_Level_Programming | DSA_in_c++/DP/D_knapsack_form1.cpp | #include <bits/stdc++.h>
using namespace std;
// Self use terminology
#define ll long long
#define ld long double
#define F first
#define S second
using state = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
const int MOD = 1e9 + 7;
// Global variables (if any)
ll n, W;
ll w[101]; // ... | ALGO | 0.999999 | 5.287087 |
e16402ac-730c-4b06-b68d-f4b488059cf2 | JityaBusi/Leetcode | 1938-minimum-operations-to-make-the-array-increasing/minimum-operations-to-make-the-array-increasing.cpp | class Solution {
public:
int minOperations(vector<int>& nums) {
int c=0;
for(int i=1;i<nums.size();i++)
{
int d=(nums[i]-nums[i-1]);
if(d==0)
{
nums[i]+=1;
c+=1;
}
else if(d<0)
{
... | ALGO | 0.999979 | 5.299259 |
2bafff3a-2cce-402b-8ab1-9bbd31c4f507 | Mitesh12ehd/DSA | 15. LInked List/q11_InterSectionPoint.cpp | #include<iostream>
using namespace std;
//Leetcode 160
//Intersection of two linked list
class Node{
public:
int data;
Node* next;
Node(){
this->data = 0;
this->next = NULL;
}
Node(int data){
this->data = data;
this->next = NULL;
}
~Node(){
int ... | ALGO | 0.999633 | 5.010484 |
218f7866-ff00-42ce-a63f-86f06792b975 | martinezdiego/competitive-programming | solutions/Leetcode/May Challenge/Week 2/maximum_points_you can_obtain_from_cards.cpp | // There are several cards arranged in a row, and each card has an associated number of points. The points are given in the integer array cardPoints.
//
// In one step, you can take one card from the beginning or from the end of the row. You have to take exactly k cards.
//
// Your score is the sum of the points of t... | ALGO | 0.999922 | 5.894892 |
d1e9d152-c873-49f7-9ebe-4534c4c72a8c | RedErr404/xrCore-build-2307 | dependencies/MagicSoftware/FreeMagic/Source/Intersection3D/MgcIntr3DSphrCone.cpp | #include "MgcIntr3DSphrCone.h"
using namespace Mgc;
//----------------------------------------------------------------------------
bool Mgc::TestIntersection (const Sphere& rkSphere, const Cone3& rkCone)
{
// TO DO. Add these as members of Cone3 to avoid recomputing on each
// intersection call.
float fIn... | ALGO | 0.996055 | 6.054605 |
05a96910-2215-4302-8b20-dd6644294fd5 | Adiana3308/CrackYourPlacement | Dynamic Programming/29.cpp | class Solution {
public:
int dfs(vector<int>& nums, vector<vector<int>> &dp, int left, int right){
if(left > right){
return 0;
}
if(dp[left][right] > 0)
return dp[left][right];
int result = 0;
for(int i=left; i<=right; i++){
int gain = nums... | ALGO | 0.999991 | 5.467794 |
edc2191d-64fa-47e1-9654-9715e642780d | 2745518585/code | P2709.cpp | #include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
const int N=1000001;
int n,m,k,q,a[N],b[N];
ll s,c[N];
struct str
{
int l,r,t;
}d[N];
bool cmp(str a,str b)
{
if((a.l-1)/q!=(b.l-1)/q) return a.l<b.l;
return a.r<b.r;
}
void add(int x)
{
s+=b[x]*2+1;
++b[... | ALGO | 0.999874 | 3.630695 |
a7dec211-97fe-4134-b737-1315a57a5ec9 | mirzaazwad/Competitive-Programming | SolvedProblems/Codeforces/C_Ski_Resort.cpp | #include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define endl "\n"
#define ll long long
using namespace std;
void solve()
{
int n, k;
ll q;
cin >> n >> k >> q;
vector<ll> a(n);
for (ll &i : a)
cin >> i;
ll count = 0;
ll res = 0;
... | ALGO | 0.999706 | 4.167032 |
7a1fa0bc-15c8-43ba-867b-a7139c71cfc2 | siddharthagar229/Leetcode | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divbloomberg-divdiv-classcompanytagscontainer-tagoccurence2-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-id... | class Solution {
public:
bool isArithmetic(vector<int>& subarray) {
sort(subarray.begin(), subarray.end());
int diff = subarray[1] - subarray[0];
int subarray_size=subarray.size();
for (int i = 2; i < subarray_size; ++i) {
if (subarray[i] - subarray[i - 1] != diff) {
... | ALGO | 0.999914 | 6.224126 |
0acaf9ff-47f1-42c2-8230-863a6799971e | Optimistru/diplom | main.cpp | #include <stdio.h>
#include <iostream>
#include <string.h>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <string.h>
#include <map>
using namespace std;
#define ll long long
#define mp make_pair
ll n, m, k, l, r, x, y, costA;
ll a[1010][1010], ... | ALGO | 0.999877 | 3.691517 |
385d79fb-ca1a-493a-9720-2817b6b2c41c | yxlijun/MfeScoreFollowing | src/EvaluateSfResult.cpp | //
// Created by zhangqianyi on 2017/3/31.
//
#include "EvaluateSfResult.h"
EvaluateSfResult::EvaluateSfResult(ScoreFollowing& scoreFollowing1) : scoreFollowing(scoreFollowing1)
{
//Init();
}
void EvaluateSfResult::Init()
{
sfResult = scoreFollowing.GetSfResult();
scoreEvent = scoreFollowing.GetScoreEvent()... | ALGO | 0.964243 | 4.207242 |
64af7fe5-9905-4863-aa87-d8ec3bc6d3b5 | ranjeetsingh99/cpp | array/stock_buy_and_sell_1_time.cpp | #include<iostream>
#include<climits>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
for ( int i = 0;i < n;i++ )
cin >> a[i];
int min_so_far = INT_MAX, maxprofit = 0;
for ( int i = 0;i < n;i++ ) {
min_so_far = min(a[i], min_so_far);
maxprofit=max(maxprofit... | ALGO | 0.999867 | 3.833956 |
7bdf6acc-6a47-48f7-a0b0-f996c69181b3 | aliefadha/Alipp-belajar-ngodeng | 1431-kids-with-the-greatest-number-of-candies/1431-kids-with-the-greatest-number-of-candies.cpp | class Solution {
public:
vector<bool> kidsWithCandies(vector<int>& candies, int extraCandies) {
int max = *max_element(candies.begin(), candies.end());
vector<bool> result(candies.size());
for(int i=0;i<candies.size();i++){
if(candies[i]+extraCandies>=max){
result... | ALGO | 0.999951 | 5.998362 |
b2b3574b-e362-4dd2-9982-79cc64b9f14c | saumyap48/GeeksforGeeks | Difficulty: Easy/Minimum number of Coins/minimum-number-of-coins.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{
public:
vector<int> minPartition(int N)
{
int currency[]={2000,500,200,100,50,20,10,5,2,1};
int notes=0,i=0;
vector<int>answer;
... | ALGO | 0.999789 | 6.183315 |
42e5cddb-74d8-4d1c-b84f-3523850d334c | khan9t2zishan/gfg-potd | 2023/09 - September/26-09-2023.cpp | /*
Author : Zishan Khan
Date : 26/09/2023
Problem : Find All Four Sum Numbers
Difficulty : Medium
Problem Link : https://practice.geeksforgeeks.org/problems/find-all-four-sum-numbers1732/1
*/
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++... | ALGO | 0.99991 | 5.165038 |
4ed90f17-8035-4362-a3f5-b93bee53880c | nazeer-18/Leetcode-GFG_solved | Reverse a String - GFG/reverse-a-string.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
{
public:
string reverseWord(string a)
{
// Your code goes here
int i = 0,l=a.length();
for(;i<l/2;i++){
... | ALGO | 0.999891 | 6.019848 |
9a210b56-1150-4dd7-ad2f-c328e32bd59d | beatrizdile/leetcode-grind | sliding-window/minimum-size-subarray-sum/minimum-size-subarray-sum.cpp | class Solution {
public:
int minSubArrayLen(int target, vector<int>& nums) {
int left = 0;
int sum = 0;
int minSize = INT_MAX;
for (int right = 0; right < nums.size(); right++) {
sum += nums[right];
while (sum >= target) {
minSize = min(minSize, right - left + 1);
sum = sum - nums[l... | ALGO | 0.999986 | 6.381296 |
d2b91fee-77c0-4d72-ad0c-9027b7459571 | Kushagra-Vatsa/OOPS | TUT67.CPP | #include<iostream>
using namespace std;
// float avg(int x,int y)
// {
// float average=(x+y)/2.0;
// return average;
// }
template<class T1,class T2>
float funcavg(T1 a,T2 b)
{
float avg=(a+b)/2.0;
return avg;
}
template<class T>
void swapp(T &a,T &b)
{
T temp=a;
a=b;
b=temp;
}
int main()... | ALGO | 0.977252 | 4.247086 |
6c5d6752-8577-4d74-9830-fcde97e75ace | Sid9193/studysync | 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 |
8d8cadec-b91f-4153-b6ee-6e1b6ee57484 | visitorckw/leetcode-solution | AC_submissions/99.recover-binary-search-tree.427566416.ac.cpp | /*
* @lc app=leetcode id=99 lang=cpp
*
* [99] Recover Binary Search Tree
*/
// @lc code=start
/**
* 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), l... | ALGO | 0.999997 | 7.166784 |
bd7d90c0-70d4-46e2-9585-8c2445c7a865 | thomaskuestner/CS_MoCo_LAB | reconstruction/gadgetron/CS_LAB_Gadget/src/LAP_GADGET/lap3d.cpp | #include "lap3d.h"
#include "shiftengine3d.h"
#include "gaussianfilterbasis.h"
Gadgetron::LAP3D::LAP3D()
{
}
Gadgetron::LAP3D::LAP3D(const CubeType &I1_, const CubeType &I2_, int levelMin_, int levelMax_)
{
// Check if images have same size
if (I1_.n_rows != I2_.n_rows || I1_.n_rows != I2_.n_rows || I1_.n_rows != I... | ALGO | 0.998657 | 5.416766 |
001a459b-f199-4a98-9830-0b4944169733 | CYRUS-STUDIO/LLVM | libc/src/math/generic/rintf.cpp | #include "src/math/rintf.h"
#include "src/__support/FPUtil/NearestIntegerOperations.h"
#include "src/__support/common.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(float, rintf, (float x)) {
return fputil::round_using_current_rounding_mode(x);
}
} // namespace LIBC_NAMESPACE
| ALGO | 0.984223 | 6.400957 |
9757f618-7ef9-4318-8ace-b13ba1359cf3 | EluvK/LeetCode | algorithm/168.excel表列名称.cpp | /*
* @lc app=leetcode.cn id=168 lang=cpp
*
* [168] Excel表列名称
*/
// @lc code=start
class Solution {
public:
string convertToTitle(int n) {
string res;
while (n) {
n--;
char c = n % 26 + 'A';
res.push_back(c);
n /= 26;
}
reverse(res.... | ALGO | 0.999778 | 6.199042 |
6877098d-d127-445a-aa7b-e589f2694000 | mantidproject/mantid | Framework/Algorithms/src/CalculateCarpenterSampleCorrection.cpp | #include <stdexcept>
namespace Mantid::Algorithms {
DECLARE_ALGORITHM(CalculateCarpenterSampleCorrection) // Register the class
// into the algorithm
// factory
using namespace DataObjects;
using namespace Kerne... | ALGO | 0.995613 | 5.900834 |
8abd2244-60b6-4f0c-995d-a18b5d4136c1 | ishandutta2007/codeforces | speedermen/normal/582/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int MaxN = 305;
const int MaxL = 75;
int n, t, ptr;
int a[MaxN];
int dp[MaxL][MaxN][MaxN];
int cur[MaxN];
vector < int > b;
void combine(int res, int l, int r) {
for (int i = 0; i < (int)b.size(); ++i) {
for (int j = i; j < (int)b.size(); ++j) {
vector... | ALGO | 0.999967 | 4.67173 |
ca5572bf-4c6f-4025-807b-75dfcb17b5a5 | ap1744119/ap1744119 | Lab/Interest_Example/main.cpp | /*
* File: main.cpp
* Author: Alejandra Pesqueira
* Created on June 23, 2014, 7:01 PM
* Purpose:First Program Example
*/
//System Level Libraries
#include <iostream>
#include <cmath>
using namespace std;
//User Defined Libraries
//Global Constants
//Function Prototypes
//Execution Begins Here!
int main(int... | ALGO | 0.997525 | 3.416447 |
778a3fb5-6d3f-4a28-bb1f-b060e7133aff | nays111/algorithm | BOJ/_13116_30번.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
// bool visit[1024];
// int arr[1024];
// void dfs(int index,int target){
// visit[index]=true;
... | ALGO | 0.999961 | 3.381774 |
3a33900e-aea6-4233-bc7a-1a25b9d0d1de | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J02038/poker/poker.cpp | #include <iostream>
#include <cstdio>
using namespace std;
string s[55], c[55] = {"0", "DA", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "DT", "DJ", "DQ", "DK", "CA", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "CT", "CJ", "CQ", "CK",
"HA", "H2", "H3", "H4", "H5", "H6", "H7", "H8", "H9", "HT", "HJ", "HQ", "HK"... | ALGO | 0.996296 | 3.583022 |
79389e26-64e3-458c-bc6d-38c1925ae698 | libaoquan95/LintCode | 第2章-204-斐波那契数列.cpp | #include <iostream>
using namespace std;
class Solution{
public:
/**
* http://www.lintcode.com/zh-cn/ladder/6/-2-204-쳲
* @param n: an integer
* @return an integer f(n)
*/
int fibonacci(int n)
{
int f1 = 0, f2 = 1, f3 = 0;
if(n > 0)
{
if (n == 1)
... | ALGO | 0.999305 | 4.53428 |
495ae507-751d-41e2-955e-502a2fd8b2d8 | yujiaoki/competitive-programming | 精進/2020:10/1430_a.cpp | #include <bits/stdc++.h>
// #include<atcoder/all>
// using namespace atcoder;
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Ror... | ALGO | 0.997684 | 4.04325 |
3ce18834-325c-4f48-ad27-5734a7cf22f2 | NYN31/CompetitiveProgramming | CP/Algorithm/GRAPH_OLD/DFS_cycleDetection.cpp | /*
Cycle detecting using DFS.. (three coloring system)
*/
#include<bits/stdc++.h>
using namespace std;
int vis[100];
vector<int> adj[100];
int parent[100];
int n,e,cnt;
bool ok;
void dfs(int s)
{
vis[s] = 0;
for(int i : adj[s]){
if(vis[i] == -1){
vis[i] = 0;
dfs(i);
}
... | ALGO | 0.999929 | 4.143626 |
65e00eb7-834c-4858-b7c4-7a65d8f830b6 | farzamdorostkar/tmon | llvm-project-17.0.6.src/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires OutputIterator<Iter, RvalueOf<Iter::reference>::type>
// && CopyConstructible<Pred>
// constexpr Iter // constexpr after C++17
// remove_if(Iter first, Iter last, Pred pred);
#include <algorithm>... | TEST | 0.87431 | 7.036469 |
bd6114dc-f13c-409e-8650-8bfcb5167a10 | mwy3055/Algorithm-codes | 2020-ALPS-18th/problem/20201121/2224. 명제 증명/2224-ljh.cpp |
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAX = 52;
int n;
char x, y;
string tmp; // 버리는 문자열
int graph[MAX + 1][MAX + 1];
int ctoi(char c) { return c >= 'A' && c <= 'Z' ? c - 'A' : c - 'a' + 26; }
char itoc(int n) { return n < 26 ? 'A' + n : 'a' + n - 26; }
int main()
{... | ALGO | 0.999741 | 3.861192 |
40d44bdf-a590-4951-9012-eda6accc1cc9 | lunw1024/OI | codejam/21-1B/1.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;
const ll M = 3600 * 12 * ll(1e9);
ll A, B, C, h, m, s, n;
bool solve(ll a, ll b, ll c) {
// cerr << "a = " << a << "b = " << b << "c = " << c << endl;
for (h = 0; h < 12; h++) {
if ((ll(1e9) * 3600 * ... | ALGO | 0.999722 | 4.106618 |
3c809c9c-8348-4f7a-8105-60d7fbf0d2b4 | timothyhollabaugh/notes | Completed/Datastructures/Projects/max_pointer/main.cpp |
#include <iostream>
using namespace std;
int main() {
int n;
cout << "How many values? ";
cin >> n;
int *a = new int[n];
int m;
int *p;
for (int i = 0; i < n; i++) {
int v;
cout << "Enter value #" << i << ": ";
cin >> v;
a[i] = v;
cout << "... | ALGO | 0.99931 | 3.757207 |
e9cc0bed-b320-43e8-b2ed-b6c7c1730fae | tomn2804/Kanalysis | External Dependencies/boost_1_74_0/libs/math/src/tr1/assoc_legendre.cpp | extern "C" double BOOST_MATH_TR1_DECL boost_assoc_legendre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, double x) BOOST_MATH_C99_THROW_SPEC
{
return (m&1 ? -1 : 1) * c_policies::legendre_p BOOST_PREVENT_MACRO_SUBSTITUTION(l, m, x);
}
| TOOL | 0.934929 | 4.375299 |
359323b6-29c6-4e3e-8bac-7fdc730b5dcc | anjalipathak13/Practice-Leetcode-Question | 322-coin-change/322-coin-change.cpp | class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
int n=coins.size();
int dp[n+1][amount+1];
for(int i=0;i<=n;i++)
{
for(int j=0;j<=amount;j++)
{
if(j==0)
dp[i][j]=0;//amt =0
else if(i==... | ALGO | 0.999954 | 5.963456 |
4e6cfab0-7996-4e02-a1ba-df50575f4c28 | codeplaysoftware/sycl-for-cuda | llvm/utils/TableGen/DFAPacketizerEmitter.cpp | #define DEBUG_TYPE "dfa-emitter"
#include "CodeGenSchedule.h"
#include "CodeGenTarget.h"
#include "DFAEmitter.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/Record.h"
#i... | TOOL | 0.96977 | 7.580739 |
00308260-3911-4b0d-a2be-1a14a59dab8d | shriniwas-git/Leetcode-Practice | 424-longest-repeating-character-replacement/longest-repeating-character-replacement.cpp | class Solution {
public:
int characterReplacement(string s, int k) {
int left = 0;
int right = 0;
int n = s.size();
vector<int> hash(26,0);
int mrcf= 0; //max_rep_char_freq
int ans = 0;
while(right<n){
hash[s[right]-'A']++;
mrcf = max(... | ALGO | 0.999992 | 6.285798 |
15435d72-9b37-4f73-a0ab-d2867166f834 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/11/03/15.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <numeric>
using namespace std;
int CandySplitting(vector <int> candies)
{
sort(candies.begin(), candies.end... | ALGO | 0.99984 | 5.116651 |
d4dcbdea-b427-424a-8d73-da8292ee40df | sedhha/problem-solving-with-cpp | problems/countSetBits.cpp | #include <iostream>
using namespace std;
int nBitsInGivenPositiveNumber(int number)
{
int count = 0;
while (number > 0)
{
count += (number & 1);
number = number >> 1;
}
return count;
}
int nBitsFast(int number)
{
int count = 0;
while (number > 0)
{
number = numb... | ALGO | 0.986578 | 5.237731 |
56482f8b-6f60-403f-bfa0-0952ea08d55a | ARAFATH-SH/Problem-Solving | Toph/BlackorWhite.cpp | #include<bits/stdc++.h>
using namespace std;
int32_t main(){
/*freopen("modified_input.txt","r",stdin);
freopen("modified_output.txt","w",stdout);*/
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string a,b; cin>>a>>b;
if((a[a.size()-1]+b[b.size()-1])%2==0){
cout<<"Black\n";
}
else cout<<"White\n";
ret... | ALGO | 0.999971 | 4.140712 |
83f73f5b-1764-4b9b-a19d-0404a4c15f69 | davidatroberts/SoftwareRenderer | src/Lighting.cpp | #include <algorithm>
#include <cmath>
#include <vector>
#include "Lighting.hpp"
#include "MathUtils.hpp"
#include "Model.hpp"
namespace lighting {
// Light Abstract Base Class
Light::Light(Vector model_position, Vector ambient, Vector diffuse,
Vector specular)
:model_position(model_position), ambient(ambient), diff... | TOOL | 0.878349 | 5.918851 |
3c763a28-d8d2-4c33-9add-f77e2fc54733 | apaarkamal/LPU25JAN | class10/stack_next_greater_element.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
stack<int> St;
int next_greater[n];
// next greater element
// decreasing s... | ALGO | 0.999973 | 4.557164 |
1349468c-685d-4d97-879f-df7df8e43ce6 | raincross7/code-similarity | codes/train_code/problem433/problem433_95.cpp | #include <bits/stdc++.h>
//#include "atcoder/all"
using namespace std;
typedef long long ll;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
using pii = pair<int, int>;
const ll mod = 1e9 + 7;
int main() {
int n;
cin >> n;
// a * b + c = n
ll ans = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= ... | ALGO | 0.999842 | 3.48472 |
95faa054-9ca1-4d72-b282-f83dc81fb6e7 | MinhPhuc2k3/CODE-PTIT | DSA03017.cpp | //Le Minh Phuc CN02
#include <bits/stdc++.h>
#define all(x) x.begin(),x.end()
using namespace std;
const int mod=1e9+7;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
int main()
{
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin>>t;
whil... | ALGO | 0.99991 | 3.969139 |
6fdf5fae-8cef-4555-b0ce-95772ad6625d | dewanhimanshu/Undergrad-Courses | data-structures/a1.cpp | #include<iostream>
using namespace std;
#define MAX 100
class DigonalMatrix
{
int b[MAX];
int size;
public:
DigonalMatrix()
{
size = 0;
for(int i=0;i<MAX;i++)
{
b[i] = 0;
}
}
void set()
{
c... | ALGO | 0.995163 | 3.068619 |
a2d1d689-f1b3-4cad-a8ff-ac480c945c78 | ermaccer/T7Hook | T7Hook/unreal/Math.cpp | #include "Math.h"
FRotator FindLookAtRotation(FVector* start, FVector* target)
{
FVector out;
out.X = target->X - start->X;
out.Y = target->Y - start->Y;
out.Z = target->Z - start->Z;
FMatrix mat;
mat.MakeFromX(&out);
FRotator result;
mat.Rotator(&result);
return result;
}
| TOOL | 0.970551 | 4.564409 |
de59e567-1cd6-487e-84d1-d87f520185d7 | laniakea1990/Accelerated-Cplusplus | win-net-source/chapter11/grade_analysis.cpp | #include "Vec.h"
#include <iostream>
#include "analysis.h"
#include "Student_info.h"
using std::cin;
using std::cout;
using std::endl;
int main()
{
// students who did and didn't do all their homework
Vec<Student_info> did, didnt;
// read the student records and partition them
Student_info student;
while (read... | TOOL | 0.930828 | 6.075852 |
f7bba7fc-0eb0-4591-9bc1-a1f67513868d | phpgl/php-bullet | bulletphysics/src/BulletInverseDynamics/MultiBodyTree.cpp | #include "MultiBodyTree.hpp"
#include <cmath>
#include <limits>
#include <vector>
#include "IDMath.hpp"
#include "details/MultiBodyTreeImpl.hpp"
#include "details/MultiBodyTreeInitCache.hpp"
namespace btInverseDynamics
{
MultiBodyTree::MultiBodyTree()
: m_is_finalized(false),
m_mass_parameters_are_valid(true),
... | ALGO | 0.985225 | 6.612608 |
3d252667-a21c-4825-a717-f51a3afd0c53 | arrows-1011/CPro | AOJ/Volume21/2166.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX_T 30
#define MAX_N 100
#define INF 1e9
int N,T,dp[MAX_N+1][MAX_T];
int arr[MAX_N],t[MAX_T],d;
int solve(int idx,int pos){
if(idx == d+1) return 0;
if(dp[idx][pos] != -1){
return dp[idx][pos];
}
int res = INF;
for(int i = 0 ; i < T ; ... | ALGO | 0.999696 | 3.968043 |
84831185-71f3-4d38-8271-a61dd9cafdf1 | tinyan/SystemNNN | nyanWipeLib/effectSimpleWipeCircle.cpp | //
// effectsimplewipecircle.cpp
//
#include <windows.h>
#include <Math.h>
#include "..\nyanLib\include\commonMacro.h"
#include "..\nyanLib\include\picture.h"
#include "..\nyanlib\include\myGraphics.h"
#include "effectsimplewipecommon.h"
#include "effectsimplewipeShape.h"
#include "effectsimplewipeCircle.h"
#include... | TOOL | 0.96399 | 4.251671 |
2ec2455d-fb5e-45c6-9060-75d3fe22449b | orangeistoxic/Numerical_School_Code | P2/P2-(e)-CN.cpp | #define EIGEN_STACK_ALLOCATION_LIMIT 0
#include<bits/stdc++.h>
#include<math.h>
#include<Eigen/Eigen>
#include<iomanip>
#define Pi acos(-1) //定義Pi
using namespace std;
using namespace Eigen;
void NormSolErr_CN(){
const int ReDeltaX=100; //DeltaX的倒數 變更格子大小請在此更動
double DeltaX=(double)1/ReDeltaX;
... | ALGO | 0.999793 | 3.599816 |
001e1a42-3ed3-4251-b0d6-0b61adc85f44 | lovelyLoverDuck/DataStructure_C | 3-Shell Sort.cpp | # include <stdio.h>
# define MAX_SIZE 12
void inc_insertion_sort(int list[], int first, int last, int gap) {
int i, j, key;
for (i = first + gap; i <= last; i = i + gap) {
key = list[i];
for (j = i - gap; j >= first && list[j] > key; j = j - gap) {
list[j + gap] = list[j];
... | ALGO | 0.999793 | 4.24405 |
a3420df2-dcbb-44e7-8bc3-f8000be21798 | KandarpSolanki/CS101_Bubble_Trouble | main.cpp | #include <sstream>
#include "shooter.h"
#include "bubble.h"
// 17.49285568
/* Simulation Vars */
const double STEP_TIME = 0.02;
/* Game Vars */
const int PLAY_Y_HEIGHT = 450;
const int LEFT_MARGIN = 70;
const int TOP_MARGIN = 20;
const int BOTTOM_MARGIN = (PLAY_Y_HEIGHT+TOP_MARGIN);
void move_bullets(vector<Bullet>... | TOOL | 0.891984 | 3.814509 |
78ff6f4d-1180-4438-8bfd-145487b1a899 | pseudo-usama/my-undergrad-coding | 1 Semesters/3/Data structures/Programs/Pre semester self learning/1Linked Lists/1Singly Linked Lists/Linked List Insertion at n_th Position.cpp | // Linked List Insertion at n'th Position.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream"
using namespace std;
struct Node{
int Data;
Node *Next;
};
Node *Head;
void _Insert_at_nth_Position(int _Data, int n) {
Node *Temp = new Node;
Temp->Data = _Data;
if... | ALGO | 0.999305 | 4.993782 |
dbe03896-3c01-4090-b1d4-15d4fe408eb6 | SaranshBangar/GeeksforGeeks-Solutions | Difficulty: Easy/Find the Sum of Last N nodes of the Linked List/find-the-sum-of-last-n-nodes-of-the-linked-list.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
// } Driver Code Ends
class Solution {
public:
/*Structure of the node of the linled list is as
struct Node {
in... | ALGO | 0.999686 | 6.898706 |
c021e6e7-0e0f-4f2d-b87e-b4cba144270c | anuragpratap05/levelup-recursion-and-backtracking | Queens Permutations - 2d As 2d - Box Chooses.cpp | # levelup-recursion-and-backtracking
#include<bits/stdc++.h>
using namespace std;
void queensPermutations(int qpsf, int row, int col, int n, string psf, bool* a)
{
//cout << " row=" << row << "col=" << col << " noq=" << qpsf << " psf=" << psf << endl;
if (row == n)
{
//cout << "row=" << row << endl;
if(qpsf==... | ALGO | 0.999785 | 3.714765 |
6e1dfb21-bcf6-482e-a996-fef9e9949aeb | digitalindustry/nibble | src/qt/guiutil.cpp | #include "guiutil.h"
#include "bitcoinaddressvalidator.h"
#include "walletmodel.h"
#include "bitcoinunits.h"
#include "util.h"
#include "init.h"
#include "base58.h"
#include <QString>
#include <QDateTime>
#include <QDoubleValidator>
#include <QFont>
#include <QLineEdit>
#include <QUrl>
#include <QTextDocument> // For ... | TOOL | 0.898761 | 7.085209 |
c704ab4a-c6b7-4a55-b060-8be2ff8ef3cc | zhenispir/ProLessons | ACMP.ru/8.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int a,b,c; cin>>a>>b>>c;
if (a*b==c) {
cout << "YES";
} else {
cout << "NO";
}
return 0;
}
| ALGO | 0.999936 | 4.017108 |
4834171f-66ba-49c7-954c-d985fbccb881 | NIKITA320495/cpp-codes | DSA/dsa practice/countsmilies.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int countSmileys(vector<string> arr) {
int count = 0;
int n = arr.size();
for (int i = 0; i < n; i++) {
int m = arr[i].length();
for (int j = 0; j < m; j++) { // Adjusted loop condition
if ((arr[i][j... | ALGO | 0.987403 | 5.917423 |
13b557f4-7c9c-4a29-9840-21a7d2df439c | mdalauddin45/Algorithm | Module 10.5/Problem_5.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
const int N=1005;
vector<string>g(N);
int visited[N][N];
int level[N][N];
pii parent[N][N];
int n,m;
int si,sj,di,dj;
vector<pii>direc={{1,0},{-1,0},{0,1},{0,-1}};
bool isValid(int i,int j)
{
return (i>=0 && i<n && j>=0 && j<m);
}
void bfs(int ... | ALGO | 0.999993 | 4.250868 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.