uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1655de33-4967-49da-9562-464108bc4961 | rahultemkar/Logic-Building | program302.cpp | #include<iostream>
using namespace std;
int CountCapital(char *str)
{
static int iCount = 0;
if(*str != '\0')
{
if((*str >= 'A') && (*str <= 'Z'))
{
iCount++;
}
str++;
CountCapital(str);
}
return iCount;
}
int main()
{
char Arr[30];
int ... | ALGO | 0.996375 | 4.559422 |
2d6ab016-1af8-4908-9a24-3d69a282d6eb | yashjain0313/CP | dsa/cses/contests cf/A_Split_the_Multiset.cpp |
#include <bits/stdc++.h>
using namespace std;
#define fr(i,n) for(int i= 0; i < (n); i++)
#define numin(a,n) for(int i=0;i<(n);i++) cin>>a[i];
#define printv(k) for(auto& i:k) cout<<i<<" "; cout<<endl;
#define printmp(k) for(auto& i:k) cout<<i.first<<" "<<i.second<<endl;
#define pb push_back
#define all(x) x.begin(... | ALGO | 0.999883 | 4.044569 |
081ee964-7f73-4e9e-b724-1658bd4e42e0 | xrandx/Practice-Items | kuangbin/adjlist-graph.cpp | /* 20161506146 轣 */
/* Windows 10 / Dev C++ / VScode */
/*ڽӱͼ*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
std::queue <int> q;
const int maxv = 100;
typedef struct edge
{
int v1, v2;
} edge, *edgeptr;
typedef struct adjnode
{
int adjv;
struct adjnode *next;
int w;
} adjnode, *ad... | ALGO | 0.999927 | 3.876091 |
953b67ee-69a0-45a4-a7cd-0b38d6fbb378 | Avuvos/CSES-Solutions | Sorting and Searching/SumOfThreeValues.cpp | //Sum of Three Values - https://cses.fi/problemset/task/1641
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
void solve() {
int n, x;
cin >> n >> x;
vector<pair<int, int>> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i].first;... | ALGO | 0.999933 | 4.79447 |
bd00a7b7-df66-42cc-9e75-4b4a523321e8 | Artotyx/ADS_21B030948 | lab2/A.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
int value;
node* next;
node(int value){
this->value = value;
this->next = NULL;
}
};
struct LinkedList{
int size = 0;
node * head, * tail;
LinkedList(){
this->head = NULL;
this->tail = NULL;
}
... | ALGO | 0.999987 | 4.924476 |
51789ea1-2eb2-48f6-9b18-b5f8f44db8be | ZiajaNieLubieCie3/2e_programowanie_obiektowe | 17.10.2023/zad2.cpp | // zad2.cpp : Ten plik zawiera funkcję „main”. W nim rozpoczyna się i kończy wykonywanie programu.
//
#include <iostream>
using namespace std;
int main()
{
int x;
int y = 1;
cout << "Wprowadz liczbe parzysta: ( 0 konczy dzialanie) ";
cin >> x;
if (x == 0)
{
cout << "Nie wprowadzono zad... | ALGO | 0.997827 | 4.255956 |
704c7e71-716c-4f4a-9a9b-fec01c8ab331 | omagen9466/Docker_Tut | 3DJet/athena_version4/src/pgen/gr_linear_wave.cpp | // C headers
// C++ headers
#include <algorithm> // max(), min()
#include <cmath> // abs(), cbrt(), sin(), sqrt()
#include <cstdio> // fopen(), freopen(), fprintf(), fclose()
#include <cstring> // strcmp()
#include <iostream> // endl
#include <sstream> // stringstream
#include <stdexcept> // runtime... | ALGO | 0.99922 | 6.029986 |
855b18cb-d820-456f-a1e6-91dd0e41cb0a | barntsen/rockseis | lib/bspl.cpp | #include "bspl.h"
namespace rockseis {
/* Constructors*/
template<typename T>
Bspl<T>::Bspl()
{
// Do nothing
}
template<typename T>
Bspl<T>::~Bspl()
{
// Do nothing
}
template<typename T>
void Bspl<T>::bspl(T *h, T *t, int k, T x, int l)
/*<evaluates the (k+1) non-zero b-splines of degree k at t(l) <= x < t(l+1) us... | ALGO | 0.996103 | 4.918735 |
166edaaa-03df-4103-82d3-45b31996df33 | pablo-Acha/Progra-Competitiva | contest/CodeforcesRound1016(Div.3)/c.cpp | #include<bits/stdc++.h>
using namespace std;
bool esPrimo(long long n) {
if (n <= 1) return false; // Los números menores o iguales a 1 no son primos
if (n <= 3) return true; // 2 y 3 son primos
if (n % 2 == 0 || n % 3 == 0) return false; // Eliminar múltiplos de 2 y 3
for (int i = 5; i * i <= n;... | ALGO | 0.999907 | 4.571786 |
b6e0f969-b607-4aef-889e-5be9bb5360e2 | ajinathkumbhar/c_cpp_shell_script_python | c++/STL/template.cpp | #include<stdlib.h>
#include<iostream>
using namespace std;
template<class T>
T getMax(T height,T width){
return height > width ? height : width;
}
int main(int argc, char * argv[]) {
cout << getMax<int>(11,12) << endl;
cout << getMax<float>(11.2,22.1) << endl;
cout << getMax(11.2,22.1) << endl;
re... | ALGO | 0.983214 | 4.10132 |
b3340c9b-0148-4ed3-8c32-599edcffa841 | sumin-03/PS | SCCC/2025-1 SCCC 초급강의/#1_recursion/1780.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> paper;
vector<int> ans(3, 0);
int n;
void func(int x, int y, int size) {
bool same = true;
for(int i = x; i < x + size; i++) {
for(int j = y; j < y + size; j++) {
if(paper[i][j] != paper[x][y]) {
... | ALGO | 0.999953 | 4.238287 |
2e4ae971-f8b3-4150-90fe-9003a4f5a53a | ishandutta2007/codeforces | fsouza/normal/657/A.cpp | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <vector>
using namespace s... | ALGO | 0.999943 | 3.485182 |
d88aae44-4b10-43c6-b926-ebb1edbff4dc | dtc03012/My_Algorithm | codeforces/1500/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef pair<int,int> pi;
typedef pair<lld,lld> pl;
typedef pair<int,lld> pil;
typedef pair<lld,int> pli;
typedef vector<int> vit;
typedef vector<vit> vitt;
typedef vector<lld> vlt;
typedef vector<vlt> vltt;
typedef vector<pi> vpit;
typedef vector... | ALGO | 0.999984 | 3.369586 |
b32035b7-09d2-4101-b218-7b179631357d | jiangdapeng/pat | Advanced Level/1033. To Fill or Not to Fill (25).cpp | /*
* @author: asuwill
* key point: 每次停靠在某个加油站,需要找目前所能到达的最远距离内
* 第一个价格比当前加油站便宜(或者相等)的加油站作为下一个停靠的加油站
* 如果不存在,则前往下一个加油站
*/
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
const int MAX_STATIONS = 500;
struct Station
{
double price;
double dist;
}ss[MAX_STATIONS... | ALGO | 0.999835 | 3.84231 |
7dc84c15-c4b2-41a8-8930-95df2566e7eb | 3d-printing-canada/Longer-LK1-LK2-BL-Touch-Firmware | LK1-Plus-Marlin-Firmware/Marlin/src/module/planner_bezier.cpp | /**
* planner_bezier.cpp
*
* Compute and buffer movement commands for bezier curves
*
*/
#include "../inc/MarlinConfig.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#include "planner.h"
#include "motion.h"
#include "temperature.h"
#include "../Marlin.h"
#include "../core/language.h"
#include "../gcode/queue.h"
// See ... | ALGO | 0.999576 | 7.861976 |
6f7aca32-4215-40e1-851c-0b7ba644e78b | firekeepers/SwordOffer | TopK_40/TopK_40/TopK_40/TopK_40_rbt.cpp | #include <iostream>
#include <set>
#include <vector>
#include <functional>//std::greater
int main()
{
std::vector<int> array = { 4, 5, 1, 6, 2, 7, 3, 8 };
int k = 4;
std::multiset<int, std::greater<int>> container;
container.clear();
for (auto iter = array.begin(); iter != array.end(); iter++)
{
if (container... | ALGO | 0.999946 | 3.958312 |
357f3ff5-bb7c-4b7d-9ccf-9720ee744ec3 | tuhin-cse/ProblemSolvingPractice | Fombinatorial/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t,mod,n,q,r,nr;
cin >> t ;
while(t--)
{
cin >> n >> mod >> q;
while(q--)
{
int p=1;
cin >> r ;
nr=n-r;
if(nr>r)
swap(nr,r);
for(int i=r+1;i... | ALGO | 0.999839 | 3.567372 |
c4795760-57c7-4bb2-9fc2-e87712b53bee | XutaxKamay/source-engine-thirdparty | openal-soft/core/mixer.cpp |
#include "config.h"
#include "mixer.h"
#include <cmath>
#include "devformat.h"
#include "device.h"
#include "math_defs.h"
#include "mixer/defs.h"
struct CTag;
MixerFunc MixSamples{Mix_<CTag>};
std::array<float,MaxAmbiChannels> CalcAmbiCoeffs(const float y, const float z, const float x,
const float spread)
{
... | ALGO | 0.99819 | 5.132654 |
3787e3e5-64e1-4dc7-8b38-d3238a1ca076 | zam-haus/backport-prusa-slicer | src/libslic3r/Arrange/Core/Beds.cpp | namespace Slic3r { namespace arr2 {
BoundingBox bounding_box(const InfiniteBed &bed)
{
BoundingBox ret;
using C = coord_t;
// It is important for Mx and My to be strictly less than half of the
// range of type C. width(), height() and area() will not overflow this way.
C Mx = C((std::numeric_limit... | ALGO | 0.997078 | 7.80527 |
c8752005-f6ed-4e2a-9349-c29e452251ec | psychology50/algorithm-strategies | ch2/2-4/4-9.cpp | #include <iostream>
#include <vector>
using namespace std;
const int MIN = numeric_limits<int>::min();
// A[]의 연속된 부분 구간의 최대 합을 구한다
int inefficientMaxSum(const vector<int> &A) {
int N = A.size(), ret = MIN;
for (int i = 0; i < N; ++i)
for (int j = i; j < N; ++j) {
// 구간 A[i..j]의 합을 구한다
... | ALGO | 0.999693 | 5.467667 |
9321266a-228f-4c73-9b6e-2b7dcc36a336 | info-ruc/web21projects | 2019000163/source/eigen3/doc/examples/tut_arithmetic_matrix_mul.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d mat;
mat << 1, 2,
3, 4;
Vector2d u(-1,1), v(2,0);
std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
std::cout << "Here is mat*u:\n" << mat*u << std::endl;
std::cout << "Here is u^T*mat:\n" << u.transpo... | ALGO | 0.999624 | 3.818773 |
fb6deee8-48d5-4cb7-a767-2b1f4cb1d0d6 | ixjosemi/ED-UGR | P2/practica2/include/vd.cpp | /*************************************************/
/* Implementacion de la plantilla vector dinamico*/
/* Jose Miguel Hernandez Garcia */
/* 2C C3 */
/*************************************************/
// Funcion para modificar el tamaño del vector
template <cl... | TOOL | 0.937771 | 3.980799 |
8e0966ed-83a0-4d92-a27a-2d920f7c5340 | RaghuRumble/CPP-Language | Operators and For Loop/Break_prime_notprime.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
bool divided= false;
for(int d=2; d<n; d++){
if(n % d ==0){
divided= true;
break;
}
}
if(divided){
cout<< "Not Prime" <<endl;
}
else{
cout<< "Prime"... | ALGO | 0.999832 | 3.919353 |
556c2972-fab7-418e-b7f2-e7afec03911b | ishandutta2007/codeforces | ashishgup/normal/1208/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
const int N = 2e5 + 5;
struct BIT
{
int N;
vector<int> bit;
void init(int n)
{
N = n;
bit.assign(n + 1, 0);
}
void update(int idx, int val)
{
while(idx <... | ALGO | 0.999997 | 3.800553 |
787fa673-bb08-4a31-b8c9-8426bf0cd406 | shakib609/competitive-programming | Programming-Contest-Data-Structure-and-Algorithm/2.4/timus-1083.cpp | #include<cstdio>
#include<cstring>
using namespace std;
int main(void) {
unsigned int n, temp, k, result = 1;
char k_str[25];
scanf("%u %s", &n, k_str);
k = strlen(k_str);
temp = n;
while (temp >= k) {
result *= temp;
temp -= k;
}
if (n % k > 1)
result *= n % k;
... | ALGO | 0.999845 | 3.529094 |
56081062-d3c4-473d-9178-61029a48b83f | swastik-bhandari/dsa | tries/startsWith.cpp | #include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;
class node {
unordered_map<char,node *> m;
bool endOfWord;
public:
friend class Tries;
node() :endOfWord(false) {}
};
class Tries {
node * root;
public:
Tries( ) {
root= new node;
}
void insert(string str) {
node * temp = root;
for(int i... | ALGO | 0.997671 | 4.274338 |
e1e42e83-a785-444a-a21e-6b56b69115db | dushyantpaliwal/Coding_Practice | preorder_to_BST.cpp | lass Solution {
public:
//
TreeNode* helper(vector<int>& preorder, int& index, int upperBound) {
if (index == preorder.size() || preorder[index] > upperBound) {
return NULL;
}
TreeNode* root = new TreeNode(preorder[index]);
index++; // Move to the next element in preorder... | ALGO | 0.999979 | 6.70344 |
d899e775-7a0b-4958-8a13-f271277b4697 | Pritha18/Data-Structure | Pritha/4.Queue/4.2.QueueUsingLinkedList/1.BasicOperations/5.IfEmpty.cpp | /*
5.Check if Empty
Write a program to check if the queue is empty using a linked list.
*/
#include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
Node() { }
Node(int data) {
this->data = data;
next = NULL;
}
};
Node* head;
void push(int value) {
Node *tempNode = new Node(value);
... | ALGO | 0.982149 | 4.49424 |
680427ac-62a4-4461-ba3a-b22b6d72d387 | coouir/codetree-TILs | 250113/괄호 쌍 만들어주기 2/pair-parentheses-2.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
// Please write your code here.
string str;
cin >> str;
int cnt = 0;
for (int i=0; i<str.length()-3; i++) {
if (str[i] == '(' && str[i+1] == '(') {
for (int j=i+2; j<str.length()-1; j++) {
if... | ALGO | 0.996665 | 3.829175 |
29f2907f-5841-41a6-b09a-8f4ada81dc94 | alpet83/Xray-NLC7 | 3rd party/MagicSoftware/FreeMagic/Source/Intersection2D/MgcIntr2DCirCir.cpp | #include "MgcIntr2DCirCir.h"
using namespace Mgc;
//----------------------------------------------------------------------------
static bool Find (const Vector2& rkC0, Real fR0, const Vector2& rkC1,
Real fR1, int& riQuantity, Vector2 akPoint[2])
{
// The two circles are |X-C0| = R0 and |X-C1| = R1. Define U =... | ALGO | 0.998621 | 5.782673 |
c8a2ecbf-2019-43c2-adbd-3dcbfb2e0835 | Zhanghq8/Leetcode_notes | 17_Letter_Combinations_of_a_Phone_Number/submission1.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
// DFS
class Solution {
public:
vector<string> letterCombinations(string digits) {
if (digits.empty()) {
return {};
}
vector<string> dict = {" ", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "... | ALGO | 0.999927 | 6.685774 |
b10160dc-6e53-4faf-8857-6d0580649574 | sharshdeepsingh/catalog_problem_splving | polynomial_solver.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include "include/nlohmann/json.hpp"
using json = nlohmann::json;
const long long MOD = 1000000007; // Large prime modulus
// Fast modular exponentiation
long long mod_pow(long long base, long long exp) {
long long result = 1;
base %= MOD;
while (e... | ALGO | 0.998652 | 5.641149 |
7a80633f-a248-4dde-b2c2-ab70e8d26c2d | ALPullaguariSW/app_contacts | 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 |
09a5496e-b2c1-4bab-bd61-0d2f05b48925 | FahadHeiji/Course-Projects-PA | FP/Algorithm-02/Problem___26__50/Problem__28/Pro-28-S.cpp | #include <iostream>
using namespace std;
int RandomNumber(int From, int To)
{ // Function to generate a random number
int randNum = rand() % (To - From + 1) + From;
return randNum;
}
void FillArrayWithRandomNumbers(int arr[100], int &arrLength)
{
cout << "\nEnter number of elements:\n";
cin >> arrLength... | TOOL | 0.975708 | 4.360538 |
15052f53-a5f1-4746-9862-49fb8120ea2a | harshit-jain52/CP_DSA | hackerrank/GoC_CDC_Series/22/chocolate-factory.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n; cin >> n;
string s; cin >> s;
int i,k;
int tot=0, reqPal=0, pairs=0;
for(i=0;i<n;i++) tot+=(s[i]=='0');
i=0,k=n-1;
while(i<k){
reqPal += (s[i]!=s[k]);
pairs += (s[i]==s[k] && s[i]=='0');
i++... | ALGO | 0.999487 | 3.631729 |
aab10af2-74ff-4ebc-a2fb-f8aba6eb1449 | NiloyKumarKundu/Leetcode-Preparation | Advanced CP/2nd_Long_Contest (Graph)/I_-_Wormholes.cpp | #include <bits/stdc++.h>
#define Niloy
#define int int64_t
#define mx (int) 1e5 + 123
// constexpr int64_t INF = std::numeric_limits<int64_t>::max();
#define INF (int) 1e9 + 7
#define MOD (int) 1e9 + 7
#define pb push_back
#define pairs pair<int, int>
#define vi vector<int>
#define vb vector<bool>
#define vii vector<pa... | ALGO | 0.99988 | 4.446882 |
1b41ed6c-f916-4ff1-a84b-ab65ffa72bcf | siddharth5096/LEETCODE_JOB | 2277-count-equal-and-divisible-pairs-in-an-array/count-equal-and-divisible-pairs-in-an-array.cpp | class Solution {
public:
int countPairs(vector<int>& nums, int k) {
unordered_map<int, unordered_map<int, int>> moduloMap;
int res = 0;
for (int i = 0; i < nums.size(); i++) {
int mod_i = i % k;
if (moduloMap.count(nums[i])) {
for (auto& [mod_j, coun... | ALGO | 0.999901 | 6.149292 |
cb29e6c9-c815-434f-9909-b73a53c43c1d | poke19962008/Competitive-Coding | CodeForces/882B.cpp | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <stdio.h>
#include <math.h>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
using namespace std;
#define EPS 1e-9
#define INF 1e15+9
#define MOD 1000000007
#define MAXN 1000006
#def... | ALGO | 0.999979 | 3.191758 |
5de49ca9-6815-4643-8707-a468c4dcaad2 | Nakib-Arman/CSE318---ArtificialIntelligence | 4.DecisionTree/.history/decision_tree_20250706205423.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
int column_num;
string label;
unordered_map<string,Node*> children;
Node* parent;
public:
Node(int column_num){
this->column_num = column_num;
this->parent = NULL;
this->label = "";
}
Node(string label){... | ALGO | 0.996189 | 4.610034 |
2ca93abe-de3c-4530-9fc9-2a8bd2d30017 | chihebabiza/Cpp-problem-solving-level-2 | 1-10/4.cpp | #include <iostream>
using namespace std;
int ReadPositiveNumber(string message)
{
int number;
cout << message << "\n";
cin >> number;
return number;
}
bool IsPerfect(int number)
{
int sum = 0;
for (int i = 1; i <= (number / 2); i++)
{
if (number % i == 0)
sum += i;
... | ALGO | 0.995504 | 4.873609 |
408b8fb7-1b89-4886-a9c2-071abffd3423 | pipixia626/Front-end | alogrithm/search/search_range.cpp |
#include<vector>
#include<iostream>
using namespace std;
vector<int> searchRange(vector<int>& nums, int target) {
int size = nums.size();
int left = 0, right = size - 1;
vector<int>res(2, -1);
if (size == 0)return res;
//找到第一个大于等于target
while (left<right)
{
int mid = left + right ... | ALGO | 0.99997 | 5.284379 |
0220778d-624b-4594-b86e-c36f6a2382c0 | sunny-white/React-Native-Master | ReactCommon/hermes/inspector/chrome/MessageTypes.cpp | #include "MessageTypes.h"
#include "MessageTypesInlines.h"
namespace facebook {
namespace hermes {
namespace inspector {
namespace chrome {
namespace message {
using RequestBuilder = std::unique_ptr<Request> (*)(const dynamic &);
namespace {
template <typename T>
std::unique_ptr<Request> makeUnique(const dynamic &... | TOOL | 0.897573 | 7.700035 |
f19f795b-6792-4a04-8277-b62a8710404d | Jay7221/competitve-programming | codechef/starters/Starters88/D.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve(){
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; ++i){
cin >> a[i];
}
map<int, vector<pair<int, int> >> pairs;
for(int i = 0; i < n; ++i){
for(int j = i + 1; j < n; ++j){
pairs[a[i] + a[j]].push_back({j, i});
}
}
i... | ALGO | 0.999926 | 4.665963 |
24e1968b-be43-4b86-8a7d-1dc1f1ec80f7 | stephen-horton/CPlusPlus---Stacks3 | C++ - Stacks3/C++ - Stacks3/Stacks3.cpp | #include <iostream>
#include <stack>
#include <cstdlib>
using namespace std;
int main() {
stack<int> st1;
stack <int> st2;
//emplace constructs and inserts a new element on top of the stack
st1.emplace(25);
st1.emplace(50);
st1.emplace(100);
cout << "st1 = ";
while (!st1.empty()) {
cout << st1.top() << " ... | ALGO | 0.9586 | 5.286332 |
0a766963-b8a3-407d-83fb-920ff4604d3d | artteam0/OAIP-1-semestr | lab15 (thitd part) гс/В8/лр15 В8 №1/лр15 В8 №1/лр15 В8 №1.cpp | #include <iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
void main()
{
int k, i, zero, sum = 0, count = 0, * arr;
arr = (int*)calloc(200, sizeof(int));
cin >> k;
for (i = 0; i < k; i++)
{
cin >> arr[i];
if (arr[i] > 0) count += 1;
if (arr[i] == 0)zero = i;
}
for (i = i - 1; i > zer... | ALGO | 0.999358 | 3.265198 |
a3b6b040-14c9-4599-a495-ac923261992f | heavenMOJANG/ICPC | .history/Codeforces/CF1999/E_20240806233656.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
vector<int> v;
void solve() {
int l, r; cin >> l >> r;
int ans = 0;
int tmp = l;
while (tmp) {
tmp /= 3;
... | ALGO | 0.999929 | 4.001315 |
e988fc80-c00a-4982-b404-abf7093859b4 | amacalito/leetcode | algorithms/cpp/maximumSubArray/maximumSubArray.cpp | // Source : https://oj.leetcode.com/problems/maximum-subarray/
// Author : Hao Chen
// Date : 2014-06-20
/**********************************************************************************
*
* Find the contiguous subarray within an array (containing at least one number)
* which has the largest sum.
*
* For examp... | ALGO | 0.99975 | 5.257445 |
58bff1c9-f6c9-4b9a-856a-acef1f59e4b7 | alec-z/leetcode | 41. First Missing Positive/main.cpp | #include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
int n = nums.size();
for (int i = 0; i < n; i++) {
if (nums[i] == i + 1) continue;
int j = i;
while (nums[j] != j + 1) {
... | ALGO | 0.999889 | 4.542643 |
5343dbd9-65f0-46b7-9a17-d89d0ff0b897 | gyu6172/CPP_Programming | C++Programming/과제1-2.cpp | #include <iostream>
using namespace std;
int main() {
int i,j;
for (i = 1; i <= 9; i++) {
for (j = 1; j <= 9; j++) {
cout<<j<<"X"<<i<<"="<<j * i<<"\t";
}
cout<<endl;
}
} | ALGO | 0.994648 | 3.424232 |
c5ab5620-ed64-48ff-a074-9bbdfe06f95a | dasithjaya/cpp_data_structures | 11_odd_even_by_bitwise.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter number : ";
cin >> n;
if (n & 1)
{
cout << "ODD" << endl;
}
else
{
cout << "EVEN" << endl;
}
return 0;
} | ALGO | 0.998993 | 4.109037 |
0e011bef-53ea-4383-98ce-b58fba595096 | ShreyasRevankar/Codeforces | 1454B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI 3.14159265
#define br cout << endl
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define amazing ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL... | ALGO | 0.999957 | 4.600744 |
fadcec87-a17c-438e-9b97-1c1ef78e1d40 | dampih/citra-du | src/video_core/shader/shader_jit_x64_compiler.cpp | #include <algorithm>
#include <cmath>
#include <cstdint>
#include <nihstro/shader_bytecode.h>
#include <smmintrin.h>
#include <xmmintrin.h>
#include "common/assert.h"
#include "common/logging/log.h"
#include "common/vector_math.h"
#include "common/x64/cpu_detect.h"
#include "common/x64/xbyak_abi.h"
#include "common/x64... | TOOL | 0.918747 | 4.035786 |
dd55c187-41e6-4e8a-8300-5f3ff1f4700b | ajimenezh/Programing-Contests | Topcoder/MulticoreProcessingEasy.cpp |
#line 3 "MulticoreProcessingEasy.cpp"
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <n... | ALGO | 0.99932 | 4.071701 |
3b38c745-7b3f-44ea-81ab-a189aaca939f | Kirthik13/Leetcode-and-GFG-submissions | 890-find-and-replace-pattern/890-find-and-replace-pattern.cpp | class Solution {
public:
string f(string s)
{
unordered_map<char,int>m;
for(auto &i:s)
{
if(m.count(i)==0)
{
m[i]=m.size();
}
}
for(int i=0;i<s.size();i++)
{
s[i]='a'+m[s[i]];
}
... | ALGO | 0.999831 | 5.690549 |
db8ab0db-306a-475b-a18d-118786eb6c27 | SdfHbb/cpp | vorlesung/09.11/minimumSort.cpp | #include <iostream>
/*
*/
using namespace std;
int main(int argc, char const *argv[])
{
int arr[5] = {7, 12, 2, 15, 9}, i, hilf, k;
cout << "Vorher: ";
for (i = 0; i < 5; i++)
{
printf("%4i ", arr[i]);
}
for (i = 0; i < 4; i++)
{
for (k = i + 1; k < 5; k++)
{
if (arr[k] < arr[i])
... | ALGO | 0.99994 | 3.4839 |
25f8eb70-014b-4ec0-ad0c-1ea242d69a06 | Aguspanale/Algo3-Tps | TP2/EJ1.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> lista_adyacencia;
vector<int> estado_dfs; // 0 WHITE 1 GRAY 2 BLACK
vector<pair<int,int>> lista_aristas;
vector<int> back_edges_con_extremo_inferior;
vector<int> back_edges_con_extremo_superior;
pair<int,int> removido_actual;
int cantidad_... | ALGO | 0.998855 | 4.315082 |
7e4f1c2d-2955-4ba9-94a5-049f2bfcbb6a | Shahraaz/CP_S5 | Templates/Convex_Hull.cpp | typedef int coord_t; // coordinate type
typedef long long coord2_t; // must be big enough to hold 2*max(|coordinate|)^2
struct Point
{
coord_t x, y;
bool operator<(const Point &p) const
{
return x < p.x || (x == p.x && y < p.y);
}
};
// 2D cross product of OA and OB vectors, i.e. z-component of their 3D cross ... | ALGO | 0.999893 | 4.876609 |
517115a2-ac38-4721-9e39-0c3bfff72f89 | raincross7/code-similarity | codes/train_code/problem233/problem233_492.cpp | #include<bits/stdc++.h>
#include<cmath>
#define pb push_back
#define ld long double
#define mp make_pair
#define vl vector<ll>
#define vd vector<double>
#define vld vector<long double>
#define ll long long int
#define pl pair<ll, ll>
#define all(a) a.begin(), a.end()
#define forr(i, n) for(ll i=0; i<n; i++)
#define f... | ALGO | 0.999956 | 4.189257 |
d4789552-d1aa-4247-bb54-93fb3b6dcbd7 | imsongkk/PS | Greedy/10775.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int G, P;
int parent[1000001];
int height[1000001];
int arr[1000001];
int find(int u)
{
if (parent[u] == u)
return u;
if (parent[u] == -1)
return -1;
return parent[u] = find(parent[u]);
}
void merge(int u, int v) // u < v̴
{
u = fin... | ALGO | 0.999866 | 3.849217 |
abf94e6a-0fe7-471f-83ef-481413e5cd4c | Itaxo01/Competitive-Programming | vjudge/topicos1/3/c.cpp | #include <bits/stdc++.h>
using namespace std;
struct point{
int x, y;
point(){}
point(int x, int y): x(x), y(y) {}
};
struct cloud{
int dir; // direction: 0 - N, 1 - S, 2 - E, 3 - W
vector<point> vertices; // sorted clockwise
cloud(){}
cloud(char c, int n){
if(c == 'N') dir = 0;
else if(c == 'S') dir = 1;
... | ALGO | 0.998273 | 4.107436 |
c6d9b53e-88f4-4978-b4fa-6f7ea5784394 | Wizapply/OvrvisionPro | 3rdparty/OculusSDKv1_8/LibOVR/Src/OVR_CAPI_Util.cpp | #include <Extras/OVR_CAPI_Util.h>
#include <Extras/OVR_StereoProjection.h>
#if defined(_MSC_VER)
#include <emmintrin.h>
#pragma intrinsic(_mm_pause)
#endif
#if defined(_WIN32)
// Prevents <Windows.h> from defining min() and max() macro symbols.
#ifndef NOMINMAX
#define NOMINMAX
#endif
#in... | TOOL | 0.982729 | 7.25205 |
f930dfcb-4fb1-4b9d-ae23-6ca4f1698e6b | greedy0110/algorithm | codeplus/9613.cpp | //
// Created by 신승민 on 2021/07/18.
//
#include <bits/stdc++.h>
using namespace std;
#define RP(i, X) for (int i=0; i<((X)); i++)
#define all(X) begin((X)), end((X))
#define endl '\n'
int gcd(int a, int b) {
while (b != 0) {
int r = a % b;
a = b;
b = r;
}
return a;
}
int main() ... | ALGO | 0.99999 | 5.532806 |
eb4029a9-8d31-435d-a187-c95c665ca395 | SourceSDK2013Ports/csgo-src | src/fow/fow_lineoccluder.cpp | #include "fow.h"
#include "fow_lineoccluder.h"
#include "fow_viewer.h"
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
//-----------------------------------------------------------------------------
// Purpose: construct a line accluder from the given points. the normal is sup... | ALGO | 0.993273 | 4.535717 |
a5f57aaa-2e9e-4a05-9af6-c425069e0084 | TiagoCorTech/HighwayDriving | src/Eigen-3.3/doc/examples/tut_arithmetic_redux_basic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::Matrix2d mat;
mat << 1, 2,
3, 4;
cout << "Here is mat.sum(): " << mat.sum() << endl;
cout << "Here is mat.prod(): " << mat.prod() << endl;
cout << "Here is mat.mean(): " << mat.mean() ... | ALGO | 0.997667 | 3.872858 |
9d55718b-0d82-4370-94a0-4a3c4b926e90 | bugsanderrors/JulyLeetCodingChallenge | W1Q2.cpp | /*
Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree [3,9,20,null,null,15,7],
3
/ \
9 20
/ ... | ALGO | 0.999997 | 6.739258 |
628e18ab-2280-4ff0-b02d-b2e2c77055bf | knakul853/competitive_programming | Graph/Bridges_in_graph.cpp | void dfs(int v,int p = -1)
{
visit[v] = 1;
tmin[v] = low[v] = t++;
int child = 0;
for(auto u:g[v])
{
if(p==u)continue;
if(visit[u])
{
low[v] = min(low[v] , tmin[u]);
}
else
{
dfs(u,v);
low[v] = min(low[v] , low[u]... | ALGO | 0.999874 | 4.619862 |
6caceef1-589a-40fc-b955-740c68ac7b9e | AarthiHonguthi/DSA_0toHero | BinarySearch/ceil.cpp | #include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
int findCeil(vector<int> &nums, int x)
{
int low = 0, high = nums.size() - 1;
int ceilValue = -1;
while (low <= high)
{
int mid = low + (high - low) / 2;
if (nums[mid] == x)
return nums[mid];
... | ALGO | 0.999941 | 4.780448 |
9b38278b-c6f7-44cf-81d7-41cdb9d40524 | DigvijayChavan6/GeeksForGeeks | Minimize the sum of product.cpp | // You are given two arrays, A and B, of equal size N. The task is to find the minimum value of A[0] * B[0] + A[1] * B[1] + .... + A[N-1] * B[N-1], where shuffling of elements of arrays A and B is allowed.
// Example 1:
// Input:
// N = 3
// A[] = {3, 1, 1}
// B[] = {6, 5, 4}
// Output:
// 23
// Explanation:
// 1*6... | ALGO | 0.999988 | 5.406895 |
0d4e7874-4ca9-4ae9-a51c-82fe91ae8518 | xi455/codeforce | problems/344A/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n, num = 1;
string s;
cin >> n;
while (n--)
{
string temp;
cin >> temp;
s.append(temp);
}
for (int i = 1; i < s.size(); i++)
{
if (s[i] == s[i -... | ALGO | 0.999596 | 4.02351 |
22ae6279-a051-462d-9bb3-a2f9a25fc3fe | YeyeQian/arv-q-project | gem5-arv-q-isa-simulator/src/systemc/tests/systemc/misc/synth/add_chain_FUNC/add_chain.cpp | /*****************************************************************************
add_chain.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | TOOL | 0.999217 | 5.907879 |
ac190552-3b24-4d15-b2e2-1b4f4b0f1312 | shuaih7/LeetCode | DP/main.cpp | // DP.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include <vector>
#include "dyProg.h"
using namespace std;
int main()
{
dyProg dp;
// LeetCode #53 - Maximum Subarray
vector<int> nums = { -2, 1, -3, 4, -1, 2, 1, -5, 4 };
int res... | ALGO | 0.986409 | 3.483039 |
ba95d055-e420-40b4-878b-e5e97fd216fe | AlcivanLucas/Beecrowd | ad-hoc/matematica/1028/1028.cpp | #include <iostream>
using namespace std;
int main()
{
double C;
int N, resposta;
cin >> N;
for (int i = 0; i < N; ++i)
{
cin >> C;
resposta = 0;
while (C > 1.0)
{
++resposta;
C /= 2;
}
cout << resposta << " dias" << endl;
... | ALGO | 0.999909 | 3.99188 |
7f01b0c1-4bf7-4ac0-b690-f13f073951c9 | siddhantb99/LeetCode-Solutions | 30DaysLeetcodeChallenge_May/918. Maximum Circular Subarray Sum.cpp | /*
Maximum Sum Circular Subarray
Solution
Given a circular array C of integers represented by A, find the maximum possible sum of a non-empty subarray of C.
Here, a circular array means the end of the array connects to the beginning of the array. (Formally, C[i] = A[i] when 0 <= i < A.length, and C[i+A.length] = C[i]... | ALGO | 0.999959 | 5.786482 |
6da4dcf0-5fc6-4996-9f7d-239776ee762e | skagrawal/Udacity-SDC-ND--term-2 | CarND-MPC-Quizzes/polyfit/src/Eigen-3.3/doc/examples/nullary_indexing.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
// [functor]
template<class ArgType, class RowIndexType, class ColIndexType>
class indexing_functor {
const ArgType &m_arg;
const RowIndexType &m_rowIndices;
const ColIndexType &m_colIndices;
public:
typedef Matrix<typename ArgType::Scalar,
... | ALGO | 0.969056 | 7.050192 |
8aaa2adf-396c-49ce-94b7-c7d845275c64 | jasper0121/Algorithm | 1093304-hw13/UVa 10912 - Simple Minded Hashing/UVa 10912 - Simple Minded Hashing.cpp | #include<iostream>
#include<vector>
using namespace std;
int dp[27][27][352]; //dp[i][j][k]uϥΫe i ӦrAզrӼƬ jA`M k rꪺҦp(1[26`M351)
int main()
{
for (int i = 1; i <= 26; i++) //uϥΫeiӦrABuΤ@ӦrܡA`Mipƥu1
{
dp[i][1][i] = 1;
}
for (int i = 1; i <= 26; i++) //uϥΫeiӦr
{
for (int j = 1; j <= i; j++) //buϥΫeiӦrpUAզrӼƳ̦... | ALGO | 0.999827 | 4.067592 |
cdcc8395-1368-4cc4-9e0c-e6850ce57a41 | meilleur777/Competitive_Programming | AtCoder/old/others/Yahoo Programming Contest 2019 C.cpp | #include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> intp;
void init_code() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", ... | ALGO | 0.99982 | 3.532721 |
ffe3563f-997e-4e0e-8b59-70e969aff339 | SnowySparks/Algorithm_Solve | Programmers_solved/Level3/표현가능한이진트리.cpp | #include <string>
#include <vector>
#include <iostream>
#include <cmath>
#include <stack>
using namespace std;
string tobinary(long long n) {
string answer = "";
stack<char> st;
while (n > 0) {
if (n % 2 == 1) {
st.push('1');
}
else {
st.push('0');
}
... | ALGO | 0.999984 | 4.771811 |
9cc82cce-15d2-4ee6-af1d-8b330a832f1c | ChaseChoi/leetcode_exercises | linked-list/142.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
ListNode *fast = head, *slow = head;
bool flag = false;
while (fast && fast... | ALGO | 0.999925 | 5.603979 |
c5f6c285-7d73-4349-881a-d44ce5ccc888 | xiashuang2020/leetcode-solutions | 49.cpp | //
// Created by pyxisha on 2021/5/26.
//
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
vector<vector<string>> ret;
vector<string> n;
vector<string> so... | ALGO | 0.999992 | 6.23081 |
37468adf-ef50-465e-b228-ecbc0bebbd08 | qing-del/DataStructAndAlgorithm | MyTest/ACM_Train/Week_1/day3/W.cpp | #include <iostream>
using namespace std;
int main()
{
int n, x;
cin >> n >> x;
int count = 0;
for(int i = 1; i <= n; i++)
{
int j = i;
while(j != 0)
{
if(j % 10 == x) count++;
j = j / 10;
}
}
cout << count << endl;
return 0;
} | ALGO | 0.999784 | 4.30051 |
d075cab2-c8fd-48f7-b4d8-d26e18a7fe54 | Preclikos/libdash | libdash/qtsampleplayer/libdashframework/Portable/MultiThreading.cpp | #include "MultiThreading.h"
THREAD_HANDLE CreateThreadPortable (void *(*start_routine) (void *), void *arg)
{
#if defined _WIN32 || defined _WIN64
return CreateThread (0, 0, (LPTHREAD_START_ROUTINE)start_routine, (LPVOID)arg, 0, 0);
#else
THREAD_HANDLE th = (THREAD_HANDLE)malloc(sizeof(pth... | TOOL | 0.856578 | 5.317581 |
92e7cf55-5067-4de4-a963-597d0dadca4f | FinixLei/leetcode_finix | src/1_medium_TwoSum_way3.cpp | vector<int> twoSum(vector<int>& nums, int target) {
int size = nums.size();
multimap<int, int> cache;
for (int i=0; i<size; i++) {
cache.insert(make_pair(nums[i], i));
}
vector<int> result;
vector<int> sorted_nums(nums);
sort(sorted_nums.begin(), sorted_nums.end());
... | ALGO | 0.999847 | 5.966854 |
1fafc831-6785-4637-a475-a32098018b57 | zyhDuludulu/real-time-fluid-simulator | src/Solver.cpp | #include "Solver.h"
#include "ParticleSystem.h"
#include "Parameters.h"
#include "Debug.h"
#include <vector>
#include <cmath>
#include <cstring>
void
Solver::solve() {
updateDensityAndPressure(); // 799900
updateGravity(); // 3800
updateViscosity(); // 3944800
updatePressure(); // 2124300
updatePosAndVe... | ALGO | 0.99955 | 3.699548 |
c880ea6d-dd0d-41a4-98b2-93d99d5b8892 | riki-y/GatyaSimulator | cocos2d/cocos/base/ZipUtils.cpp | // FIXME: hack, must be included before ziputils
#ifdef MINIZIP_FROM_SYSTEM
#include <minizip/unzip.h>
#else // from our embedded sources
#include "unzip.h"
#endif
#include "base/ZipUtils.h"
#include <zlib.h>
#include <assert.h>
#include <stdlib.h>
#include "base/CCData.h"
#include "base/ccMacros.h"
#include "platfo... | TOOL | 0.908084 | 6.619042 |
5b5de5b6-6c0e-462a-a504-1814798dac35 | ishandutta2007/codeforces | dorijanlendvaj/normal/1726/A.cpp | //DUEL
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define x first
#define y second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define eb emplace_back
#pragma GCC optimize("unroll-loops")
#define shandom_ruffle(a, b) shuffle(a, b, rng)
#define vi vector<int>
#define vl ... | ALGO | 0.999861 | 3.93602 |
592bfa18-940d-4e8e-8fe7-8c4c8fb9589e | Natansh14687/CP-Projects | Problem_2.cpp | /*Given a number N, Print first N prime number starting from 2 and skipping every
alternate prime number
Example Input:
5
Example Output:
2 5 11 17 23
Explanation :
▪ First few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 …
▪ First five alternate prime numbers will be 2, 5, 11, 17, and 23
*/
#include<io... | ALGO | 0.999547 | 4.913282 |
d5a52950-f547-4a89-ab33-5951eee09a45 | GeisslerGroup/lammps-2Apr13-replica | lib/poems/matrix.cpp | #include "matrix.h"
#include <iostream>
#include <cstdlib>
using namespace std;
Matrix::Matrix(){
numrows = numcols = 0;
rows = 0;
elements = 0;
}
Matrix::~Matrix(){
delete [] rows;
delete [] elements;
}
Matrix::Matrix(const Matrix& A){
numrows = numcols = 0;
rows = 0;
elements = 0;
Dim(A.numrows,... | ALGO | 0.952379 | 3.200527 |
1de713ca-2639-4a99-8904-3f837d504d8a | tahmid678/Online-Judge-Solutions | LeetCode/648. Replace Words.cpp | class Solution {
public:
string replaceWords(vector<string>& dictionary, string sentence) {
sort(dictionary.begin(), dictionary.end(), [](string a, string b){return a.size()<b.size();});
vector<string> s;
string st = "";
for(int i=0; i<sentence.size(); i++){
if(sentence[i... | ALGO | 0.999984 | 6.028619 |
b972b380-12bb-478f-9b09-89269bafb10d | Shimanta12/Data-Structures-and-Algorithms | 0_Array/5_Character_arrays_strings/2_String_algorithms_and_problems/1_shortest_path.cpp | /*
Find Deplacement: Given a long route containing N,S,E,W directions, find the shortest path to reach the location.
Print -1 if deplacement is 0;
Sample input: SNNNEWE
Sample output: NNE
Sample input: SSNN
Sample output: -1
|N
|
|
|
W-------------------------E
... | ALGO | 0.999987 | 4.23979 |
aed7f35e-8afd-484e-9864-c5d2b767dfc3 | ishandutta2007/codeforces | mff/normal/1326/D1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <queue>
#include <stack>
#include <bitset>
#include <set>
#include <chrono>
#include <string>
using namespace std;
#define endl '\n'
vector<int> manacher(const string &s)
{
int n = 2 * s.length();
vec... | ALGO | 0.999992 | 5.709108 |
1adad9ba-ba58-4e7c-b4bf-ea17a7fa59b3 | Misaka-wsx/test | quiz/valid-mountain-array.cpp | #include<vector>
using std::vector;
class Solution {
public:
bool validMountainArray(vector<int>& A) {
int maxVal=-1;
if (A.size()<3)
{
return false;
}
int i=0;
for(;i<A.size();i++)
{
if (maxVal>=A[i])
{
i--;... | ALGO | 0.999986 | 5.768474 |
d98efb83-60c0-489f-aadf-8fa0f5bcced4 | ndy2/GetAJob | SWEA/[SWE]11592_chosun.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
string S;
int main()
{
int TC;
cin>>TC;
for(int tc =1 ; tc<=TC; tc++)
{
int D,N;
cin>>D>>N;
vector<vector<int>> horses(N,{0,0});
for(int i = 0 ; i < N ; i++)
cin>>horses[i][0]>>hor... | ALGO | 0.999574 | 4.23849 |
c7c09e82-374e-4607-a4bc-2f609d09fcaa | johannesgerer/jburkardt-cpp | fd1d_burgers_leap/fd1d_burgers_leap.cpp | # include <cstdlib>
# include <iostream>
# include <fstream>
# include <iomanip>
# include <cmath>
# include <ctime>
using namespace std;
int main ( );
int i4_min ( int i1, int i2 );
double *r8vec_even ( int n, double alo, double ahi );
void report ( int step, int step_num, int n, double x[], double t, double u[] );
... | ALGO | 0.999568 | 5.314198 |
3a2676cb-a070-4607-bafb-7fcfeebccede | Koyingtw/CP | ATC/abc231_d.cpp | // Problem: D - Neighbors
// Contest: AtCoder - Panasonic Programming Contest 2021(AtCoder Beginner Contest 231)
// URL: https://atcoder.jp/contests/abc231/tasks/abc231_d
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#pragma GCC optimize("O3")
#include <bits/stdc++.... | ALGO | 0.999974 | 5.00921 |
212f29d5-09be-4f3c-9449-4bf2819da2d2 | harrisongm/SFU_CMPT130 | Week 9/Lab work/Q1.cpp | #include <iostream>
using namespace std;
void figure_me_out(int& x, int y, int& z)
{
cout << "Entering function: " << x << ", " << y << ", " << z << endl;
x = 1;
y = 2;
z = 3;
cout << "Exiting function: " << x << ", " << y << ", " << z << endl;
}
int main()
{
int a = 10, b = 20, c = 30;
cout << "Main program b... | TOOL | 0.942318 | 4.590805 |
7b543e6e-39ce-4f37-b7ab-8b6b8eec9e9d | Tasmia-Chowdhury-Alif/XPSC-Batch---4-Problem-Solving-Club- | CodeForces Contests/Codeforces Round 948 (Div. 2)/A_Little_Nikita.cpp | // Bismillah
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
int move, cube;
cin >> move >> cube;
bool flag = true;
if (move < cube)
{
... | ALGO | 0.999949 | 4.58115 |
58cb53e7-ecf8-42e7-a1b7-c9691a728fde | SeeleNueZ/Seele | algorithm/21BinarySearch.cpp | #include<algorithm>
#include <ctime>
#include <cstdlib>
#include <random>
#include <iostream>
using namespace std;
int Search(int a[],int x,int n)
{
int l=0;
int r=n-1;
while(l<=r)
{
int mid=(l+r)/2;
if(x==a[mid])
{
return mid+1;
}
else if(x >a[mid])... | ALGO | 0.999778 | 3.919155 |
62015898-8c11-4fd7-a492-7ee88823f84f | FrankNielsen/FrankNielsen.github.io | HPC4DS/ringbroadcast.cpp | # include <mpi.h>
# include <cstdio>
# include <cstdlib>
using namespace std;
int next()
{
int rank,size;
MPI_Comm_rank ( MPI_COMM_WORLD , &rank );
MPI_Comm_size ( MPI_COMM_WORLD , &size ) ;
return ((rank + 1) % size);
}
int previous()
{
int rank,size;
MPI_Comm_rank ( MPI_COMM_WORLD , &rank );
MPI_Comm_si... | ALGO | 0.999821 | 3.646559 |
a3896a09-0cc2-4b1e-87ba-4dbf73d8a3ec | gen0v/GIP | GIP Projekte/Position im Alphabet/Position im Alphabet/position_im_alphabet.cpp | #include <iostream>
using namespace std;
int main() {
char buchstabe;
cout << "Bitte geben Sie den Buchstaben ein: ? "; // wir gehen davon aus, dass es nur Kleinbuchstaben sind
cin >> buchstabe;
cout << "Der Buchstabe " << buchstabe << " hat die Position " << (int)buchstabe - 96 << " im Alphabet.\n";
system("PAU... | ALGO | 0.991903 | 3.321066 |
aa261bab-2eeb-43c7-9704-7c7a9b98de18 | shoaibtechs/CPP | LabTask/Qn0-2.cpp | #include<iostream> // header files
using namespace std;
int main() // main() funtion
{
int a,b,c; // data variable
cout<<"enter the year "<<endl;
cin>>a;
if(a<=399)
{
if(a%4==0)
{
cout<<"lear year : days = 366 "<<endl;
}
else
{
cout<<"Not leap year : days = 365 "<<endl;
}
}
if(a>=40... | ALGO | 0.999323 | 3.147979 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.