uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9dbf2959-403e-4dce-a609-01072c23cfb9 | pranjal9424/DP | 376.cpp | struct node{
char data;
node *ar[26];
bool wordEnd;
node(char ch){
data=ch;
for( int i = 0; i < 26; i++ ){
ar[i] = NULL;
}
wordEnd=false;
}
};
class Solution{
public:
// A : given string to search
// B : vector of available strings
vo... | ALGO | 0.999878 | 5.766083 |
139eb74d-f410-4fe3-bbca-f4e623e523d0 | ishandutta2007/codeforces | smax/normal/722/C.cpp | #include <bits/stdc++.h>
using namespace std;
int a[100000], perm[100000], parent[100000], Rank[100000];
bool inArr[100000] = {};
long long Size[100000], ret[100000];
int Find(int u) {
if (parent[u] != u)
parent[u] = Find(parent[u]);
return parent[u];
}
void Union(int u, int v) {
u = Find(u), v =... | ALGO | 0.999993 | 3.749117 |
c38d1898-89c1-42b2-825f-1d5258f27adc | S6bastian/AED | Práctica/04 List_of_arrays/list_of_arrays_T.cpp | #include <iostream>
using namespace std;
template<class T, int size_parameter = 5>
struct Node {
T array[size_parameter];
int size = size_parameter;
Node<T>* next;
Node(Node<T>* n = nullptr) {
next = nullptr;
}
T* EndOfArray() {
return array + size - 1;
}
};
template<class... | ALGO | 0.998395 | 4.290271 |
525754de-17ec-4004-a5b0-f91e8090c30d | Sakshig711/CPP | assignment_1/Que1.cpp | /*1.Scan 3 integers from user.Find the largest integer using conditional operator.*/
#include<iostream>
using namespace std;
int main()
{
int num[3];
int i;
puts("enter 3 elements=");
for(i=0; i<=2; i++)
{
cin>>num[i];
}
if(num[0]>num[1] && num[0]>num[2])
{
cout<<"largest integer is = "<<num[0];
}
else if... | ALGO | 0.996946 | 3.439666 |
bdfa6a5c-a2ec-4c4b-91d4-0f4f2fae4dfd | Kieran-Weaver/StarrySky | src/util/Clib.cpp | #include <util/Clib.hpp>
uint32_t nextPow2(uint32_t v){
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v++;
return v;
}
| ALGO | 0.957595 | 4.600904 |
02d7bad0-7934-46cc-b33c-1c91b02f7eb6 | tiqwab/atcoder | abc122/d/solution1.cpp | #include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
template<class T>
inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
template<class T>
inl... | ALGO | 0.999907 | 5.001868 |
2aeff66b-749b-4f4a-9044-fc82c6d0c835 | devenderpahadia/LeetcodeSolutions | 1239-maximum-length-of-a-concatenated-string-with-unique-characters/1239-maximum-length-of-a-concatenated-string-with-unique-characters.cpp | class Solution {
public:
int maxLength(vector<string>& arr)
{
vector<string>res = {""};
int x = 0;
for(string it : arr)
{
int len = res.size();
for(int i=0;i<len;i++)
{
string str = res[i]+it;
unordered_set<char... | ALGO | 0.999946 | 5.86109 |
ba265b46-9471-4bcd-b85f-8ab2cc93a3f6 | ParamaaS/ParamaaS-Cpp-code- | POSN Camp2/110-174936.cpp | #include<bits/stdc++.h>
using namespace std;
long long c,m,n,c2,rem,reml,idx;
vector<long long>::iterator p;
vector<long long> inp;
main()
{
scanf("%lld",&n);
inp.push_back(1);
rem=1;
for(c=1;c<=92681;c++)
{
rem+=c;
inp.push_back(rem);
}
for(c=0;c<n;c++)
{
scanf("%lld",&m);
p=lower_bound(inp.begin(),inp... | ALGO | 0.999823 | 3.522997 |
343f9722-14cc-4ab9-b965-072c6012d8cc | dk-kling/drivefuzz | carla/Util/OSM2ODR/src/netbuild/NBRequest.cpp | /****************************************************************************/
/****************************************************************************/
/// @file NBRequest.cpp
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Tue, 20 ... | ALGO | 0.999049 | 5.039248 |
a0e6926b-d548-46d7-a870-5bef06a96c28 | uiamn/procon | yaminabe/intr_hc/A.cpp | #include <bits/stdc++.h>
int D = 365;
std::random_device rnd;
std::mt19937 mt(rnd());
std::uniform_int_distribution<short> rand26(1, 26);
std::uniform_int_distribution<short> rand365(1, D);
std::uniform_int_distribution<short> rand2(0, 1);
int calc_score(
std::vector<short> &c,
std::vector<std::vector<short>>... | ALGO | 0.999985 | 4.776535 |
6083ecab-f413-4bf0-b230-dc7931931e49 | TonmoyZohani/probelmSolving-C-Plus-Plus | array_sort.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int arr[100],size,i;
cin>>size;
for(i=0;i<size;i++){
cin>>arr[i];
}
sort(arr, arr + size, greater<int>());
for(i=0;i<size;i++){
cout<<arr[i]<<" ";
}
cout<<"\nPrint the third maximum number:"<<endl;
... | ALGO | 0.999812 | 3.879233 |
938c5d4d-96b0-4517-9d5f-3440dcaf3e59 | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S00713/arena/arena.cpp | #include<bits/stdc++.h>
using namespace std;
queue<int> q;
int t,n,a[102337],b[102337];
int main(){
freopen("arena.in","r",stdin);
freopen("arena.out","w",stdout);
ios::sync_with_stdio(0);
//cin >> n;
//cin >> t;
for(int tt=0;tt<t;tt++){
//cin >> n;
for(int i=1;i<=n;i++)cin >> a[i];
int ans=0;
for(int i=0... | ALGO | 0.999827 | 3.35467 |
4359687e-a1e8-4716-bffc-42e8c15bdedc | Radhesh-Sarma/Competitive-Coding | codeforces/1092/B.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 SQ(a) (a)*(a)
#define f first
#define s second
#define int long long
#define PB push_back
#define MP make_pair
#define db long double
#define all(a) a.begin(), a.end()
#define trace1(x) ... | ALGO | 0.9999 | 3.817815 |
bcf52757-5736-4871-ac7c-5178b1ec7690 | ArjunAS861/ADA-lab-1BM18CS019 | insort.cpp | //program to sort array using insertion Sort
#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
#include<ctime>
using namespace std;
int main()
{
int n,i,j,item;
int *a;
clock_t time;
cout<<"Enter the Size : ";
cin>>n;
a=new int[n];
cout<<"Enter the Elements"<<endl;
for(i=0;i<n;i++)
cin>>a[i];
ti... | ALGO | 0.99988 | 3.85064 |
a2a8f86e-548b-4907-9c96-6687b15eb4a5 | AnonCSH/CoSimHeat | CoSimHeat/eigen-3.3.7/doc/examples/TemplateKeyword_flexible.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
template <typename Derived1, typename Derived2>
void copyUpperTriangularPart(MatrixBase<Derived1>& dst, const MatrixBase<Derived2>& src)
{
/* Note the 'template' keywords in the following line! */
dst.template triangularView<Upper>() = src.template... | TOOL | 0.995866 | 5.804369 |
7e3b0f1c-55c0-4dec-af66-f04d32d97636 | HarshSahuH/DSA-Questions | 1716-calculate-money-in-leetcode-bank/1716-calculate-money-in-leetcode-bank.cpp | class Solution {
public:
int totalMoney(int n) {
int totalM = 0;
int monday = 1;
while(n>0){
for(int i=0; i <min(n,7); i++){
totalM += monday + i;
}
n = n-7;
monday++;
}
return totalM;
}
}; | ALGO | 0.999813 | 4.128318 |
ea495e73-dd44-4c4d-ae1b-b3ef3adc583a | zhaofeng-shu33/arrangement | main.cpp | #include <bits/stdc++.h>
#include <fstream>
#include "shape_info.h"
int input[1000][10];
int output[10][20];
void initialize_output() {
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 20; j++) {
output[i][j] = 0;
}
}
}
void read_to_input() {
std::ifstream fin("test_case.txt... | ALGO | 0.995001 | 3.308023 |
3877a620-518c-4b85-8c06-52b584c29201 | AkashdeepGarg/DSA-and-SQL | Median in a row-wise sorted Matrix - GFG/median-in-a-rowwise-sorted-matrix.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:
int median(vector<vector<int>> &matrix, int r, int c){
// code here
vector<int>ans;
for(int i=0;i<r;i++)... | ALGO | 0.999952 | 5.83359 |
e4899ea7-5281-4269-93ae-100e21bfebde | FRIDAYFREEBIE/Algorithm | BaekJoon/No_2667.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
int house[25][25]; // 1: 집
int visit[25][25]; // 0: X, 1: O
// 방문 방향
int dirX[4] = {1, 0, -1, 0};
int dirY[4] = {0, 1, 0, -1};
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> ... | ALGO | 0.999944 | 4.57442 |
40b4e60d-dbb1-4eaa-a939-6be73742a4cb | DawsonBruce/Kadenze-Audio-Plugin | JuceModules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp | namespace juce
{
struct RuleBasedTopologySource::Internal : public TopologySource::Listener,
private AsyncUpdater
{
Internal (RuleBasedTopologySource& da, TopologySource& bd) : owner (da), detector (bd)
{
detector.addListener (this);
}
~Internal() ... | TOOL | 0.926866 | 7.552817 |
4f04aec4-a3fc-40ed-8d82-7973c8094996 | ddimitrov-fmi/up-2022-2023 | practicum_inf/group 6/Week02-ConditionalOperators/lab/solutions/task03.cpp | #include <iostream>
#include <cmath>
const double EPS = 0.00001;
int main ()
{
double x, y;
std::cin >> x >> y;
if (std::fabs(x) < EPS && std::fabs(y) < EPS)
{
std::cout << "Center" << std::endl;
}
else if (std::fabs(x) < EPS)
{
std::cout << "Ordinate" << std::endl;
... | ALGO | 0.999957 | 4.550839 |
ccbb00ec-9880-46e9-a2fb-ae3833498f7c | gafeol/competitive-programming | ojs/URI/2245.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<ll, ll> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stde... | ALGO | 0.999795 | 3.867353 |
16df1501-6db5-4d9b-a9ac-2f72afc18aac | Shreyas-Patil-11/Cpp | Subarray/subarray.cpp | #include <iostream>
using namespace std;
int printArr(int *arr, int n){
for (int start = 0; start < n; start++)
{
for (int end = start; end <= n; end++)
{
// cout<< "(" <<start <<"," << end << ") ";
for (int i = start; i < end; i++)
{
cout<< ... | ALGO | 0.993146 | 4.625395 |
13b6d386-62e3-4ca0-acb9-83355a12b5bb | BrandonHe/Brandon-CarND-MPC-Project | src/Eigen-3.3/doc/examples/QuickStart_example.cpp | #include <iostream>
#include <Eigen/Dense>
using Eigen::MatrixXd;
int main()
{
MatrixXd m(2,2);
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
std::cout << m << std::endl;
}
| ALGO | 0.98603 | 3.474624 |
49cbd7be-30a0-416a-95fd-12b5a6050186 | GabrielArroyo/Program-C | pruebas/navidad/Variables_tipo_bandera/2_variables.cpp | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
int numero [10];
int i;
printf("Dime tus 10 numeros y te digo el mayor\n");
for ( i = 0; i < 10; i++){
scanf(" %i", &numero[i]);
}
int min = numero [0];
for ( i = 0; i < 10; i++){
if ( min < numero [i]){
min = numero[i];
}
}
... | ALGO | 0.995028 | 3.090461 |
e96a8529-16c9-4632-afc1-94d4a803bb08 | morrowsend/myReprapGuruFirmware | Dual Extruder ZSwitch 2020 Marlin-2.0.x/Marlin/src/lcd/menu/menu_delta_calibrate.cpp | //
// Delta Calibrate Menu
//
#include "../../inc/MarlinConfigPre.h"
#if HAS_LCD_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
#include "menu_item.h"
#include "../../module/delta.h"
#include "../../module/motion.h"
#if HAS_LEVELING
#include "../../feature/bedlevel/bedlevel.h"
#endif
#if ENABLED(... | TOOL | 0.911783 | 7.29246 |
8a687b6e-0ddc-45d3-aa93-40e7bb3eb5f9 | bnk159hair/Algorithm-Study | Programmers/01. Lotto/Lotto.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> lottos, vector<int> win_nums) {
vector<int> answer;
int num_of_win = 0, num_of_zero = 0;
for (int i = 0; i < lottos.size(); i++) {
for (int j = 0; j < win_nums.size(); j++) {
if (lottos[i] != 0 &&... | ALGO | 0.998877 | 4.885798 |
9d74401c-bb59-4b7e-acad-23bdc42f281f | heavenMOJANG/ICPC | .history/Codeforces/CF2030/B_20241019222916.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;
void solve() {
int n; cin >> n;
if (n == 1) {cout << "0\n"; return;}
int minn = LLONG_MAX, s{}, t{};
for (int i = 1... | ALGO | 0.999834 | 4.510538 |
cd548230-a329-498d-92f6-18369bef180e | ishandutta2007/codeforces | nikarabika/normal/237/C.cpp | //sobskdrbhvk
#include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
#define PB push_back
#define MP make_pair
#define L first
#define R second
#define sz(x) ((int)(x).size())
#define smax(x, y) ((x) = max((x), (y)))
#define smin(x, y) ((x) = min... | ALGO | 0.999979 | 3.663215 |
de586885-8266-490f-b2b7-3455ac1ddc79 | ishandutta2007/codeforces | psaily/normal/1068/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=(a);i<(n);i++)
#define per(i,a,n) for (int i=(a)-1;i>=(n);i--)
#define pb push_back
#define all(x) x.begin(),x.end()
#define SZ(x) (int)x.size()
#define mp make_pair
#define fi first
#define se second
#define inf 0x3f3f3f3f
#define bug(x) ce... | ALGO | 0.999941 | 3.450942 |
710ad80c-c383-4c87-bb43-22fd6fa77dc8 | Gin101/CS101 | luogu/P4953.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxE = 101;
const int maxD = 101;
const int maxN = 21;
const int INF = 0x3f3f3f3f;
int g[maxE][maxD] = {{0}};
int dp[maxN][maxD] = {{0}};
int main()
{
int n = 0;
int e = 0;
int d = 0;
cin >> n >> e >> d;
if (e ... | ALGO | 0.999909 | 3.740096 |
8e9ede0b-66a3-49fa-9ae6-0c097bfa2a08 | Folobort/Pacman | Parser.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include "Parser.hpp"
using namespace std;
/// -CONSTRUCTOR-
Parser::Parser(){}
/// -Parser-
void Parser::makeMatrix(unsigned width, unsigned height){
matrix = vector<vector<bool>> (width, vector<bool>(height, false));
}
... | TOOL | 0.966019 | 4.247111 |
4d1ba2d5-140d-4ced-ada0-626448a2c83d | alphaomega325/Euler-Challenges | 4/Euler-Challenge4.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
int solution[3] = {0,0,0};
int limit = 1000;
for(int i = limit -1; i > 0; i--){
for(int p = limit - 1; p > 0; p--){
string answer = to_string(i * p);
string checker;
for(auto i = answer.rbegin(); i != answer.rend();... | ALGO | 0.999763 | 3.269315 |
d6a0511d-d7e9-40ef-83a2-107b58e1e9d2 | aerimforest/Algorithm-Study | Baekjoon/hyeonyoung/다이어트.cpp | // 221108_BOJ_1484
#include <iostream>
#include <vector>
using namespace std;
int G, prv = 1, cur = 1;
vector<int> answer;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> G;
while (G > cur * cur)
{
cur++;
}
while (G >= cur * cur - (cur - 1) * (cur - 1))
{
i... | ALGO | 0.99997 | 3.930754 |
0b0ef714-a7d8-4269-9140-9de049d72d78 | ishandutta2007/codeforces | yutaka1999/normal/400/E.cpp | #include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#define SIZE 100005
#define BT 20
using namespace std;
typedef pair <int,int> P;
typedef long long int ll;
set <P> lr[BT],rl[BT];
set <P>::iterator it;
int in[SIZE];
ll now;
ll get(int x)
{
return (ll) x*(ll) (x+1)/2;
}
void ... | ALGO | 0.999937 | 3.72205 |
ee729334-cd86-495e-bd53-7be02c83fa0b | sarvex/leetcode-malbolge | solution/0900-0999/0946.Validate Stack Sequences/Solution.cpp | class Solution {
public:
bool validateStackSequences(vector<int>& pushed, vector<int>& popped) {
stack<int> stk;
int j = 0;
for (int v : pushed) {
stk.push(v);
while (!stk.empty() && stk.top() == popped[j]) {
stk.pop();
++j;
... | ALGO | 0.999792 | 6.324252 |
205225c8-4729-45c0-987c-602ed7771424 | rabinkmc/cses | special_number.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll dist(ll r1, ll c1, ll r2, ll c2) {
ll ans = abs(r1 - r2) + abs(c1 - c2);
return ans;
}
ll f(ll r, ll c) {
if ((r == 1) && (c == 1)) {
return 1;
}
if (c == 1) {
if (r % 2 == 0) return r * r;
return (r - ... | ALGO | 0.99979 | 4.798594 |
6eeb01c9-01f2-4a5d-8959-99a7c9539f6a | patrick0115/IBPCSS_UDA | yujin_yrl_v2_package/eigen-3.3.7/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
Vector3f b;
A << 1,2,3, 4,5,6, 7,8,10;
b << 3, 3, 4;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the vector b:\n" << b << endl;
Vector3f x = A.colPivHouseholderQr... | ALGO | 0.999954 | 3.356631 |
0933b165-d0a5-4d2d-9a18-560b5bc9fded | Yash-Thakare22/DSA_Uplift_Project | Assignments/Solutions/Siddhi Bhanushali/Assignment 6/Q3.cpp | #include <iostream>
using namespace std;
int search_ele(int a[],int n,int key){
int s=0;
int e=n-1;
int res;
while(s<=e){
int mid=(s+e)/2;
if(a[mid]==key){
return mid;
}
else if(a[mid]>key){
e=mid-1;
}
else {
s=mid+1;
}
}
return -1;
}
int main() {
int n,... | ALGO | 0.999907 | 5.009769 |
25c6a7e9-bbb8-4b7a-806f-e72bc65159a9 | Limpres/modul1 | modul1/Figurki.cpp | #include <iostream>
#include "Figurki.h"
using namespace std;
void krest::draw()
{
cout << " * " << endl;
cout << "***" << endl;
cout << " * " << endl;
}
void trap::draw()
{
cout << " *** " << endl;
cout << "* *" << endl;
cout << "*****" << endl;
}
void figurki::draw()
{
}
void ch() {
int k;
cin >> k;
s... | ALGO | 0.988921 | 3.635792 |
3e48831a-6388-41d9-9a22-54107b8f1477 | ishandutta2007/codeforces | maximumshot/normal/1720/D1.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
const int inf = 1e9;
const ll inf64 = 1e18;
struct output {
int res;
void print() {
... | ALGO | 0.999717 | 4.509021 |
f8a3fe17-5956-4a7a-abfd-5c036e4d3954 | ishandutta2007/codeforces | potato167/normal/1615/A.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
using namespace std;
using std::cout;
using std::cin;
using std::endl;
using ll=long long;
using ld=long double;
ll ILL=1167167167167167167;
const int INF=2100000000;
const ll mod=998244353;
#define rep(i,a) for (ll i=0;i<a;i++)
template<clas... | ALGO | 0.999643 | 4.188688 |
2c93fb84-0d2a-4e42-8bd4-2eaab3e3bd63 | yeringii/Algorithm | 프로그래머스/lv2/12939. 최댓값과 최솟값/최댓값과 최솟값.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
string solution(string s) {
string answer = "";
vector<int> v;
string tmp;
//cout << s.length();
for(int i=0; i<s.length(); i++){
if(s[i] != ' '){
//cout << s[i] << '\n';
... | ALGO | 0.9999 | 4.097084 |
1e835be5-217b-4c0a-8f2b-e0bea64fab1e | POC-2025/leetcode | solution/2100-2199/2117.Abbreviating the Product of a Range/Solution.cpp | class Solution {
public:
string abbreviateProduct(int left, int right) {
int cnt2 = 0, cnt5 = 0;
for (int i = left; i <= right; ++i) {
int x = i;
for (; x % 2 == 0; x /= 2) {
++cnt2;
}
for (; x % 5 == 0; x /= 5) {
++cnt5... | ALGO | 0.999875 | 5.724329 |
e91346de-8694-476b-b8d5-5cbdd5190b0e | YazanZebak/CompetitiveProgramming | TopCoder/SRM340-D1-500.cpp | // solution : https://community.topcoder.com/tc?module=Static&d1=match_editorials&d2=srm340
#include<bits/stdc++.h>
typedef long long ll ;
using namespace std;
const int inf = 1e4;
class CsCourses {
public:
vector <int> getOrder(vector <int>, vector <int>, vector <int>, int);
};
struct data{
int tv , pv , ... | ALGO | 0.999946 | 3.890945 |
beb7f1f3-e35d-473c-8d74-4c7c80afcf12 | emrul-chy/Competitive-Programming | CodeForces/432A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t, n, i, c=0, x, j, arr[2005];
cin>>t>>n;
for(i=0; i<t; i++)
{
cin>>x;
if(x+n<=5)
{
arr[i] = x;
c++;
}
}
cout<<c/3<<endl;
return 0;
}
| ALGO | 0.999819 | 3.536088 |
372820c1-ea34-4e88-a7c3-a8b4c3b33eb8 | hbz5000/CALFEWS | calfews_src/data/input/pmp_modelling/Ipopt-3.6.1-win32-icl10.0/Ipopt-3.6.1-win32-icl10.0/examplesMakefiles/ScalableProblems/LuksanVlcek1.cpp | #include "LuksanVlcek1.hpp"
#ifdef HAVE_CMATH
# include <cmath>
#else
# ifdef HAVE_MATH_H
# include <math.h>
# else
# error "don't have header file for math"
# endif
#endif
using namespace Ipopt;
LuksanVlcek1::LuksanVlcek1(Number g_l, Number g_u)
{
g_l_ = g_l;
g_u_ = g_u;
}
bool LuksanVlcek1::InitializeProble... | ALGO | 0.992304 | 5.483595 |
329f8146-6702-49a4-b1f3-bc82573811dc | Lucerna00/BOJ | implementation/28352.cpp | #include<iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N = 0, answer = 6;
cin >> N;
for (int i = 11;i <= N;i++)
answer *= i;
cout << answer;
return 0;
} | ALGO | 0.999891 | 3.76261 |
4b85573d-8859-4833-b1cc-ea226f6c65df | Yuval-Dev/kickstart | 13/ROUND_A/q2/final.cpp | /*
* Yuval's default header for competitive coding related stuff
* contains basic macro definitions for ease of use, debug related code,
* and some algorithms.
* Last updated: August 12 2021
*/
#include <bits/stdc++.h>
using namespace std;
#define a2n(alpha) ((int)((alpha)-'a'))
#define n2a(numeric) ((char)((char... | ALGO | 0.997871 | 4.141177 |
59a136fe-033a-4227-b5bb-b2661483d4fa | tanyaaa05/Data-Structures-Learning | OOPS/Polymorphism/Dynamic Memory/2dArray.cpp | #include<iostream>
using namespace std;
int main() {
int row = 4;
int col = 5;
// Dynamic allocation of a 2D array
int** arr = new int*[row];
for(int i=0;i<row;i++) {
arr[i] = new int[col];
}
cout<<"Taking the input array: "<<endl;
for(int i = 0; i < row; i++) {
fo... | ALGO | 0.965813 | 4.5686 |
c2ea8eee-2e36-4ab3-8567-04d2a03fe90b | ShanksSU/codewars | 6kyu/Sorting on planet Twisted-3-7/main.cpp | /*
https://www.codewars.com/kata/58068479c27998b11900056e/cpp
*/
#include <vector>
using namespace std;
vector <int> sortTwisted37(vector <int> numbers) {
auto func = [](int n) -> int {
string str = to_string(n);
for (char &c : str) {
if (c == '3') c = '7';
else if (c ==... | ALGO | 0.999454 | 5.893502 |
0de5a798-99c6-472d-856c-8767bb5fe198 | jianqingdu/kvstore | src/kv_store_proxy/sha1.cpp | //
// sha1.cpp
// kv-store
//
// Created by ziteng on 17/6/20.
//
/*
SHA-1 in C
By Steve Reid <<EMAIL>>
100% Public Domain
Test Vectors (from FIPS PUB 180-1)
"abc"
A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
84983E44 1C3BD26E BAAE4AA1 F95129E5 E5... | ALGO | 0.987142 | 6.473427 |
060e33c9-a02d-4f8e-9d22-7bd4a0304f47 | jheisonxxx/paralelos | nprocesos.cpp | #include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
MPI_Init(NULL, NULL);
int miRank, procs;
MPI_Comm_rank(MPI_COMM_WORLD, &miRank);
MPI_Comm_size(MPI_COMM_WORLD, &procs);
int number, MPI_TAG = 0, sendTo = (miRank + 1)% procs, recieveFrom = (miRank - 1 + procs) % procs;
... | ALGO | 0.996982 | 3.596661 |
d325f414-6873-4e1f-a9f4-a1be805741fc | LesserFlame/GAT350 | CodeX/x01/x01.cpp | // x01.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
template <typename T>
T Add(T i, T j) { return (i + j); }
template <typename T>
T Sqr(T i) { return (i * i); }
template <typename T>
T Max(T i, T j) { return (i > j) ? i : j; }
//retu... | ALGO | 0.959744 | 4.248919 |
73ad72af-596d-4bcb-a48a-e4b4c0df2f4b | Sanchitgoyal2000/Array-Data-Structure | O(n^2)Form larger number from array elements.cpp | #include<sstream>
string Solution::largestNumber(const vector<int> &A)
{
stringstream stream; //test case 0 0 0 0
int n=A.size(); // log(0) is not defined So be careful
int a[n];
int i,j,b,c,d;
for(i=0;i<n;i++)
a[i]=A[i];
string s="";
for(i=0;i<n-1;i++)
{
for(j=i... | ALGO | 0.999956 | 5.335861 |
9895ce1f-21c3-4d04-8989-be7c2c0797f4 | aaronparra04/ACT_PE | PVAA_ACT5_01.cpp | /*******************************************************************************/
/* Parra Velarde Aaron Alejandro 372193 */
/* 08/Sep/2023 */
/* Programa que despliega números de forma descendente. ... | ALGO | 0.999698 | 3.472405 |
acc493b2-9178-4012-a95e-43b6bd6b6f78 | Saumyajeet-Varma/DSA-cpp | LeetCode/0319. Bulb Switcher/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int bulbSwitch(int n)
{
return sqrt(n);
}
}; | ALGO | 0.999939 | 5.652068 |
76fbbfa6-0b16-4ddd-9be5-2b36728d480b | 1ssepehr/UML-Comp-IV | PS1b/src/FibLFSR.cpp | #include "FibLFSR.hpp"
#include <cstddef>
#include <stdexcept>
FibLFSR::FibLFSR(std::string seed, std::set<unsigned> tap_values)
: register_(0), N(seed.size()) {
if (N == 0) throw std::invalid_argument("Given seed is empty.");
if (N >= MAX_SIZE) {
std::cerr << "Warning: given seed \"" << seed
... | ALGO | 0.999021 | 6.85849 |
4f90b91d-19d3-49a0-a188-9399e4d43d88 | sandeep-2601/DSA | Trees/016_vertical_traversal.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node {
int val;
Node* left;
Node* right;
Node(int val) {
this->val = val;
left = right = NULL;
}
Node(int val,Node* left,Node* right){
this->val = val;
this->left = left;
this->right = right;
}
};
ve... | ALGO | 0.999998 | 5.136815 |
ae3f220d-565d-475f-a629-c6beece33a79 | Ashutosh-as/data-structures | majority-element/majority-element.cpp | class Solution {
public:
int majorityElement(vector<int>& nums) {
int count=0;
int element=0;
for(int num:nums){
if(count==0){
element=num;
}
if(num==element)count+=1;
else
count-=1;
... | ALGO | 0.999837 | 5.626239 |
ef00e32b-b0da-43e4-9867-2f4c9d53681d | akhilr007/Leetcode-problems | 0076-minimum-window-substring/0076-minimum-window-substring.cpp | class Solution {
public:
string minWindow(string s, string t) {
if(s.length() < t.length()) return "";
int map[256] = {0};
int noOfUniqueChars=0;
for(int i=0; i<t.length(); i++){
if(map[t[i]] == 0) noOfUniqueChars++;
map[t[i]]++;
... | ALGO | 0.999983 | 6.631742 |
8783c227-a65e-4a04-887a-d42e35ec5fbb | udehgoodness/AI-LLM-Engineering | week4/optimized.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include <limits>
#include <iomanip>
class LCG {
private:
uint64_t value;
const uint64_t a = 1664525;
const uint64_t c = 1013904223;
const uint64_t m = 1ULL << 32;
public:
LCG(uint64_t seed) : value(seed) {}
uint64_t next() {
val... | ALGO | 0.999768 | 6.524167 |
c80841af-fe0a-41e6-8767-a5ced4edb480 | SahilPrajapati/Coding-Practice | Linked Lists/92. Reverse Linked List II.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* reverseBetween(ListNode* head, int m, int n) {
ListNode* newHead = new ListNode(-1);
newHead->nex... | ALGO | 0.999991 | 5.87247 |
932443d7-bc71-41c4-b1df-29c5290e6ad9 | leyo2001/codetree-TILs | 240207/대문자로 출력하기/print-in-capital.cpp | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main() {
string a;
getline(cin,a);
for(int i=0; i<a.length(); i++)
{
if(isalpha(a[i]) != 0)
{
if(isupper(a[i]) != 0)
{
cout<<char(a[i]);
}
el... | ALGO | 0.99563 | 4.729011 |
54c33e34-55a6-4fc5-a9a0-b71b92b9b2e6 | xunilrj/sandbox | courses/columbia-cg-animation/week01/include/eigen/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.999065 | 3.870119 |
40edb6e4-bb62-4ff3-b6a7-386fe6556448 | vsanna/atcoder | cpp_utils/tmp_ds_algo/dp/dp_frog2.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <cmath>
#include <utility>
#include <bitset>
#include <queue>
#include <stack>
#include <limits>
#include <list>
using namespace std;
using ll = long lon... | ALGO | 0.999973 | 4.776453 |
29385725-6455-407f-b6da-7a928d0b2886 | sarvex/leetcode-elixir | solution/1000-1099/1011.Capacity To Ship Packages Within D Days/Solution.cpp | class Solution {
public:
int shipWithinDays(vector<int>& weights, int days) {
int left = 0, right = 0;
for (auto& w : weights) {
left = max(left, w);
right += w;
}
auto check = [&](int mx) {
int ws = 0, cnt = 1;
for (auto& w : weights) ... | ALGO | 0.999993 | 5.888124 |
87a9192e-d5d0-42f8-aaca-f1555de9cc89 | ShreyKhanduja/DSA-Sheet | floor_BST.cpp | int floor(Node *root, int key) {
int floor_val = -1;
while(root) {
if(root->data == key)
return key;
else if(root->data > key)
root = root->left;
else {
floor_val = root->data;
root = root->right;
}
}
return floor_val;} | ALGO | 0.999994 | 3.001561 |
d4608803-be59-4437-a0fb-fafb41956d76 | shreyatpandey/Coding-Challenges | C++/Link List/Intersect Link List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
if(headA == NULL && headB == NULL)
return NULL... | ALGO | 0.999806 | 5.509685 |
a32a4026-83d4-4fd8-a1f4-f1345d50cff4 | cristian152/FP_Tareas_-00362519- | multiplicacion de 2 c++.cpp | #include <iostream>
using namespace std;
int main(){
int a, b, multi;
cout<<"multiplicacion de 2 numeros"<<endl;
cout<<"ingrese numeros a: "<<endl;
cin>>a;
cout <<"ingrese numero b: "<<endl;
cin>>b;
multi=a*b;
cout<<"la multiplicacion es:"<<multi<<endl;
return 0;
}
| TOOL | 0.901776 | 3.253457 |
752e8226-2861-4dcb-a3e9-e15ea5589691 | gerrysonx/physx | physx/samples/samplebase/SampleCamera.cpp | #include "SampleCamera.h"
#include "SampleUtils.h"
#include "RenderPhysX3Debug.h"
#include "RendererColor.h"
using namespace SampleRenderer;
// PT: the base camera code should be the same for all cameras, regardless of how
// the camera is controlled. For example this should deal with VFC, etc.
Camera::Camera() :
m... | TOOL | 0.9318 | 7.510206 |
15ea2f59-1d6a-439f-80bc-861593ed1648 | rravipra/vicuna_7b | examples/gptneox-wip/gptneox-main.cpp | #include "ggml.h"
#include "cmpnct_gpt2bpe.hpp"
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cinttypes>
#include <fstream>
#include <map>
#include <string>
#include <vector>
#include <thread>
#include <random>
#if defined(_MSC_VER)
#pragma warning(disable: 4244 4267) // possible ... | DATA | 0.927304 | 6.614573 |
507c2091-30b4-4bf5-9251-fd7f1800914e | nileshwankhede03/Problems-on-Patterns | .history/pattern10_20250218215348.cpp | #include "./stdc++.h"
using namespace std;
void print8(int n)
{
for(int i = 1; i < 2*n - i; i++)
{
int stars = i;
if()
for(int j = 1; j <= stars; j++)
{
cout << "*";
}
cout << endl;
}
}
int main()
{
// 2 : test cases
// 3 : for 3 *
/... | ALGO | 0.999838 | 4.716725 |
d5dceb52-e09e-4515-bd21-00401c0f0ca9 | marcpp97/TFG-Ajedrez | Assets/StreamingAssets/Stockfish.Program/win/sf_13/src/endgame.cpp | #include <cassert>
#include "bitboard.h"
#include "endgame.h"
#include "movegen.h"
namespace {
// Used to drive the king towards the edge of the board
// in KX vs K and KQ vs KR endgames.
// Values range from 27 (center squares) to 90 (in the corners)
inline int push_to_edge(Square s) {
int rd = edge_d... | ALGO | 0.997583 | 6.744403 |
6b282d12-fb49-4b76-bd16-c5eadaf0cafc | Anil3737/DSA0183--C- | Leap__year.cpp | # include <iostream>
using namespace std;
int main()
{
int year,i,rem,p_y,n_y;
cout<<"Enter Year::";
cin>>year;
rem = year % 4;
if(rem == 0)
cout<<"Leap year::"<<year<<endl;
else
{
p_y = year - rem;
n_y = year + (4-rem);
cout<<"Previous year::"<<p_y<<endl;
cout<<"Next Year::"<... | ALGO | 0.999548 | 3.157903 |
9a238dc7-1d38-4968-bff8-7bbe10ce876e | LevDev2017/firovm | src/cpp-ethereum/libdevcore/SHA3.cpp | #include "SHA3.h"
#include "RLP.h"
#include <ethash/keccak.hpp>
namespace dev
{
h256 const EmptySHA3 = sha3(bytesConstRef());
h256 const EmptyListSHA3 = sha3(rlpList());
bool sha3(bytesConstRef _input, bytesRef o_output) noexcept
{
if (o_output.size() != 32)
return false;
ethash::hash256 h = ethash::... | ALGO | 0.964156 | 6.293808 |
fa0c6d2c-5546-46bb-8e94-7ff46f8be1ba | nikhilsinha822/CP | CP problems/A_DZY_Loves_Chessboard.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cout.precision(15);
cout << fixed;
ll n, m, flag = 0;
cin >> n >> m;
char a[n][m];
for (int i = 0; i < n; i++)
for (int j = 0; j < ... | ALGO | 0.999902 | 3.505478 |
e23a4632-6712-4fad-adcd-091c12698248 | ishre-yash/Programming | cpp/DaysInMonth.cpp | #include <iostream>
using namespace std;
int main(void)
{
int month;
cout<<"Enter Month: ";
cin>>month;
switch(month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
cout<<"31 Days!";
break;
case 4:
case 6:
case 9:
case 11:
cout<<"30 Days!";
break;
case 2:
cout<... | TOOL | 0.871922 | 3.485934 |
28665fb2-ce3b-4dd9-88eb-0208da09b03f | Abdullah-Asif/Codeforces | CodeForces/Cf-1363A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, x;
cin >> t;
while (t--) {
int res, odd = 0, even = 0, i, num;
cin >> n >> x;
for (i = 1; i <= n; i++) {
cin >> num;
if (num % 2 == 0) even++;
else odd++;
}
if ((x == n && odd %... | ALGO | 0.999856 | 4.099374 |
86e0f745-aa6f-4892-9e60-b73ee4924734 | Nguyennhatthanh46/bai-tap-thuc-hanh-mang-ham-tuan-4 | Bai 26.cpp | #include <iostream>
#include <set>
using namespace std;
int main(){
int n; cin>>n;
int a[n];
multiset<int> tong;
for(int i = 0; i < n;i++){
cin>>a[i];
tong.insert(a[i]);
}
int gtln = 0;
if(gtln<(*tong.rbegin())){
gtln = *tong.rbegin();
}
cout<<gtln<<endl;
cout<<tong.count(*tong.rbegin());
}
| ALGO | 0.999882 | 3.489715 |
796ee970-8a93-4ca3-83b1-bb596e691aef | Insane-Vaas/JUNK | fibo dp.cpp | #include<iostream>
using namespace std;
int dp[100000000] = {0};
int fibo(int n,int dp[]){
if( n==0 or n==1 ){
return n;
}
if(dp[n]!=0){
return dp[n];
}
int ans;
ans = fibo(n-1,dp)+fibo(n-2,dp);
return dp[n] = ans;
}
int main(){
int n;
cin>>n;
cout<<fibo(n,dp)<<endl;
}
| ALGO | 0.99997 | 5.126318 |
ba026c7f-f195-47dd-99e7-64bffe824885 | Croco-byte/ft_webserv | src/core/ConnexionManager.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ConnexionManager.cpp :+: :+: :+: ... | WEB | 0.882415 | 3.860679 |
5f401d3e-8e21-463d-b594-8565c39a2d5b | Samson-Mano/Plate_Vibration_Analysis | Plate_vibration_analysis/src/fe_solver/modal_analysis_solver.cpp | #include "modal_analysis_solver.h"
#include "triCKZ_element.h"
modal_analysis_solver::modal_analysis_solver()
{
// Empty constructor
}
modal_analysis_solver::~modal_analysis_solver()
{
// Empty destructor
}
void modal_analysis_solver::clear_results()
{
// Clear the eigen values and eigen vectors
constrained_node... | ALGO | 0.990014 | 4.953114 |
58e06a03-f8d6-4310-bb04-30b7af37a223 | RussellDash332/kattis | src/Hatter's Hat Shop/hattershatshop.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,bmi,bmi2,lzcnt")
using namespace std;
const int BUF = 1<<15;
char inbuf[BUF]; int inpos, inlen;
char next() {
if (inpos==inlen) {
inpos=0; inle... | ALGO | 0.999901 | 4.003856 |
0e48a5b7-4a43-409b-9243-5f033d60f876 | Aashutosh-23/Hello-world | How to print a multiplication table.cpp | //Way number 1
//#include <stdio.h>
//int main() {
// int n, i;
// printf("Enter an integer: ");
// scanf("%d", &n);
// for (i = 1; i <= 10; ++i) {
// printf("%d * %d = %d \n", n, i, n * i);
// }
// return 0;
//}
//Way number 2
#include<stdio.h>
int main()
{
int num;
printf("Enter the number you ... | ALGO | 0.998641 | 3.118659 |
53e0dc3d-695b-401a-a714-64029d14144c | muhammad-araf/CPP | 10-Projects/calculator.cpp | #include <iostream>
using namespace std;
int main()
{
double num1, num2;
char operation;
cout << "Enter first number: ";
cin >> num1;
cout << "Enter operation (+, -, *, /): ";
cin >> operation;
cout << "Enter second number: ";
cin >> num2;
if (operation == '+')
{
cout <... | TOOL | 0.862573 | 4.101241 |
e156ddb0-020f-4bc2-84af-58549b436f24 | mursalin49/Algorithams_242 | Lab-01/insertion sort.cpp |
// Insertion sort in C++
#include <iostream>
using namespace std;
// Function to print an array
void printArray(int array[], int size) {
for (int i = 0; i < size; i++) {
cout << array[i] << " ";
}
cout << endl;
}
void insertionSort(int array[], int size) {
for (int step = 1; step < size; step++) {
i... | ALGO | 0.999964 | 6.000112 |
4482bd66-e428-4d5c-8485-4a1aa0e91148 | jastinbeaber/OpenScan3D | libs/openMVG/openMVG/sfm/pipelines/localization/SfM_Localizer_Single_3DTrackObservation_Database.cpp | // This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
#include "openMVG/sfm/pipelines/localization/SfM_Localizer_Single_3DTrackObservation_Database.hpp"
#include "openMVG/cameras/Camera_Intrinsics.hpp"
#include "openMVG/matching/indMatch.hpp"
#include "openMVG/sfm/pipelines/sfm_regions_provider... | ALGO | 0.96972 | 6.525474 |
ad2c1e58-0273-46db-b232-fbccc57769bb | ragu-manjegowda/self-driving-car | Term03-PathPlanning-SemanticSegmentation-and-Systems/P1-Path-Planning/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.997879 | 3.870119 |
9387fbcd-000c-4dd4-8aed-d7cfd5f2999d | KshipraMalviya/Programming | CodingC++/Heap/heap.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
class MinHeap
{
public:
int *harr;
int capacity;
int heap_size;
MinHeap(int capacity)
{
heap_size = 0;
this->capacity = capacity;
harr = new int[capacity];
}
void linearSearch(int v... | ALGO | 0.99959 | 3.978909 |
858735fd-04e2-40ac-a583-a926981ddbdb | Anurag29Nitrr/Leetcode-Solutions-Anurag | 1538-maximum-points-you-can-obtain-from-cards/1538-maximum-points-you-can-obtain-from-cards.cpp | class Solution {
public:
int maxScore(vector<int>& c, int k) {
int leftsum=0;
int maxsum=0;
for( int i=0;i<k;i++){
leftsum+=c[i];
}
maxsum=leftsum;
int r=c.size() -1;
int rightsum=0;
for( int i=k-1;i>=0;i--){
leftsum-=c[i];
... | ALGO | 0.999962 | 5.515886 |
d9a6fb73-a454-468a-a31c-0f9d92e13eb8 | Kingmintchoco/Programmers | Level2/행렬의 곱셈/p.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector< vector<int> > solution(vector< vector<int> > arr1, vector< vector<int> > arr2) {
vector< vector<int> > answer;
for(int i = 0; i < arr1.size(); ++i){
vector <int> v;
for(int j = 0; j < arr2[0].size(); ++j){
... | ALGO | 0.999768 | 3.179569 |
714d1f8e-92a0-4190-8b58-aca60b7b9b5b | suchitnavghare13/C_Coding | day2_part2_C++/Number_perfectly_dividing_given_number.cpp | // Number perfectly dividing given number
#include <iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter the number ";
cin>>n;
for(int i = 1;i <= n;i++){
if(n%i==0){
cout<<endl<<i;
}
}
return 0;
} | ALGO | 0.999802 | 3.165282 |
fd0fc534-a705-4f40-80a9-06fe3c9d687c | rsjc26/Cpp | 23 Mar C++/maps_phone.cpp | #include<iostream>
#include<map>
#include<cstring>
using namespace std;
class name
{
char str[40];
public: name()
{
strcpy(str,"");
}
name(char *s)
{
strcpy(str, s);
}
char *get()
{
return str;
}
};
bool operator < (name a, name b)
{
return... | TOOL | 0.879567 | 4.037558 |
c42ce098-469d-419d-9285-2142a599d2af | Aksha/Technical-and-Competitive-Programming | Dynamic Programming/word_break_count.cpp | long long MOD = 1e9 + 7;
int dp_helper(unordered_set<string> & string_hash, string & txt, long long int i) {
long long int n = txt.size();
vector<long long int> DP(n+1);
DP[n] = 1;
for(long long int i = n -1; i >= 0; --i) {
long long int result = 0;
string segment = "";
... | ALGO | 0.999952 | 5.869726 |
2925a475-9c60-48a5-9451-ec2f4ee1014b | sinian666/codes_102_3 | cpp_副本50/chapter_sorting/quick_sort.cpp | /**
* File: quick_sort.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 快速排序类 */
class QuickSort {
private:
/* 元素交换 */
static void swap(vector<int> &nums, int i, int j) {
int tmp = nums[i];
nums[i] = nums[j];
nums[j] = tmp;
}
... | ALGO | 0.999971 | 5.600534 |
78570b4d-8a51-4173-a0bd-e6e41abdc9c8 | daiwb/Algorithm | LeetCode/romanToInt.cpp | #include <iostream>
#include <map>
#include <string>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i)
class Solution {
public:
int romanToInt(string s) {
map<char, int> mp;
mp['I'] = 1;
m... | ALGO | 0.999731 | 5.963547 |
17939cd7-5e17-4540-9cc4-dcdb784b6a80 | Wallelhw/CG | graphic/homework4/lut-gen/Emu_IS.cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <fstream>
#include <random>
#include "vec.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
const int resolution = 128;
Vec2f Hammersley(uint32_t i, uint32_t N) { //... | ALGO | 0.998323 | 5.055922 |
ff3b9753-07b7-4b49-8157-3f0add218661 | DhananjayKumar28/MyCodes | NumOfDigitInNumber.cpp | //Method-1 ITERATIVE METHOD
#include <bits/stdc++.h>
using namespace std;
int countDigit1(long n){
int count=0;
while(n!=0){
n=n/10; // It's T.C=>O(n)
count++;
}
return count;
}
//Method-2 RECURSIVE MEHTOD
int countDigit2(long n){
if(n==0)
retu... | ALGO | 0.998413 | 4.180687 |
4d839c03-54c9-4f00-b537-da946305a914 | codingksj/Baekjoon-Solution | 백준/26000~26999/26300~26399/26307.cpp | #include<iostream>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<deque>
#include<algorithm>
#include<string>
#include<numeric>
#include<cmath>
#include<cctype>
#include<cstring>
#include<iomanip>
using namespace std;
typedef long long LL;
typedef pair<int, int> Pii;
int main() {
cin.tie(NULL... | ALGO | 0.998962 | 4.419769 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.