uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e5f47455-f1f1-4317-89ec-01b4b5a74194 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_844_8.cpp | #include <bits/stdc++.h>
using ll = long long int;
using namespace std;
bool isvalid(int n) {
bool f = 0;
string g = to_string(n);
for (ll i = 0; i < g.size(); i++) {
if (g[i] == '4' || g[i] == '7')
continue;
else {
return false;
}
}
return true;
}
int main() {
int t = 1;
while (t-... | ALGO | 0.999054 | 4.944153 |
940be40d-c9c7-4d04-b4e0-7d3684c798d5 | anak1st/Contests | src/XCPC/ICPC/2022-2023/Hangzhou/K.cpp | /**
* @author: XiaFan
* @date: 2023-10-25 15:41
*/
#include <bits/stdc++.h>
using i64 = long long;
constexpr int N = 1E6 + 100;
int tree[N][26], have[N], sum[N];
int cnt = 1;
i64 map[26][26];
i64 ans = 0;
void insert(std::string s) {
int p = 1;
for (auto c : s) {
int x = c - 'a';
if (!tree... | ALGO | 0.999684 | 5.055517 |
44fb5a29-2f66-4dbc-b746-6971babd8526 | bindingflare/c-practice | day12/m-h3.cpp | #include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
// Snail problem
//int getSnailDaysTaken(int dayRise, int nightFall, int targetDistance) {
// int currentDistance = 0;
// int daysTaken = 0;
//
// while(currentDistance < targe... | ALGO | 0.9402 | 3.044659 |
6b617e65-8ee8-4e12-b603-6269758882ea | ayush-kk/cppPrractice | arraychallange/maxinarray.cpp | #include<iostream>
using namespace std;
int main(){
int mx=-199999999;
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
for(int i=0;i<n;i++){
mx=max(mx,arr[i]);
cout<<mx<<" ";
}
return 0;
} | ALGO | 0.999968 | 3.948294 |
086d8e0e-0d0d-4f81-aa0d-13c1ffa98969 | mr-jestin-roy/LeetCode-TaskList | Z_CPH Dump/A_Counting_Problem.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int a[n-1];
for(int i=0;i<n-1;i++) cin>>a[i];
int temp=*max_element(a,a+n-1);
long long int ans=((pow(10,5)-temp)+(pow(10,5)-temp+1));
cout<<ans%100000000... | ALGO | 0.999736 | 4.450017 |
63e8098b-2e77-4569-97eb-c6fb34be3070 | Quinny/qdw-acm | problems/david/10474.cpp | #include <iostream>
#include <algorithm>
#include <vector>
int main() {
int n, q;
int cases = 1;
while (std::cin >> n >> q) {
if (n == 0 && q == 0)
break;
std::cout << "CASE# " << ":" << cases << std::endl;
std::vector<int> v(n);
for (int i = 0; i != n; ++i)
... | ALGO | 0.99776 | 4.498265 |
50cc6b0a-18a0-4f87-9bcb-18b63f6569d4 | metr-0/codeforces-solves | cf-898-d4/D.cpp | #include <cstdio>
#include <vector>
#define S 200005
using namespace std;
typedef vector<int> vi;
char buf[S];
void solve() {
int n, k; scanf("%d %d", &n, &k);
scanf("%s", buf);
vi v;
for (int i = 0; i < n; i++) if (buf[i] == 'B')
v.push_back(i);
int lim = 0, res = 0;
for (int i = 0; i < v.size(); i++)... | ALGO | 0.99947 | 3.821839 |
b263d442-74d0-4370-83f7-1177f4f1cc75 | JamesQAQ/Coding-Practices | ZeroJudge/Solutions/b242. E. 檸檬汽水傳說?/2011-07-15_843888.cpp | #include <cstdio>
int n,stack[1000001],num[1000001],top,temp;
int input(){
char c=getchar();
while (c==' '||c=='\n')
c=getchar();
int x=c-48;
c=getchar();
while (c!=' '&&c!='\n'){
x=x*10+c-48;
c=getchar();
}
return x;
}
int main()
{
int cases;
long long ans;
... | ALGO | 0.999709 | 3.800765 |
c7cdfd27-15ea-473a-8a22-8354970b74db | Nakib-Arman/CSE318---ArtificialIntelligence | 3.ChainReaction/.history/main_20250609205552.cpp | #include <bits/stdc++.h>
using namespace std;
class cell {
int orb_num;
char color;
public:
cell() {
this->orb_num = 0;
this->color = 'B';
}
// cell(int orb_num, char color) {
// this->orb_num = orb_num;
// this->color = color;
// }
void set_orb_num(int o... | ALGO | 0.996253 | 3.777452 |
23a733e4-2d20-48ca-8282-7f8c33f1b183 | Octo-Siddharth/TCS-NQT-Coding-Questions | 7_PerpInsta_TCS/28_Word_is_Key.cpp | /*
Problem Statement (Word is Key)
One programming language has the following keywords that cannot be used as identifiers:
break, case, continue, default, defer, else, for, func, goto, if, map, range, return, struct, type, var
Write a program to find if the given word is a keyword or not
Test cases
Case 1
Input – de... | ALGO | 0.994697 | 4.011028 |
d1b81c4d-df59-4395-93c3-d6ea42876ed3 | glennlopez/Cpp.Playground | zyBooks/4 - Loops/4.5 - For loops/4.5.3.cpp | #include <iostream>
using namespace std;
/*
Write code that prints: userNum ... 2 1 Blastoff! Your code should contain a for loop. Print a newline after each number and after Blastoff!. Ex: userNum = 3 outputs:
3
2
1
Blastoff!
*/
int main() {
int userNum = 0;
int i = 0;
userNum = 3;
/* Your ... | ALGO | 0.999343 | 3.854564 |
a7110a68-5b8c-434c-a32a-6461251e312c | ashik255/Codeforces-Problem_Solving | 236A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
sort(s.begin(), s.end());
// cout<<s;
int count = 0;
for (int i = 0; i < s.size(); i++)
{
if (s[i] != s[i + 1])
{
count++;
}
}
if (count % 2 == 0)
cout << "CHAT... | ALGO | 0.999879 | 3.842545 |
b53be5f7-b625-42a7-af53-cc5232d9bad9 | nadim45448/DSA-Playground | cpp/1.Patterns/17.alpha_hill.cpp | /*
Input Format: N = 3
Result:
A
ABA
ABCBA
*/
#include<bits/stdc++.h>
using namespace std;
void print(int n)
{
for(int i=0;i<n;i++)
{
//space
for(int j=0;j<n-i-1;j++)
{
cout<<" ";
}
//charactetrs
char ch='A';
... | ALGO | 0.999958 | 4.202336 |
2faa860c-fd79-4715-a9ff-3dca2c7b8d02 | Telecommunication-Telemedia-Assessment/GBVS360-BMS360-ProSal | libgbvs360/ProjectedSaliency.cpp | #include "ProjectedSaliency.h"
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
#include <limits>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include "Projection.h"
#include "Options.h"
ProjectedSaliency::ProjectedSaliency() {
blurfrac = 20;
maxDim = -1;
}
boost::sh... | ALGO | 0.997776 | 6.132474 |
988d38c9-6103-45a6-af09-702ae7c1dc24 | ashishnagpal2498/CPP_Concepts_and_Codes | Recusion Class-lec10/Recursion again/TokengameRecursiontrial.cpp | //Token Game
#include<iostream>
using namespace std;
bool CanPlace(char board[][300],int i,int j,int n,int m)
{
for(int row=0;row<n;row++)
{ if(board[row][j]=='1')
{
return false;
}
}
for(int col=0;col<m;col++)
{
if(board[i]... | ALGO | 0.999395 | 3.588059 |
0ee939fb-e841-4368-90ca-a64aa2bcecef | AngelgarciaJ/C-Programacion-Universidad | 18_DosFunciones_Oper_Suma.cpp | // programa prog18.cpp
// dos funcioens, operacion de la suma
#include <stdio.h>
void ingresar(int *num1, int *num2) {
printf("Ingresa dos numeros: ");
scanf("%d %d", num1, num2);
}
int sumar(int num1, int num2) {
return num1 + num2;
}
int main() {
int num1, num2;
ingresar(&num1, &num2);
pri... | ALGO | 0.992694 | 5.433927 |
f49e3ab9-b166-476f-becd-9543e4f50118 | MikeFutorny/Competitive-Programming | MAC0214/dynamic_1300/146_2_A.cpp | #include <iostream>
#include <vector>
#include <map>
using ll = long long;
using namespace std;
int main(){
ll n, t, i, j, a;
string s;
map <ll, bool> mapa;
ll cont =0 ;
cin >> s;
for(i=0;i<s.length();i++){
if(mapa.find(s[i])==mapa.end()){
mapa[s[i]] = true;
cont++;
}
else{
if(ma... | ALGO | 0.999821 | 3.760017 |
cec98efb-f733-4f45-8f33-7912b5c7816b | seamanj/cloudviewer | modules/eigen3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
std::cout << "Row's maximum: " << std::endl
<< mat.rowwise().maxCoeff() << std::endl;
}
| ALGO | 0.999755 | 3.881484 |
24efd64e-7b97-4de4-a0b4-a631bdf2f360 | GaZ3ll3/femex | src/Eddington/private/RadfmmCC.cpp | /*
* RadfmmCC.cpp
*
* Created on: Aug 4, 2016
* Author: lurker
*/
#include "BBFMM2D.hpp"
#include <mexplus.h>
#include "utils.h"
using namespace std;
using namespace mexplus;
static std::vector<double> X {
-0.90617984593866396370032134655048,
-0.53846931010568310771446931539685,
0... | ALGO | 0.99977 | 5.687996 |
1725a3a5-09f8-42b8-8520-7fdaa4cd6477 | semrich/cs202-fall24 | notes/lec7/lltest.cpp | #include <iostream>
using namespace std;
#include "LinkedList.h" // include custom linked list library
int main(int argc, char *argv[]) {
LinkedList<int> ll; // define templated list
int c;
for(c=1; c<=9; c++) { // add 1..9 inclusive to list
cout << "appending " << c << endl;
ll.appendNode(c);
... | TOOL | 0.974522 | 3.665012 |
1e0d00a5-d97a-4087-95ba-9f637fb4c9da | Dockerel/Baekjoon | ETC/2579/a.cpp | #include <bits/stdc++.h>
#define fastIO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace std;
int n;
int a[304], dp[304];
void init() {
cin >> n;
for (int i = 1; i <= n; i++) cin >> a[i];
memset(dp, 0, sizeof(dp));
dp[1] = a[1];
dp[2] = a... | ALGO | 0.999971 | 4.597005 |
257546b9-94b7-4ac2-a7cc-0c564d4e0a7f | Aadityajain75/CompetitiveProgramming | codeforces/572/4.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define pb push_back
#define REP(i,a,b) for(long long int i=a ; i<b ; i++)
#define mp make_pair
#define INF 1000000000000000000
#define mod 1000000007
#define pi pair<ll,ll>
#define vi vector<ll>
#define vpi vector<pi>
#... | ALGO | 0.998578 | 3.363902 |
f5f2d90e-661b-4070-88a8-60d1d3cc3478 | KulwinderSingh04/Data-Structures | 3657-check-if-grid-can-be-cut-into-sections/check-if-grid-can-be-cut-into-sections.cpp | class Solution {
public:
bool checkValidCuts(int n, vector<vector<int>>& rectangles) {
vector<vector<int>> hr, vr;
int t = rectangles.size();
for(int i = 0; i < t; i++) {
hr.push_back({rectangles[i][0], rectangles[i][2]});
vr.push_back({rectangles[i][1], rectangles[i]... | ALGO | 0.999896 | 6.1312 |
e2ff4cae-1244-4257-97ec-c6894973f8e9 | diemort/cepgen | test/utils/probe.cpp | #include "CepGen/Generator.h"
#include "CepGen/Processes/PPtoLL.h"
using namespace std;
int main()
{
CepGen::Generator g;
CepGen::Parameters* p = g.parameters.get();
p->setProcess( new CepGen::Process::GamGamLL );
p->process_mode = CepGen::Kinematics::ElasticElastic;
//p->process_mode = CepGen::Kinematics::... | TOOL | 0.954567 | 3.682521 |
d0e66b48-80b7-440c-aaee-b5e938973122 | Niraj1920/Inter-IIT-NIT-IIIT-solutions-2019-20 | Appdynamics/angry animals.cpp | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
void angryAnimals(vector<int> a, vector<int> b, int n){
int enemies = a.size();
vector<priority_queue<int>> e(n+1);
for(int i=0; i<enemies; i++){
if(a[i] >= b[i]){
e[a[i]].push(b[i]);
}
e... | ALGO | 0.999963 | 3.4265 |
395c8733-0bdc-4cdb-bf31-79c53c4289a1 | NakonechnyiMykhail/cpp1901-1 | lesson6/ex2/main.cpp | #include <iostream>
#include <cmath>
#include "calculate.hpp"
using namespace std;
int main(void) {
cout << add(3, 7) << endl;
cout << fminus(3, 7) << endl;
cout << multiple(3, 7) << endl;
cout << divide(3, 7) << endl;
return 0;
}
| TOOL | 0.926105 | 4.218949 |
2e0f26dd-2eb6-4588-922a-fc2217d812e1 | rupc/boj | 12755/12755.cpp | // input, output
#include <iostream>
#include <iomanip>
// container
#include <vector>
#include <array>
#include <list>
#include <map>
#include <set>
#include <string>
// container adaper
#include <stack>
#include <queue>
#include <deque>
// STL algorithm related
#include <algorithm>
#include <iterator>
#include <func... | ALGO | 0.998975 | 4.591951 |
9ac09362-eb86-403f-89bb-8f0334480304 | mehreen019/competitive_programming | Codeforces/1839C.cpp | #include<bits/stdc++.h>
using namespace std;
int main(void){
int tst,n;
cin>>tst;
while(tst--){
cin>>n;
int r[n],x,cou=0;
vector<int> v;
for(int i=0;i<n;i++){
cin>>r[i];
x=r[i];
}
if(!x){
for(int i=0;i<n;i++){
... | ALGO | 0.999903 | 3.371633 |
741e598e-7a8e-4ddb-a594-191effb9d672 | Chandan157/CPP | 3-Char Array & String/Lec-1/rev.cpp | #include <iostream>
#include <string.h>
using namespace std;
void selectionSort(int arr[],int n){
for(int i=0;i<n-1;i++){
int mini=i;
for(int j=i+1;j<n;j++){
if(arr[mini]>arr[j]){
mini=j;
}
}
swap(arr[i],arr[mini]);
}
}
void printArray(in... | ALGO | 0.99965 | 4.561457 |
35ae02ef-7b61-4935-b610-44bfa3008b4b | ishandutta2007/codeforces | alex_wei/normal/1710/C.cpp | //#pragma GCC optimize(3)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define db double
#define ll long long
#define ld long double
#define uint unsigned int
#define ull unsigned long long
#define vint vector <int>
#define vpii vector <pii>
#def... | ALGO | 0.999991 | 4.015619 |
0e8261c1-dad1-456e-88f6-fea0ba1c1d36 | trort/codejam | 2010_practice_only/1A/2.cpp | #include<iostream>
#include<fstream>
#include<string>
#include<stdlib.h>
using namespace std;
const int INF=99999999;
int main(){
ifstream fin;
ofstream fout;
fin.open("B-large-practice.in");
fout.open("result.out");
int T,D,I,M,N;
int a[101];
int cost[101][256];
int mod,ins;
int ... | ALGO | 0.998947 | 3.200742 |
37ccd454-8ca3-4f83-a2a2-46cbf5af9c7d | ushmita4/SdeSheetChallenge | implementatoifunction.cpp | int atoi(string str) {
bool isNegative = 0;
if (str[0] == '-') {
isNegative = 1;
}
int number = 0;
for (int i = 0; i < str.size(); i++) {
if (str[i] >= '0'&& str[i] <= '9') {
int digit = (char) str[i] - '0';
number = number * 10 + digit;
}
}
... | TOOL | 0.969207 | 4.968841 |
76295fcc-8bb6-4b99-9a29-9f7a262d9b27 | shajayb/ALICE_2020_2024 | src/igl/copyleft/cgal/lexicographic_triangulation.cpp | #include "lexicographic_triangulation.h"
#include "../../lexicographic_triangulation.h"
#include "orient2D.h"
template<
typename DerivedP,
typename DerivedF
>
IGL_INLINE void igl::copyleft::cgal::lexicographic_triangulation(
const Eigen::PlainObjectBase<DerivedP>& P,
Eigen::PlainObjectBase<DerivedF>& F)
... | ALGO | 0.90044 | 4.159942 |
8e1820be-0c18-4cdd-a2ea-32aa132c556a | novo1985/Leetcode | DFS backtracking/47. Permutations II.cpp | /* Given a collection of numbers that might contain duplicates,
* return all possible unique permutations. */
//how to deleted duplicate? traditional backtracking
class Solution {
public:
vector<vector<int>> permuteUnique(vector<int>& nums) {
vector<vector<int>> res;
vector<int> sol;
vector<bool... | ALGO | 0.999991 | 7.039811 |
152ae3ae-2d8b-48ea-9f06-01f5228306b6 | lihzxs/LouGuOJCode | cpp/P1733.cpp | /////////////////////////////////////////////
//
// FileName : First.cpp
// Creator : Fm
// Date : 2019-11-22 09:35
// Comment : OJ(P1733)
//
///////////////////////////////////////////
//#include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <math.h>
#include <st... | ALGO | 0.999964 | 3.671554 |
17ec158c-94cc-455b-a03c-a86a4d99640d | raincross7/code-similarity | codes/train_code/problem150/problem150_474.cpp | #include <iostream>
using namespace std;
const int maxn=1e3;
int d[maxn][maxn];
const int INF=2147483647;
struct node{
int from;
int to;
int cost;
}edge[9905];
//结构体存信息
int point, E;
bool find(){
int tmp[maxn];
fill(tmp,tmp+maxn,0);
for(int i=0;i<point;i++){
for(int j=0;j<E;j++){
... | ALGO | 0.999992 | 3.827432 |
d8cb4c9f-cb84-4f19-a1ed-ca60b5eaf41b | Shubhangi3108/cpp | week5_area.cpp | #include <iostream>
using namespace std;
class Area
{
private:
int area;
public:
void calculate(int l, int b)
{
area=l*b;
cout<<"Area of Rectangle : "<<area<<endl;
}
void calculate(int a)
{
area=a*a;
cout<<"Area of Sq: "<<area<< endl;
}
};
int main()
{
... | TOOL | 0.912007 | 3.669555 |
36b6ecd1-30c9-4e83-bbcd-e533d41bceb0 | wayfarecru/opengl-part1 | c33K-pyramid-elements.cpp | #ifndef __cplusplus
#error This file works only with C++
#endif
#define _USE_MATH_DEFINES
#include <math.h>
#include <chrono>
#include <iostream>
using namespace std;
using namespace std::chrono;
#pragma warning(disable: 4711 4710 4100 4514 4626 4774 4365 4625 4464 4571 4201 5026 5027 5039)
#define GLM_FORCE_SWIZZLE... | TOOL | 0.891594 | 4.463017 |
24021652-3d83-4d67-8b0d-ccfe29cf4467 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_63_8.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> k >> n;
int ans = n;
for (int i = 0; i < k; i++) {
int x;
cin >> x;
if (n % x == 0) ans = min(ans, n / x);
}
cout << ans << "\n";
return 0;
}
| ALGO | 0.999968 | 3.999273 |
7fb445b3-9ec2-4bcb-86fb-141927c0d83d | m00tp01nt/ConsoleDisplay | Physics/Gravity/Gravity.cpp | /*
* Gravity.cpp
*
* Created on: Jan 7, 2025
* Author: eslia
*/
#include <cmath>
#include "../Body/Body.h"
#include "../Vector/Force/Force.h"
#include "../Tolerance/Tolerance.h"
class Gravity {
public:
static double constexpr gravitationalConstant = (6.6743 * pow(10, -11));
/**
* Calculates the Fo... | ALGO | 0.971069 | 4.793359 |
38b314e2-78b5-4c11-9274-785906fe3f18 | alifalhasan/CP-code-vault | Codeforces/Codeforces Round/Codeforces Round 671 (Div. 2)/D1 - Sage's Birthday (easy version)/93222332.cpp | #include<bits/stdc++.h>
using namespace std;
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define SE second
#defin... | ALGO | 0.999994 | 3.217464 |
1a9c66ac-e46a-4173-b767-811ad2791b01 | jcastaneda30/ExerciseAlgorithms | Codeforce/2024/CodeForcesCpp/1985A.cpp | #include<iostream>
#include<vector>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<algorithm>
#include<string>
using namespace std;
int main(){
ios_base::sync_with_stdio(false), cin.tie(NULL);
int t;
cin>>t;
while(t--){
string cadena1,cadena2;
cin>... | ALGO | 0.999563 | 4.461889 |
33531616-2fbc-4cb6-9246-df32336a71e8 | okashaluai/Digital-Image-Processing | DistanceTransform.cpp | #include <opencv2/opencv.hpp>
#include <stdio.h>
#include <limits>
using namespace cv;
using namespace std;
//Complexity - O(nm)
void distance_transform(const Mat &img, Mat &distance_transform){
//initialize
vector<vector<Point>> contours;
vector<Vec4i> _;
Point p;
findContours(img, contours,... | ALGO | 0.997505 | 6.147387 |
e3f891e0-4732-4853-92f7-f29ad3b24b9b | Shagor71/CP-Competetive-Programming- | Dua20/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5 + 7;
vector<int> g[N];
struct F {
int sum, cnt;
} dp[N];
int n;
void dfs0(int u, int par) {
for (auto v : g[u]) {
if (v == par) continue;
dfs0(v, u);
dp[u].sum += dp[v].sum + dp[v].cnt;
dp[u].cnt += dp[v].cnt;
}
dp[u] = ... | ALGO | 0.999484 | 4.079432 |
4f57ef17-f6ab-44f2-976e-3a37dde3384f | Malcobb/DSA | Trees_PreorderBinary.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
};
node *create(int val)
{
node *n=new node();
n->data=val;
n->left=NULL;
n->right=NULL;
}
node *preorder(node *p)
{
if (p!=NULL)
{
cout<<p->data;
pr... | ALGO | 0.999976 | 4.238644 |
857bb1d4-3760-49bc-bfde-37211dd85ae4 | StefanPiscu/competitive-programming-work | programe/fluxmaxim/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define cin fin
#define cout fout
ifstream fin("maxflow.in");
ofstream fout("maxflow.out");
struct edge{
int from, to, flow, cap;
};
struct Dinic{
vector<edge> edges;
vector<vector<int>> net;
vector<int> level;
vector<int> ptr;
int s, t;
Dinic(int _n, int _s, int... | ALGO | 0.999792 | 4.399444 |
3700d174-d106-4b3c-8a3a-516f95e551e3 | JiYuanFeng/DDP | bev/mmdet3d/ops/roiaware_pool3d/src/points_in_boxes_cpu.cpp | #include <assert.h>
#include <math.h>
#include <stdio.h>
#include <torch/extension.h>
#include <torch/serialize/tensor.h>
#define CHECK_CONTIGUOUS(x) \
TORCH_CHECK(x.is_contiguous(), #x, " must be contiguous ")
// #define DEBUG
inline void lidar_to_local_coords_cpu(float shift_x, float shift_y, float rz,
... | ALGO | 0.970932 | 6.021927 |
cf3e8a44-9c8a-4317-ab2c-59abc77ab4d0 | KlaraSystems/freebsd-relayd | gnu/llvm/llvm/lib/CodeGen/MachineLoopUtils.cpp | #include "llvm/CodeGen/MachineLoopUtils.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
using namespace llvm;
namespace {
// MI's parent and BB are clones of each other. Find the equivalent copy of MI
// in BB.
MachineInstr &findEqu... | TOOL | 0.989908 | 7.365286 |
406bada6-add6-47b9-a57c-095183acd5cd | dogefoodcoin/huahuod | src/ripple/app/tx/impl/Dividend.cpp | #include <BeastConfig.h>
#include <ripple/app/tx/impl/Dividend.h>
#include <ripple/app/misc/DividendMaster.h>
#include <ripple/basics/Log.h>
#include <ripple/core/ConfigSections.h>
#include <ripple/protocol/Indexes.h>
#include <ripple/protocol/TxFlags.h>
namespace ripple {
TER
Dividend::preflight (PreflightContext co... | TOOL | 0.913708 | 5.779345 |
fad0e13e-8405-4482-b55b-cd5dd0af4453 | lsj0822/Problem_Solving | C++/랜덤디펜스/실버랜덤디펜스/202402/0221_[S2]22114.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int n, k, b[100005], ans = -1;
vector<int> V;
int main(void)
{
cin >> n >> k;
V.push_back(0);
for(int i = 1; i < n; i++){
int a;
cin >> a;
if(a > k) V.push_back(i);
}
V.push_back(n);
if(V.size() == 2) ans = n;
for... | ALGO | 0.99993 | 3.772455 |
c900c073-42fe-49fc-a891-82955ef96b82 | rahullnct/Sliding-Window | sw4.cpp | #include<iostream>
using namespace std;
#include<map>
int solve(int arr[5], int n,int k)
{
int left=0,right=0,maxi=0;
map<int,int>mp; //use unordered map
while(right<n)
{
mp[arr[right]]++;
if(mp.size()>k)
{
mp[arr[left]]--;
if(mp[arr[left]]==0)
{
mp... | ALGO | 0.999966 | 5.12494 |
e39c2505-5940-4a5f-9a94-9d955dd0a15a | babyliynfg/cross | CrossApp/support/zip_support/unzip.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef NOUNCRYPT
#define NOUNCRYPT
#endif
#include "zlib.h"
#include "unzip.h"
#ifdef STDC
# include <stddef.h>
# include <string.h>
# include <stdlib.h>
#endif
#ifdef NO_ERRNO_H
extern int errno;
#else
# include <errno.h>
#endif
namespace... | TOOL | 0.951643 | 3.685256 |
390f3824-122c-4476-941c-8564265363dd | yopio/aoj | 0039.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
string s;
while( cin >> s ){
int t[s.size()];
for( int i = 0 ; i < s.size() ; i++ ){
switch( s[i] ){
case 'I':
t[i] = 1;
break;
case 'V':
t[i] = 5;
break;
case 'X':
t[i] = 10;
br... | ALGO | 0.999859 | 4.349212 |
74ee640b-3e95-4f06-a548-c3048154b974 | ssencarnacion/carparks.io | 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 |
369284f4-2e33-401f-85b5-25672edd2d08 | rajan126/Leetcode175 | best_time_To_Buy_Sell.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
if(prices.size()==0){
return 0;
}
int profit=0;
int maximum=0;
int minimum=prices[0];
for(auto stockp:prices){
minimum=min(minimum,stockp);
profit=stockp-minimum;
... | ALGO | 0.999531 | 6.23631 |
06dc8eb4-80b4-4b57-a195-e34a7ca076de | msk7529/history | algorithm/Backtracking/산업스파이의편지.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cstring>
#include <stack>
#include <string>
#include <utility>
#include <cmath>
#include <map>
using namespace std;
// baekjoon
int c;
int sosu[10000000];
int visit2[10000000];
int num[10];
string str;
int len;
int cnt;
void primeNu... | ALGO | 0.999791 | 4.719901 |
6271c3ea-d469-40f8-99b4-98def0706030 | bhavyawig/Competitive-Programming | searching array.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int m;
cout<<"enter size of array";
cin>>m;
int a[m];
int i;
for(i=0;i<m;i++)
{
cin>>a[i];
}
int n;
cout<<"enter no to find";
cin>>n;
for(i=0;i<m;i++)
{
if(a[i]==n)
{
c... | ALGO | 0.99926 | 4.079728 |
e1d19c6e-1727-4a4d-83cb-a98b6a879be4 | imhemayatsangin/CplusPlusProgramming | SelectionSort.cpp | #include <iostream>
using namespace std;
void selectionSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
int minIdx = i;
for (int j = i + 1; j < n; j++) {
if (arr[j] < arr[minIdx]) {
minIdx = j;
}
}
if (minIdx != i) {
swa... | ALGO | 0.999989 | 5.692904 |
d939e9be-4282-40d0-b4af-82cba96c1460 | ZMinder/LeetCode_CPP | P201-300/P201-210/P203/P203.cpp | #include <bits/stdc++.h>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
public:
... | ALGO | 0.999845 | 5.36239 |
4dbf4ec9-8768-4813-8802-964fea2513fc | I-am-your-William/6004CEM- | partC.cpp | #include <mpi.h>
#include <iostream>
#include <cstring>
int main(int argc, char* argv[]) {
MPI_Init(&argc, &argv);
int rank, size;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
const int MSG_LEN = 100;
char msg[MSG_LEN];
if (rank == 0) {
std::cout <<... | WEB | 0.885768 | 5.390288 |
c3a28b4a-cb41-4c79-aac9-51a01b7fc74e | alexandraventulea/tp1_inf1015 | main.cpp |
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <fstream>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <ctime>
#include <gsl/span>
#include <cppitertools/range.hpp>
#include <cppitertools/enumerate.hpp>
using namespace std;
using namespace std:... | ALGO | 0.963752 | 3.853072 |
184cf84b-2b4b-46de-9662-70c8a0471471 | nameetg/CSES | dynamic programming/12_Rectangle_cutting.cpp | #include<bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int a,b;
cin>>a>>b;
vector<vector<int>> dp(a+1,vector<int>(b+1,1e9));
for(int i=0;i<=a;i++){
for(int j=0;j<=b;j++){
if(i==j) dp[i][j]=0;
... | ALGO | 0.999909 | 3.938817 |
34a0812e-efa6-4289-8322-a0d187cade45 | junil1030/SolvedAlgorithm | 2_Week_question/2-G_2/2-G_2.cpp | #include "bits/stdc++.h"
using namespace std;
int n, c, a[1004];
vector<pair<int, int>> v;
map<int, int> mp, mp_first;
bool cmp(pair<int, int> a, pair<int, int> b) {
if (a.first == b.first) {
return mp_first[a.second] < mp_first[b.second];
}
return a.first > b.first;
}
int main() {
ios::sync_with_stdio(NULL);
... | ALGO | 0.99999 | 3.154809 |
561e4b86-56a6-4a08-8eb2-9c9968cba6d3 | vvmusiienko/MHEngine | bullet-2.77/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp | #include "btGjkConvexCast.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "btGjkPairDetector.h"
#include "btPointCollector.h"
#include "LinearMath/btTransformUtil.h"
#ifdef BT_USE_DOUBLE_PRECISION
#define MAX_ITERATIONS 64
#else
#define MAX_ITERATIONS 32
#endif
btGjkConvexCast::btGjkConvexCast(... | ALGO | 0.997443 | 6.413063 |
4e7b48cb-155c-487f-be69-0135ac42ffa7 | miiiingi/ps | leetcode/621. Task Scheduler.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <queue>
using namespace std;
/*
1. 왜 그리디하게 분류할 수 있는지는 솔직히 감이 잘 안온다.
2. 일단 cpu 스케줄러의 개념을 조금 알고있다면 도움이 될 것 같은데, 태스크의 수가 많을수록 우선순위가 높아서 더 먼저 처리해야한다.
3. 따라서 map을 이용해서 태스크의 수를 세어준다.
4. 그리고 진짜 cpu가 일을 처리하는 방식처럼 순회를 하는데, 조금 놀란점은 cycle을 지정해서 유휴시간까지 고려해... | ALGO | 0.999984 | 6.913046 |
eaff4430-69a5-44f8-a022-adc0cf20521a | AtomicNibble/PulpEngine | 3rdparty/source/PhysX-3.3/Source/LowLevel/common/src/collision/PxcPCMContactSphereSphere.cpp | #include "GuGeometryUnion.h"
#include "PxcNpCache.h"
#include "PxcNpThreadContext.h"
#include "PxcContactMethodImpl.h"
using namespace physx;
using namespace Gu;
namespace physx
{
bool PxcPCMContactSphereSphere(CONTACT_METHOD_ARGS)
{
PX_UNUSED(npCache);
using namespace Ps::aos;
const PxSphereGeometry& shapeSpher... | ALGO | 0.98026 | 6.816392 |
ad7a5e3e-2d2f-4eb3-b37c-81268c277215 | solankipawan/Data-Structures | LinkedList/Insertiona_node_at_nth_position.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
};
Node* head; //Global variable, can be accessed anywhere.
void print(){
Node* temp = head;
cout<< "The list are: ";
while(temp != NULL) {
cout << temp->data << " ";
temp = temp->next;
}
cout<< en... | ALGO | 0.998735 | 4.113264 |
d35da7a4-43da-4160-9295-feb0ec943690 | kanbang/myexercise | QtTest/WildMagic/Wm5Mathematics/Wm5IntrLine3Sphere3.cpp | #include "Wm5MathematicsPCH.h"
#include "Wm5IntrLine3Sphere3.h"
namespace Wm5
{
//----------------------------------------------------------------------------
template <typename Real>
IntrLine3Sphere3<Real>::IntrLine3Sphere3 ( const Line3<Real>& line,
const Sphere3<Real>& sphere )
:
... | ALGO | 0.952667 | 5.927519 |
702d29b2-fe63-4430-9da4-2678fa67ff8c | raincross7/code-similarity | codes/train_code/problem237/problem237_232.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,s,n) for(int i = s; i < (int)(n); i++)
int main() {
int n,m;
cin >> n >> m;
vector<ll>d1(n),d2(n),d3(n),d4(n),d5(n),d6(n),d7(n),d8(n);
rep(i,0,n){
ll x,y,z;
cin >> x >> y >> z;
d1[i] = x+y+z;
... | ALGO | 0.999957 | 3.815089 |
10dbae4f-4474-4b5a-ab6f-95b0c3ed9a08 | SSAFY11thAlgoStudy/Algorithm_Study | Geonhee/Week13/백준 2143 두 배열의 합.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
long long t;
int n, m;
int a[1001], b[1001];
vector<int> a_prefix;
vector<int> b_prefix;
long long res;
int lowerBound(int tar) {
int st = 0;
int en = b_prefix.size();
while (st < en) {
int mid = (st + en) / 2;
... | ALGO | 0.999952 | 4.284371 |
75f346b4-af60-4c71-9509-613c8057a123 | Ali-abdelrady/Leetcode | 1993-sum-of-all-subset-xor-totals/1993-sum-of-all-subset-xor-totals.cpp | class Solution {
public:
int subsetXORSum(vector<int>& nums) {
return dfs(nums, 0, 0);
}
int dfs(vector<int>& nums, int index, int currentXor) {
// Base case: when all elements have been considered
if (index == nums.size()) {
return currentXor;
}
// In... | ALGO | 0.999988 | 6.354701 |
1bab8094-72c3-4e92-b556-56e4db123a36 | ishandutta2007/codeforces | chemthan/normal/650/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
... | ALGO | 0.999956 | 3.499067 |
6b9b4d80-aa07-4ae7-8c4c-93c0931cb913 | Akshay1299/Question_Setter | Medium/String Subsequence/string-subsequence.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int mod=1e9+7;
int fun(int i,int j,int n,int m,string s1,string s2,vector<vector<int>> &dp)
{
if(j==m)
{
j=0;
return 1;
}
if(i==n)
... | ALGO | 0.99996 | 6.463099 |
429e5c38-f00b-438b-a3b2-2e359445f8dd | Boklazhenko/itstephomework | ps/week16/task1/zorina/task1.cpp | //// . -.
//// - -, (, , , , ..).
////
//
#include <iostream>
class Fraction
{
public:
Fraction(int numerator, int denominator) {
_numerator = numerator;
_denominator = denominator;
};
public:
void print() {
std::cout << _numerator << "/" << _denominator << std::endl;
}
Fraction sum(int n... | TOOL | 0.967836 | 5.503298 |
005cc36b-0500-4c20-8a65-dca71b5f7563 | Angellopp/CodeForces-Problems | _Resources/p2.cpp | #include <iostream>
using namespace std;
class ResistenciaElectrica {
private:
double valor;
public:
// Constructor
ResistenciaElectrica(double valor){
this->valor = valor;
}
void imprimirValor() {
cout << valor << " ohmios" << endl;
}
... | ALGO | 0.966542 | 5.073288 |
5d1230b0-76b9-409a-b7cd-bc3a766fec50 | chopingu/competitive_programming | cses/01_introductory_problems/13_gray_code.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sz(x) (ll)(x).size()
int main() {
cin.tie(0)->sync_with_stdio(0);
ll n;
cin >> n;
vector<vector<ll>> al(1 << n, vector<ll>());
for(ll i = 0; i < (1 << n); i++)
for(ll j = 0; j < n; j++)
al[i].push_bac... | ALGO | 0.999878 | 4.69672 |
6fb14bb4-9d5d-45c0-8006-2114a708262e | AlgorithmSWUtudy/AlgorithmSWUtudy | Yunhyunjo/Codingtest/Programmers/전화번호목록.cpp | #include <string>
#include <vector>
#include <map>
using namespace std;
bool solution(vector<string> phone_book) {
bool answer = true;
map <string, int> m;
for(string s: phone_book){
m[s]++;
}
for(string s: phone_book){
answer = true;
for(auto a: m){
i... | ALGO | 0.998429 | 5.237315 |
584bded6-93c6-4a4f-a597-b0ae73c8937a | thegamer1907/Code_Analysis | DP/1687.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastIO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define asc(s) sort(s.begin(),s.end())
#define des(s) sort(s.rbegin(),s.rend())
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define rev(v) reverse(v.begin(), v.end())
#define lo... | ALGO | 0.999962 | 4.237383 |
5e199efd-e3ab-4afc-acd7-8e2ab9de19fa | icthrm/Markerauto2.0 | Markerauto2_1/src/dataf/quat_vec.cpp | #include "quat_vec.h"
#include <cmath>
#include <iostream>
#include <string.h>
void Quat2Vec(const double* inp, int nin, double* outp, int nout)
{
double mag, sg;
register int i;
/* intrinsics & distortion */
if(nin>7){ // are they present?
for(i=0; i<nin-7; ++i){
outp[i]=inp[i]... | ALGO | 0.909968 | 5.461584 |
fe7a8d36-94cf-4316-aa53-8e311879818e | Duckmannnn/thangnaoxemcainaylathangxemsech | Minh/Minh/cses/highscore.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int n,m,dis[2501];
bool vis[2501],red[2501],no_cycle = true;
vector<tuple<int,int,int>> edge;
vector<pair<int,int>> adj[2501];
void dfs(int i) {
if(red[i]) no_cycle = false;
if(vis[i]) return;
vis[i] = true;
for(auto u : adj[i]) ... | ALGO | 0.999885 | 4.523431 |
357286ec-a3b3-4aa2-8ccd-c2b135e9a433 | 485682/physics-demos | physics/physics/plinks.cpp | #include "plinks.h"
float particle_link::currentlength() const {
_vec3 relativepos = m_contact_particles[0]->getposition() - m_contact_particles[1]->getposition();
return relativepos.magnitude();
}
uint32_t particle_cable::addcontact(particle_contact *contact,uint32_t limit) const {
// find the length o... | TOOL | 0.934156 | 4.430436 |
6e53cd09-0c2d-41be-a8ec-2f59d749b276 | Avninder99/LeetCode_GFG_Solutions | 2492-minimum-score-of-a-path-between-two-cities/2492-minimum-score-of-a-path-between-two-cities.cpp | class Solution
{
public:
int minScore(int n, vector<vector<int>>& roads)
{
//create adjacency list of roads to make it a graph
vector<pair<int, int>> adj[n+1];
for(int i=0; i<roads.size(); i++)
{
adj[roads[i][0]].push_back({roads[i][1], roads[i][2]});
ad... | ALGO | 0.999876 | 5.867074 |
3bc0d8ca-d427-407e-91fe-e65941118aeb | GiovanniBussi/test-travis-ci | src/isdb/SAXS.cpp | /*
This class was originally written by Alexander Jussupow
Extension for the middleman algorithm by Max Muehlbauer
Martini beads strucutre factor for Nucleic Acids by Cristina Paissoni
*/
#include "MetainferenceBase.h"
#include "core/ActionRegister.h"
#include "core/ActionSet.h"
#include "core/SetupMolInfo.h"
#incl... | ALGO | 0.990272 | 4.071434 |
12f84991-0d61-41cf-a9e3-4accaf8b4f30 | rahulX001/cpp | C_Given_Length_and_Sum_of_Digits.cpp |
#include <iostream>
using namespace std;
int main()
{
int m, s, t, i;
cin >> m >> s;
string a, b;
if (s == 0)
{
cout << (m == 1 ? "0 0" : "-1 -1") << endl;
return 0;
}
for (i = 0; i < m; i++)
{
t = min(s, 9);
b += t + '0';
s -= t;
}
i... | ALGO | 0.99994 | 4.411408 |
93134a9b-0e7f-49dc-bbe2-ef32509ce086 | iitpparshant/dsa_practice | Geeks For Geek/MinmizeMaxDistBetweenGasStation.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool check(vector<int>& s,double mid, int k) {
int cnt = 0;
int n = s.size();
for (int i = 1; i < n; ++i) {
cnt += ceil((s[i] - s[i - 1]) / mid) - 1;
}
... | ALGO | 0.999827 | 5.826108 |
bec5f595-5c3a-4f43-8416-1aedcdd18903 | Kirroneku/leetcode_practice | 2020_09_Sept_30Days/Week 3/length_of_last_word.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
string delim = " ";
string last = "";
while ( s.length() != 0 ) {
int findDelim = s.find(delim);
string cur = s.substr(0, findDelim+1);
s = s.substr(findDelim+1);
if( cur != " "... | ALGO | 0.999628 | 5.239058 |
df441133-a81b-43a5-b02c-017b51bfd195 | abdulrahman-hassanin/SFND_Lidar_ObstacleDetection | src/environment.cpp | /* \author Aaron Brown */
// Create simple 3d highway enviroment using PCL
// for exploring self-driving car sensors
#include "sensors/lidar.h"
#include "render/render.h"
#include "processPointClouds.h"
// using templates for processPointClouds so also include .cpp to help linker
#include "processPointClouds.cpp"
std... | TOOL | 0.872339 | 4.512511 |
7a9fb39a-e73a-4b43-b6ee-f3d3cadcdd04 | lvlnaga/AtCoder | ABC/219/c.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n+1); i++)
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using mint = modint1000000007;
//C... | ALGO | 0.999203 | 4.055158 |
b5311a23-3c67-4df8-a6f8-2830b09ffcde | erythrocyte/bleqt | src/calc/services/pressureSolver.cpp | #include "pressureSolver.hpp"
#include <tuple>
#include "calc/models/diagMatrix.hpp"
#include "calc/services/workSigma.hpp"
#include "common/models/commonVals.hpp"
#include "common/services/workRp.hpp"
#include "common/services/workString.hpp"
#include "logging/logger.hpp"
namespace ble::src::calc::services {
doubl... | ALGO | 0.999874 | 5.195167 |
e63fd3cd-87a1-48a1-897f-94e82a4c88d5 | saturnman/clucene-iOS | src/contribs-lib/CLucene/analysis/PorterStemmer.cpp | /* This is the Porter stemming algorithm, originally written by Martin Porter.
It may be regarded as cononical, in that it follows the
algorithm presented in
Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14,
no. 3, pp 130-137,
See also http://www.tartarus.org/~martin/PorterStemmer
... | ALGO | 0.994283 | 5.48636 |
2b722d98-6a97-4a39-8e03-8481e7577906 | Pritishtalwar/coding | CodeHelp-DSA-Busted-Series-main/CodeHelp-DSA-Busted-Series-main/Lecture023 2D arrays/spiralPrint.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
vector<int> spiralOrder(vector<vector<int> >& matrix) {
vector<int> ans;
int row = matrix.size();
int col = matrix[0].size();
int count = 0;
int total = row*col;
//ind... | ALGO | 0.999981 | 5.452837 |
82e1ff69-b9f8-4185-8476-116679b5fa94 | msayers1/csc212_coursework | Lab2-Graphs/main2.cpp | //main.cpptd:
#include <iostream>
#include <iomanip> // std::setprecision
#include <stdlib.h>
#include <ctime>
#include <cstring>
#include <stdio.h>
#include <string.h>
long double euler1(int n) {
long double sum = 0;
long double fact;
for (int i = 0 ; i <= n ; i ++) {
fact = 1;
for (i... | ALGO | 0.999655 | 4.94741 |
4e0933c4-330a-4644-8182-9f236652cc7c | ishandutta2007/codeforces | mnbvmar/normal/1089/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define RE(i,n) FOR(i,1,n)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#defin... | ALGO | 0.999851 | 3.871541 |
ac2b8b56-5396-4433-b6d4-53c86df99367 | marcustw/leetcode | 28-implement-strstr/28-implement-strstr.cpp | class Solution {
public:
int strStr(string haystack, string needle) {
int n=needle.length();
if (n==0) return 0;
int m=haystack.length();
int i=0;
while (i+n<=m) {
if (haystack.substr(i,n)==needle) return i;
else i++;
while (i+n<=m && hayst... | ALGO | 0.999898 | 5.950835 |
ed36488a-b5b1-4980-bff4-1073725f7923 | ArduCAM/Arducam_Mega | examples/Pico/pico4ml/tensorflow/src/tensorflow/lite/micro/micro_utils.cpp | #include "tensorflow/lite/micro/micro_utils.h"
#include <cmath>
#include <cstdint>
#include <limits>
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/op_macros.h"
namespace tflite {
int ElementCount(const TfLiteIntArray& dims) {
int result = 1;
for (int i = 0; i < dims.size; ++i) {
re... | ALGO | 0.946714 | 7.833169 |
f2e48778-0d66-442a-ad0e-1a9cdad57b5e | Vladimir-Lapushkin/https---github.com-Vladimir-Lapushkin-MIPT-1cours-2semestr | week2/B.cpp | #include <iostream>
#ifndef N
#define N 5 // actual size of the array
#endif
void shiftRight(int n, int array[]){
int l = array[n-1];
for(int i = 0; i < n-1; i++){
array[n-1-i] = array[n-2-i];
}
array[0]=l;
}
int main(){
int n = N;
int array[N]={0};
for(int i = 0; i < N; i++){
... | ALGO | 0.999988 | 3.94764 |
e1b60300-4985-4341-8daa-a00865bee678 | PablooDario/Competitive-Programming | Codeforces/Recursion/Number1toNumber2.cpp | #include <bits/stdc++.h>
using namespace std;
//https://codeforces.com/contest/727/problem/A
stack <long long> s;
bool dfs(long long n, long long target)
{
bool b=false;
if(n>target) return b;
if(n==target){
s.push(n);
return true;
}
b=dfs(n*10+1, target);
if(b) s.push(n);
... | ALGO | 0.999973 | 4.564215 |
32d059ad-3daf-4b7c-81ba-b9abefa39cec | plumzero/querecord | 01_Cpp/ch03/10_SC_Heap/01_make_heap.cpp |
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
int main ()
{
{
std::vector<double> v{ 2.5, 10, 3.5, 6.5, 8, 12, 1.5, 6 };
std::make_heap(v.begin(),v.end());
std::ostream_iterator<double> oit(std::cout, " ");
std::copy(v.begin(), v.e... | ALGO | 0.998849 | 4.65949 |
f0cced98-4b90-426e-9d0b-0dc08bf3e38a | Nirbhay97/Contest_problems-Atcoder-CC-CF | The_Vowel_Matrix.cpp | // @author: Vivek
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL), cin.tie(NULL);
ll t;
cin >> t;
while (t--)
{
ll n, k;
cin >> n >> k;
string s;
cin >> s;
... | ALGO | 0.99985 | 4.462132 |
3e9fb6a4-49de-4e41-8378-7ed2cce32e00 | ShiningSu0/Baekjoon | 10610.cpp | #include<iostream>
using namespace std;
#include<string>
#include<algorithm>
bool cmp(char a, char b)
{
if (a > b)
return true;
return false;
}
int main() {
string N;
cin >> N;
string s;
int sum = 0;
for (auto elem : N) {
sum += int(elem);
}
if (N.find("0") == -1 || sum % 3 != 0) {
cout << -1;
e... | ALGO | 0.999942 | 4.770465 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.