uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
37baa6d2-b86e-49d9-9bf8-63dd0c981b2e | Petr3002/4_semestr_prackticum_na_EVM_rucksuck | backpack_problem.cpp | #include <bits/stdc++.h>
using namespace std;
struct item {
int v;
int w;
double cost;
item(int vv, int ww){
v = vv;
w = ww;
cost = ((double) v) / ((double) w);
}
};
bool cmp(item a, item b) {
return a.cost > b.cost;
}
int main() {
int n, vv, ww, W;
cin >> n >... | ALGO | 0.999979 | 4.370069 |
aee49e11-e4a5-47e6-9b28-c1b40794f573 | iuliagroza/InfoOltenia2023 | Foc/polygon_packages/foc-16/solutions/foc_vlad_nosmen.cpp | #include <iostream>
#include <stack>
#include <tuple>
using namespace std;
const int NMAX = 1e3 + 5;
int A[NMAX][NMAX];
bool viz[NMAX][NMAX];
pair<int, int> d[4] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
pair<pair<int, int>, pair<int, int>> dfs(int x, int y) {
stack<pair<int, int>> st;
st.push({x, y});
int... | ALGO | 0.999955 | 3.932343 |
c98e0ff8-5fdb-4f1a-8edd-5c8e3bfc288b | DanielWilliamClarke/advent_of_code | aoc_2023/test/days/day15.cpp | #include "gtest/gtest.h"
#include "main/days/15/day_15.h"
TEST(Day15, ValidateDay15_Part1)
{
Day15 day15;
auto input = day15.readInput();
EXPECT_EQ(day15.part1(input), 498538);
}
TEST(Day15, ValidateDay15_Part2)
{
Day15 day15;
auto input = day15.readInput();
EXPECT_EQ(day15.part2(input), 28... | TEST | 0.939078 | 7.011798 |
212b11ae-906b-4d13-a70c-3c4c27f9cebc | wdefine/fastpynq | ip/hls/vitis_lib/dsp/L1/tests/hw/1dfft/float/fft_1d_snr/testsfft_digit_reversed_order/ssr_fft_dro_r16_l4096/src/main.cpp | //================================== End Lic =================================================
#include "DEBUG_CONSTANTS.hpp"
#include <iostream>
#include <assert.h>
#include <bitset>
#include "hls_ssr_fft_data_path.hpp"
#include "utils/spu.hpp"
#include "utils/mVerificationUtlityFunctions.hpp"
#include "utils/suf.hpp"... | ALGO | 0.949602 | 6.047332 |
ad682d1e-4d62-4cac-b39c-7b4e0b03a270 | AbdalAhmad/todo_app | todoapp/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.998657 | 6.776823 |
458400ec-25c8-4c1c-8a91-986c34663260 | isha141/LeetCode | 1519-number-of-nodes-in-the-sub-tree-with-the-same-label/1519-number-of-nodes-in-the-sub-tree-with-the-same-label.cpp | class Solution {
private:
vector<vector<int>>adj;
vector<int>ans;
string s;
private:
vector<int> solve(int node,int par){
vector<int>cnt(32,0);
for(auto itr: adj[node]){
if(itr==par) continue;
vector<int>ds=solve(itr,node);
for(int i=0;i<32;... | ALGO | 0.999974 | 5.618411 |
bc4462a4-6263-439a-a330-a49aaf09b4e8 | TodyStewart/DevC-Files | 70 ้ฉฌๅ
ๅ็ธ็ธ็ๅนด้พ้ฎ้ข.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,x,a,b;
cin>>n>>x;
a=(x+n)/2;
b=n-a;
cout<<b<<" "<<a;
return 0;
}
| ALGO | 0.999896 | 3.72306 |
63794b31-3cdd-4ee5-aa6b-9879ccb292cd | amtf1683/llvm | mlir/lib/Analysis/Presburger/IntegerRelation.cpp | #include "mlir/Analysis/Presburger/IntegerRelation.h"
#include "mlir/Analysis/Presburger/LinearTransform.h"
#include "mlir/Analysis/Presburger/PWMAFunction.h"
#include "mlir/Analysis/Presburger/PresburgerRelation.h"
#include "mlir/Analysis/Presburger/Simplex.h"
#include "mlir/Analysis/Presburger/Utils.h"
#include "llvm... | ALGO | 0.993422 | 7.647798 |
002ac57a-ff49-46a4-9b32-31082aa5ee8a | ArrolCardoz/CompetitiveProgramming | Kattis/Weekly Club/coast3.cpp | #include <bits/stdc++.h>
using namespace std;
void fillLake(vector<vector<int>>& grid, vector<vector<int>>& visited, int row,
int col) {
// cout << "ETSTSDGSDGSEG " << row << ' ' << col << endl;
visited[row][col] = 1;
int isLand = grid[row][col];
grid[row][col] = -1;
int dx[] = {0, 0, 1, -1}, ... | ALGO | 0.999937 | 4.497352 |
39b24ffd-14fc-44ca-96ee-a79e243452bc | ayushkaushal1522/codeforces_quest | primedeletion.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string str;
string ans;
cin>>str;
for(int i=0;i<9;i++){
if(str[i]=='1'){
ans+='1';
}
else if(str[i]=='3'){
ans+='3';
... | ALGO | 0.999773 | 4.423464 |
57bb83bc-4bc5-47db-a06d-7dedb5d1fc85 | prkskrs/oops | patient.cpp | //#include"stdc++.h"
#include<iostream>
using namespace std;
class patient
{
public:
string name;
int id;
int ph;
static int counter;
patient(string iname,int iph)
{
name=iname;
ph=iph;
id=++counter;
}
void display()
{
cout<<name<<"\t"<<id<<"\t"<<ph<<endl;
}
};
int pa... | TOOL | 0.875123 | 3.389957 |
6db0dea8-c43f-4d02-bbef-d2b75d4080de | shwetanknaveen/OnlineCoding | Leetcode/Misc/Transpose Matrix.cpp | //Problem link - https://leetcode.com/problems/transpose-matrix/
class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& matrix) {
int row = matrix.size(), cols = matrix[0].size();
vector<vector<int>> trans(cols,vector<int>(row));
for(int i=0;i<row;i++)
... | ALGO | 0.999973 | 6.690886 |
1a10bd3a-6ee7-4608-ba55-7bc525ec1e7d | Gbharbor/cdplus | ProLang1/C++/6_cplus/1loop_for.cpp | #include <iostream>
using namespace std;
int main () {
cout<<"EX 1: repeticao de frase\n";
for (int controle = 0; controle <=30; controle++) {
cout<<"Esta frase se repetira ate q a variavel controle seja maior dq 30\n";
cout<<"Controle= "<<controle<<"\n";
}
cout<<endl;//separar exemplos... | ALGO | 0.982202 | 3.308161 |
d6051469-a63e-4abf-8b51-45427e639b7e | ishandutta2007/codeforces | samjia2000/normal/966/C.cpp | #include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<bitset>
#include<map>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
typedef long long LL;
typedef double db;
int get(){
char ch;
while(ch=getchar(... | ALGO | 0.999996 | 3.005 |
f1ec58be-3af6-471c-bce2-cde86899d14c | vidsinghal/Cornucopia | HashEnabledLLVM/llvm/lib/CodeGen/GlobalMerge.cpp | #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/BasicBlock.h"
#in... | TOOL | 0.988155 | 7.75577 |
14b027a4-5afb-41b7-8626-b09f3b0b54e5 | zavorinavv/politeh | labbb/labbb/19/ะทะฐะดะฐะฝะธะต19.4.cpp | #include <stdio.h>
#include <math.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "Rus");
int A[100];
int n;
int j;
int i;
printf(" n: ");
scanf_s("%i", &n);
for (i = 0; i < n; ++i)
{
printf("a[%i] : ", i + 1);
scanf_s("%i", &A[i]);
}
for (i = n -... | ALGO | 0.999632 | 3.283837 |
ece67ae6-36c7-4c87-942e-8a43002624aa | cwang588/algorithms | ๅญ่่ทณๅจ็ฌ่ฏ/B.cpp | #include<bits/stdc++.h>
using namespace std;
struct net
{
int a,b,c,d;
bool operator < (const net &x)const
{
if(a!=x.a)return a<x.a;
if(b!=x.b)return b<x.b;
if(c!=x.c)return c<x.c;
return d<x.d;
}
}nn;
map<net,int>mm;
char s[55];
int main()
{
int n,m;
cin>>n>>m;
for(int i=1;i<=n;++i)
{
memset(s,0,siz... | ALGO | 0.999875 | 3.334867 |
92254728-8495-4e32-b5c7-eace76c01750 | amit-gp/Competitive-Programming-Problems | CPP-Implementation/Pythagorean_triplet/Pythagorean_triplet.cpp | /*
Created by Amit Kumar Gupta on 13/07/2018
Problem Statement:
*/
#include <iostream>
#include <vector>
using namespace std;
int main() {
// Fast I/O
ios_base::sync_with_stdio (false);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector <int> a;
int temp_i... | ALGO | 0.999724 | 4.269437 |
c7d1581d-a339-430f-bb44-eb44a4501561 | AshHyun/BOJ | 1712.cpp | #include <algorithm>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <queue>
#include <set>
#include <tuple>
#include <utility>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef tuple<int, int, int>... | ALGO | 0.999777 | 3.853379 |
6b538087-cccc-4d8a-bd32-f5a0522adf7e | fpetracci/rob_upperlimb_strokes | rvctools/robot/mex/t2.cpp | #include <iostream>
#include <Eigen/Dense>
using Eigen::Matrix2d;
int main()
{
Matrix2d m;
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;
Matrix2d m2 = m*m;
std::cout << m2 << std::endl;
}
| ALGO | 0.994056 | 3.625539 |
18a71840-3c4b-4324-8525-6f83d23fd909 | LuisJosueSantanaPerez/lenguaje-c-inf-411 | ProyectoFinal/Ejercicio-5-Arreglos/2.cpp | /*
* INF4110-1
* Nombre: Luis Josue Santana Perez
* Matricula: 100218446
* Programa: Operaciones con arreglos: Ordenar un arreglo
* Fecha: 10/11/2024
*/
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int numeros[] = {5, 3, 8, 1, 9};
sort(numeros, numeros + 5);
cout << "Arr... | ALGO | 0.999897 | 5.738937 |
8a6f94c3-629b-4dc8-ac27-d6a148918bdd | mayank3005/LeetCode-Solutions | 1129-shortest-path-with-alternating-colors/1129-shortest-path-with-alternating-colors.cpp | class Solution {
public:
vector<int> shortestAlternatingPaths(int n, vector<vector<int>>& r, vector<vector<int>>& b) {
vector<vector<int> > red(n), blue(n);
for(int i=0;i<r.size();i++) {
red[r[i][0]].push_back(r[i][1]);
}
for(int i=0;i<b.size();i++) {
blue[b[i... | ALGO | 0.999889 | 5.359807 |
2fcad3df-8b3b-472c-a5cc-da77254e5ab8 | Patolete/Programacion | Trabajos/C++/Calcular IVA.cpp | #include <iostream>
using namespace std;
int main(){
float precio, resultado;
cout<<"Digite el precio de su producto: "; cin>>precio;
resultado = precio * 1.21;
cout<<"\nEl precio con IVA es: "<<resultado<<endl;
return 0;
}
| TOOL | 0.850791 | 3.930849 |
8279c416-17ef-4e1f-9225-f2ab6ba8e085 | KatsuyaKikuchi/ProgrammingContest | Codeforces/Global/Round 14/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(40)
const ll MOD = 1000000007;
const ll INF = (ll) 1e15;
ll solve() {
ll N, X, Y;
cin >> N >> X >>... | ALGO | 0.999846 | 3.511343 |
23151260-a6b2-42f0-b162-dd54447123a7 | Shafayet-jamil/CodeforcesProblem | 1788AOneandTwo.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int test;
cin>>test;
while(test--)
{
int n;
cin>>n;
int arr[n];
for(int i=0; i<n; i++)
{
cin>>arr[i];
}
int k =0;
int fin;
bool one = false;
int ans=0;
... | ALGO | 0.999686 | 3.843589 |
cf21e5bb-5113-495f-8972-f7fda7f9b3dc | Dhruv5586/CPP_Language | holo triangle.cpp | #include<iostream>
using namespace std;
int main()
{
int i,j,sp=25;
for(i=1;i<=5;i++)
{
for(j=1;j<=sp;j++)
cout<<" ";
for(j=1;j<=i;j++){
cout<<"*";
}
cout<<"\n";
}
} | ALGO | 0.998373 | 3.341483 |
b885092d-1e1f-4717-a0c6-eb4ee414901e | CYMElee/2025_algorithm | week11/855_Exam_Room.cpp | class ExamRoom {
private:
int n;
vector<int> seats; // Stores occupied seat indices in sorted order
public:
ExamRoom(int n) {
this->n = n;
}
int seat() {
if (seats.empty()) {
seats.push_back(0);
return 0;
}
// Find max gap be... | ALGO | 0.999493 | 6.911719 |
3f2a4a48-b053-4263-8818-a42e43e08e96 | EtisPatNet/EPN | src/primitives/block.cpp | #include <primitives/block.h>
#include <hash.h>
#include <streams.h>
#include <tinyformat.h>
uint256 CBlockHeader::GetHash() const
{
std::vector<unsigned char> vch(80);
CVectorWriter ss(SER_GETHASH, PROTOCOL_VERSION, vch, 0);
ss << *this;
return HashX11((const char *)vch.data(), (const char *)vch.data... | ALGO | 0.875394 | 7.21476 |
fa5dd444-e11c-478b-b95b-678bedc46ec7 | Sibichakaravarthi-S/Algorithms_LeetCode | Defuse the Bomb.cpp | class Solution {
public:
vector<int> decrypt(vector<int>& code, int k) {
vector<int> ans;
for(int i=0;i<code.size();i++){
if(k>0){
int m=1;
int sum=0;
while(m<=k){
sum+=code[(i+m)%code.size()];
m++;
... | ALGO | 0.999992 | 4.916103 |
89c31d7f-9415-49bf-969c-3acaf5e9cc8f | lucastarche/aotd | Sorting/001-BogoSort.cpp | //BogoSort: the joke sort or stupid sort
//Consists of shuffling the array until it's sorted
//Best case Complexity: O(n)
//Average case Complexity: O(n * n!)
//Worst case Complexity: O(infinite)
//Becomes slow after n = 15, and unusable after n = 20
#include <bits/stdc++.h>
using namespace std;
void BogoSort(vector<... | ALGO | 0.999923 | 5.637393 |
d6e3680d-a424-4862-916b-1d0fd78b27c0 | TUS123456/DSAjourney | hackkerrank.cpp | #include<stdio.h>
int main() {
int size;
scanf("%d",&size);
int i,temp;
int arr[size];
for(i=0;i<=size-1;i++){
scanf("%d",&arr[i]);
}
i=0;
for(i=size-1; i >= 0; i--){
printf("\n %d",arr[i]);
}
}
| ALGO | 0.999865 | 3.285019 |
ab0c902d-3caf-4e18-90dc-e475a9f5a09a | Himel-HSTU/Code-2025 | A_Tender_Carpenter.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void solve()
{
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 1; i < n; i++)
{
int x = max(a[i], a[i - 1]), y = min(a[i], a[i - 1]);
if (x < (y * 2)) {
cout <<... | ALGO | 0.999784 | 5.057794 |
99692463-4ed9-4129-bffc-f5952edd173d | Simu96/study_CodeUp | ๊ธฐ์ด100์ /1088.cpp | #include <stdio.h>
int main(){
int n;
scanf("%d", &n);
for(int i = 1; i <= n; i++){
if(i % 3 == 0){
}else{
printf("%d ", i);
}
}
}
| ALGO | 0.999868 | 3.444757 |
455e2c88-175b-464d-b0a9-983c25d84d14 | Egenieee/Algorithm-C | ํ๋ก๊ทธ๋๋จธ์ค/unrated/181878.โ
์ํ๋โ
๋ฌธ์์ดโ
์ฐพ๊ธฐ/์ํ๋โ
๋ฌธ์์ดโ
์ฐพ๊ธฐ.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(string myString, string pat) {
if (myString.size() < pat.size()) {
return 0;
}
transform(myString.begin(), myString.end(), myString.begin(), ::tolower);
transform(pat.begin(), pat.end(), pat.begin()... | ALGO | 0.999962 | 5.585515 |
764060f6-d9cf-4718-906b-a740b05104e8 | Amdev-5/Leetcode-Algorithmic-Problems | 132-palindrome-partitioning-ii/132-palindrome-partitioning-ii.cpp | class Solution {
public:
int minCut(string s) {
int n = s.size();
vector<int> dp(n+1, INT_MAX);
dp[0] = -1; //act as a sentinel
for(int i = 0; i < n; i++){
//palindrome of length 1,3,5...
for(int len = 0; i-len >= 0 && i+len < n && s[i-len] == s[i+len]; len++)
... | ALGO | 0.99997 | 5.602141 |
53b16c7a-672f-424d-bc1c-b153a4f75d81 | inquaid/Solved-Problems | CODEFORCES/1326A.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main()
{
int a, b = 0, n = 0;
cin >> n;
while (n--)
{
cin >> a;
int j = 9;
if (a == 1)
{
cout << -1;
}
else
{
cout << 2;
for (int ... | ALGO | 0.999752 | 3.884569 |
dd1aac84-2966-4ce5-b81a-520f2642bf8a | raincross7/code-similarity | codes/train_code/problem462/problem462_103.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int j, i,u;
cin >> i >> j;
u = i * i - j;
cout << u << endl;
return 0;
}
| ALGO | 0.999748 | 3.120786 |
3bdcdb7d-cffe-4874-aaf8-f8ad763fbf19 | qunghiem/Code-PTIT | DSA/Thแปฑc Hร nh/DรY Sแป ฤแบธP.cpp | #include <bits/stdc++.h>
using namespace std;
void testCase() {
int n; cin >> n;
vector<int> a(n);
for (int &i : a) cin >> i;
int res = 0;
for (int i = 0; i < n - 1; ++i) {
if (max(a[i], a[i + 1]) <= 2 * min(a[i], a[i + 1]))
continue;
if (a[i] < a[i + 1]) {
i... | ALGO | 0.999246 | 4.94394 |
d18ae810-f3b6-41ab-a59f-c2db37b31f1a | abaran803/DSA-by-Narsimha | Linked List/CLLDeletion.cpp | #include<iostream>
using namespace std;
struct Node
{
int data;
Node* next;
};
Node* head = NULL;
void DeletionAtEnd()
{
if(head == NULL)
{
cout << "Can't Possible" << endl;
return;
}
Node* temp = head;
Node* temp1 = new Node();
if(head->next == head)
{
head = NULL;
return;
}
while(temp->next != h... | ALGO | 0.99827 | 3.286658 |
7be87f53-c98f-4884-acd5-266dbc659913 | geniousisme/leetCode | C++/lintCode/insertNodeBST.cpp | #include "../include/common.h"
/**
* Definition of TreeNode:
* class TreeNode {
* public:
* int val;
* TreeNode *left, *right;
* TreeNode(int val) {
* this->val = val;
* this->left = this->right = NULL;
* }
* }
*/
class Solution {
public:
/**
* @param root: The root o... | ALGO | 0.99999 | 5.899056 |
ad5021e5-5186-4226-8724-b041d7a76f90 | Zhang-RQ/OI_Code_10wL_Completion | BZOJ/2791.cpp | #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cassert>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int MAXN=5E5+10;... | ALGO | 0.999934 | 3.565893 |
5535373a-0a7f-44a3-b77d-fa793f3a5f61 | fredwhite/Backup | UPRC/1152.cpp | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<vector>
using namespace std;
int dp[5005];
int tdp[5005];
int n,m;
vector<int> q;
vector<int> map[505];
int c[505];
int b[505];
int ru(int a){
int i;
int u,v;
for(i=0;i<=m;i++){
tdp[i]=dp[i];
}
for(i=c[a];i<=m;i++){
if(tdp[i-c[... | ALGO | 0.999909 | 3.480741 |
26524c11-1fcc-4da8-bc68-d9b26fa6b836 | HsuDeveloper/Programmers | level2/์์ ์ต๋ํ/maximum_modify.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long long solution(string expression) {
long long answer = 0;
vector<long long> num;
vector<char> op;
vector<char> op_level;
vector<string> exp_v;
string s="";
for(int i=0;i<expression.size();i++){
cha... | ALGO | 0.999991 | 4.888228 |
d2f7e41a-03af-4407-b352-05a64b41e91b | dantrag/moleqcage | CGAL-4.7/examples/Polyhedron_IO/off_glue.cpp | // Glue vertices of a polyhedron together that have equal coordinate values.
#include <CGAL/Simple_cartesian.h>
#include <CGAL/IO/Verbose_ostream.h>
#include <CGAL/IO/File_scanner_OFF.h>
#include <CGAL/IO/File_writer_OFF.h>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <fstream>... | TOOL | 0.997995 | 6.904435 |
ed236720-ea17-4971-8a6f-0bd6fa4713c9 | CathyF9600/computer-graphics-bounding-volume-hierarchy | src/ray_intersect_triangle_mesh_brute_force.cpp | #include "ray_intersect_triangle_mesh_brute_force.h"
#include "ray_intersect_triangle.h"
#include <cstddef>
#include <cstdio>
#include <iostream>
#include <limits>
bool ray_intersect_triangle_mesh_brute_force(
const Ray & ray,
const Eigen::MatrixXd & V, // #V by 3 list of mesh vertex positions
const Eigen::Matrix... | ALGO | 0.99938 | 7.029341 |
005fa696-b85f-485d-8cb3-1a837b502928 | LeeJaeJun1/Data-Struct | 9week/24-1 3๋ฒ.cpp | #include<iostream>
#include<list>
#include<vector>
using namespace std;
struct Compare{
bool operator()(int lhs, int rhs) {
return lhs > rhs;
}
};
// ์ ๋ ฌ๋์ง ์์ ์ํ์ค ๊ธฐ๋ฐ
class UnsortedSequencePQ {
public:
Compare comp;
list<int> elements;
UnsortedSequencePQ() = default;
int size() {
... | ALGO | 0.999757 | 3.153035 |
76d5f1e9-f4c7-4d4d-a8ea-648cd77683df | sarvex/leetcode-haxe | solution/0700-0799/0778.Swim in Rising Water/Solution.cpp | class Solution {
public:
vector<int> p;
int swimInWater(vector<vector<int>>& grid) {
int n = grid.size();
p.resize(n * n);
for (int i = 0; i < p.size(); ++i) p[i] = i;
vector<int> hi(n * n);
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
... | ALGO | 0.999989 | 6.020982 |
fe3d591c-af2f-45c2-82c0-411bf6680b84 | 27Apoorva/agora_robotics | src/navigation2/nav2_smoother/src/simple_smoother.cpp | #include <vector>
#include <memory>
#include "nav2_smoother/simple_smoother.hpp"
namespace nav2_smoother
{
using namespace smoother_utils; // NOLINT
using namespace nav2_util::geometry_utils; // NOLINT
using namespace std::chrono; // NOLINT
using nav2_util::declare_parameter_if_not_declared;
void SimpleSmoother::c... | ALGO | 0.997446 | 6.752234 |
b6197416-fd81-411a-9ef5-0807904302e6 | EnigmaHuang/ACM-ICPC-Algorithm | ๅพ่ฎบ/ๆๅฐ็ๆๆ /poj2349.cpp | #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
using namespace std;
#define MaxN 510
#define MaxE 510*510
int anse[MaxN],pos;
/*---------------Kruskal Template Start---------------*/
struct TEdge
{
int u,v,w;
}edge[MaxE];
int father[MaxN],edgenum;
void InitEdge()
{
edgenum=0;
}
vo... | ALGO | 0.99995 | 3.538419 |
e0c2d56b-b47e-45b6-a750-ea73fc789702 | solareenlo/atcoder | 05_AtCoder-Beginner-Contest/abc075/B/main.cpp | #include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int h, w;
cin >> h >> w;
vector<string> str(h);
REP(i, h) cin >> str[i];
vector<vector<int> > m(h, vector<int>(w, -1));
REP... | ALGO | 0.999939 | 3.467548 |
d5405d93-24d6-44bb-a8cc-0bc54d209707 | iamsile/ACM | number lengths.cpp | #include <iostream>
#include <math.h>
using namespace::std;
int main()
{
double sum,i;
int n;
while(cin >> n)
{
sum=0;
for(i=1;i<=n;i++)
sum+=log10(i);
cout << (int)sum+1 << '\n';
}
return 0;
}
/*Problem description
N! (N factorial) can be quite irritating and difficult to compute for large values of N... | ALGO | 0.999378 | 4.019187 |
6adfe752-e016-44a2-966a-1ec846cf61c6 | zc110747/cplusplus_application | knowledge/06.stl/stack/main.cpp | /*
std::stack ๆฏ C++ ๆ ๅๅบไธญ็ไธไธชๅฎนๅจ้้
ๅจ๏ผๅฎๆไพไบไธ็งๅ่ฟๅ
ๅบ๏ผLIFO๏ผ็ๆฐๆฎ็ปๆใ
ไธป่ฆ็น็น
1. ๅ่ฟๅ
ๅบ๏ผๅ
็ด ๆ็
งๆๅ
ฅ็้กบๅบ็้ๅบ่ฟ่กๅค็๏ผๆๅๆๅ
ฅ็ๅ
็ด ๆๅ
่ขซๅๅบใ
2. ๅบไบๅ
ถไปๅฎนๅจๅฎ็ฐ๏ผstd::stack ้ๅธธๅบไบ std::deque ๆ std::vector ๅฎ็ฐ๏ผไฝไนๅฏไปฅไฝฟ็จๅ
ถไปๅฎนๅจใ
3. ้ซๆๆไฝ๏ผๆๅ
ฅๅๅ ้คๆไฝ็ๆถ้ดๅคๆๅบฆไธบๅธธๆฐ็บงๅซ๏ผๅณ O(1)
ๆ้ ๅฝๆฐ
stack();
explicit stack(const container_type& right);
ๆๅๅฝๆฐ
empty๏ผๆฃๆฅๆ ๆฏๅฆไธบ็ฉบใ
pop๏ผ็งป้คๆ ้กถๅ
็ด ใ
push๏ผๅฐๅ
็ด ๅๅ
ฅๆ ้กถใ
size๏ผ่ฟๅๆ ไธญๅ
... | TOOL | 0.907446 | 5.972537 |
3eb3fad9-51d2-40cd-ae71-7176694c2699 | jingtaozhang18/algorithm-exercises | leetcode/700-799/724. ๅฏปๆพๆฐ็ป็ไธญๅฟ็ดขๅผ.cpp | // https://leetcode-cn.com/problems/find-pivot-index/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int pivotIndex(vector<int>& nums) {
int i, size=nums.size();
for(i=1;i<size;++i) nums[i]+=nums[i-1];
for(i=0;i<size;++i) if((i>0?nums[i-1]:0)==nums[size-1]-nums[i]) return i... | ALGO | 0.999981 | 6.064013 |
11fcf9f0-d318-4005-922e-5e8da17066c8 | allioli/paella | flutter-playground/my_infinite_list/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.997751 | 6.76073 |
861a64ca-7584-4d4e-acb5-54dffae3702c | ninag09/test | count.cpp | #include "common.h"
using namespace std;
int count(int m, int n){
if(m==1 || n==1)
return 1;
int i = count(m-1,n);
int j = count(m,n-1);
int k = count(m-1,n-1);
return i+j+k;
}
int main(){
int res = count(3,3);
cout << res << endl;
return 0;
}
| ALGO | 0.999877 | 4.797538 |
5a30bb04-57d0-4a6f-bd8e-e6097fd2fed5 | Soumithra-DNS/Problem_Solving | Codeforces/1987C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
int ans = v[n - 1];
for (int i = n - 2; i >= 0; i--)
{
if (v[i] > v[i + 1])
{
ans = ... | ALGO | 0.999554 | 5.44652 |
d5bbaf35-b556-444d-a1bc-9055d510ae52 | MartinDrab/signus | engine/src/ai/ai19.cpp | //
// Artificial Intelligence of Signus
//
// Global Intelligence
//
// Mission 19
//
// Programmed by Richard Wunsch
//
#include "headers.h"
#include "ai.h"
#include "aiglobal.h"
#include "aitowers.h"
#include "aiground.h"
#include "aiair.h"
#include "aimarine.h"
// Action Radius of Army 1
#define A1... | ALGO | 0.984547 | 3.041765 |
e8dc243c-4e80-4315-a255-acc5a3d69c79 | beingsanthosh/Leetcode | 1137-height-checker/height-checker.cpp | class Solution {
public:
int heightChecker(vector<int>& h) {
int c=0;
vector<int>vet(h);
sort(h.begin(),h.end());
for(int i=0;i<h.size();i++)
{
if(h[i]!=vet[i])
{
c++;
}
}
return c;
}
}; | ALGO | 0.999934 | 5.329078 |
ee262a9b-d83f-4bd8-a0af-2a1282b1cc9a | LimJeonghyun/CodingTestStudy | Practice/B_15953.cpp | #include <iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cout.tie(NULL);
cin.tie(NULL);
int t;
int firstFestival[21] = {500, 300, 300, 200, 200, 200, 50, 50, 50, 50, 30, 30, 30, 30, 30, 10, 10, 10, 10, 10, 10};
int secondFestival[31] = {512, 256, 256, 128, 128, 128, ... | ALGO | 0.999338 | 3.840344 |
c1396e98-5952-413c-9b47-9b65f4e52869 | BodbDearg/PsyDoom | third_party_libs/hash-library/hash-library/sha3.cpp | #include "sha3.h"
// big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
#ifndef _MSC_VER
#include <endian.h>
#endif
#include <iostream>
/// same as reset()
SHA3::SHA3(Bits bits)
: m_blockSize(200 - 2 * (bits / 8)),
m_bits(bits)
{
reset();
}
/// restart
void SHA3::reset()
{
for (size_t i = 0; i < ... | ALGO | 0.91596 | 7.149503 |
7007663c-1e88-4b93-a9ef-aa31735ddef8 | mohammedowez/Ds-and-algo | Recursion/Rat in a Maze Problem - .cpp | Input:
N = 4
m[][] = {{1, 0, 0, 0},
{1, 1, 0, 1},
{1, 1, 0, 0},
{0, 1, 1, 1}}
Output:
DDRDRR DRDDRR
Explanation:
The rat can reach the destination at
(3, 3) from (0, 0) by two paths - DRDDRR
and DDRDRR, when printed in sorted order
we get DDRDRR DRDDRR.
class Solution{
public:
... | ALGO | 0.999994 | 5.932762 |
9d489b1b-8b1c-4b02-aa23-fc3292ad0f8b | TrebledJ/attack-of-the-zip | 01-playground/app/juce/modules/juce_box2d/box2d/Collision/b2TimeOfImpact.cpp | #include "b2Collision.h"
#include "b2Distance.h"
#include "b2TimeOfImpact.h"
#include "Shapes/b2CircleShape.h"
#include "Shapes/b2PolygonShape.h"
#include <cstdio>
using namespace std;
int32 b2_toiCalls, b2_toiIters, b2_toiMaxIters;
int32 b2_toiRootIters, b2_toiMaxRootIters;
struct b2SeparationFunction
{
enum Type
... | ALGO | 0.999746 | 7.264768 |
808767df-9b01-4632-9cec-b84900c6e54a | BenjaminGoehry/BlocRF | scr_cpp/permuteByBlock.cpp | void permuteByBlock(std::vector<size_t>& permutations, int block_size, uint seed) {
std::mt19937_64 random_number_generator;
random_number_generator.seed(seed);
size_t block_oob_size = permutations.size();
size_t num_block = (size_t) floor((double) block_oob_size / block_size);
// initialization
std::vector... | ALGO | 0.999789 | 6.292033 |
12b086b8-4992-4ff0-b925-f6ff9a774ba5 | shubhamid007/Pattern-Programming-C- | pattern22.cpp | #include<bits/stdc++.h>
using namespace std;
int drawpattern(int *n)
{
for(int i=0;i<*n;i++)
{
for(int j=0;j<=i*2;j++)
{
cout<<" "<<j+1;
}
cout<<endl;
}
return 0;
}
int main(){
int n;
cout<<"Enter the value of n"<... | ALGO | 0.999038 | 3.577565 |
d743b6f3-0be5-4a51-a7a5-d53c0e06d2fb | dl8sd11/online-judge | 0contest/arc063/pA.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<double,double> pdd;
#define SQ(i) ((i)*(i))
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) int(i.size())
#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=... | ALGO | 0.999744 | 3.938327 |
ba8f126e-adfd-4eec-895d-f018bee7845f | anjalipathak13/Practice-Leetcode-Question | 2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph/2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph.cpp | class Solution {
public:
typedef long long ll;
void dfs(int node, unordered_map<int,vector<int>>& m, ll& cnt, vector<int>& vis){
vis[node] = 1;
cnt++;
for(auto& i: m[node]){
if(vis[i]==0) dfs(i,m,cnt,vis);
}
}
long long countPairs(int n, vector<vector<int>>... | ALGO | 0.999967 | 5.859042 |
50f3bab8-65ed-4f66-af0c-070fc66a424e | zeertzjq/competitive-programming | Luogu/P1251/mcmf-spfa-ek.cpp | // vim: et sw=2 fdm=marker
#include <bits/stdc++.h>
using namespace std;
//{{{
inline int gi() {
int x, f = 0;
char c;
while (!isdigit(c = getchar()))
if (c == '-')
f = 1;
for (x = c - '0'; isdigit(c = getchar()); x = x * 10 + c - '0')
;
return f ? -x : x;
}
inline long long gll() {
int f = ... | ALGO | 0.999628 | 3.611534 |
dc69037e-ba30-4e29-a7fd-36d78ff3e9d7 | mbido/raycastingPortal | sources/Wall.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include "Wall.hpp"
#define EPSILON 0.001
// bool fctCanGo(gf::Vector2f from, char direction, const std::vector<gf::Vector2f> &usefulVertices, gf::Vector2f &where)
// {
// int deltaX = 0;
// int deltaY = 0;
// bool isHorizontal; //... | ALGO | 0.997007 | 3.685135 |
b3947f08-d1f0-4a91-888c-c0364c440814 | Bhavesh9682/C- | CPP-LAB_COM-411-main/CPP-LAB_COM-411-main/Exp-6/a.cpp | //โข To delete the details of a course using a member function of course class.
#include <iostream>
#include <string>
using namespace std;
class Course {
public:
string name;
int code;
int duration;
// Parameterized constructor to add course details
Course(string n, int c, int d) {
name ... | TOOL | 0.962474 | 6.919512 |
fbc5b9dc-d003-4983-a68b-c64e79a0ca2a | 4rneee/aoc-2024 | 14/main.cpp | #include <cstdint>
#include <cstdlib>
#include <iostream>
#include <set>
#include <string>
#include "../util.h"
struct Robot {
long p_x;
long p_y;
long v_x;
long v_y;
};
void star_1(std::string file_name)
{
uint64_t result { 0 };
long MAX_X { 100 }; // 101 tiles wide (0 to 100)
long MAX_... | ALGO | 0.996959 | 5.008183 |
b18e38ba-285a-41ab-a9b1-f1728afad6ed | ishandutta2007/codeforces | platter/normal/1324/B.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> v[6001];
int main(void) {
int tc;
scanf("%d\n",&tc);
for(int t=0;t<tc;t++) {
int n;
scanf("%d\n",&n);
for(int i=0;i<n;i++) {
int x;
scanf("%d ",&x);
v[x].push_back(i);
}
scanf("\n");
bool flag=false;
for(int i=1;i<=n;i++) {
if (v[i... | ALGO | 0.999794 | 4.097448 |
8b2e7ff9-3d99-457e-acb5-72e6f457be68 | mjwybrow/dunnart | libogdf/src/planarity/EmbedPQTree.cpp | /*
* $Revision: 1.4 $
*
* last checkin:
* $Author: gutwenger $
* $Date: 2008-12-08 07:28:05 +1100 (Mon, 08 Dec 2008) $
***************************************************************/
#include <ogdf/internal/planarity/EmbedPQTree.h>
namespace ogdf{
// Overriding the function doDestruction (see basic.h)... | ALGO | 0.999327 | 6.134536 |
541067a2-8781-4443-bc31-fec8d478a9b9 | 20191844307/G37 | c5/5.13/5013/5013.cpp | // 5013.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <math.h>
int main(int argc, char* argv[])
{
double a,x1,x2,i;
scanf("%lf",&a);
x1=a/2;
x2=(x1+a/x1)/2;
for(i=1;;i++)
{
x1=x2;
x2=(x1+a/x1)/2;
if(fabs(x1-x2)>=1e-5)
break;
}
printf("The square root of %l... | ALGO | 0.999806 | 3.346925 |
d06d2fe8-dff7-4d10-a241-2a9a5e6053f4 | Dhanusritk/Leetcode-Programming-skills-1-solutions | Number-of-1-Bits.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int hammingWeight(uint32_t n) {
int count=0;
for(int i=0;i<32;i++){
if(n&1){
count++;
}
n=n>>1;
}
return count;
}
};
int main(){
Solution s;
long unsi... | ALGO | 0.999936 | 5.601431 |
e47fbafe-8c69-4aa8-bf40-f9681878217b | aditiarya1001/leetcode | 2710-remove-trailing-zeros-from-a-string/2710-remove-trailing-zeros-from-a-string.cpp | // class Solution {
// public:
// string removeTrailingZeros(string num) {
// int indx = num.size() - 1; // Initialize with the last index
// for (int i =0;i<num.size();i++) {
// if (num[i] != '0') {
// indx = i; // Update indx to the index of the last non-zero c... | ALGO | 0.998193 | 6.171151 |
cace9750-c3bb-4bd4-acd7-111a7edc4fcf | yryrrf/LeetCode | Problems/C++/Easy/Tree/100. Same Tree.cpp | /*
Runtime: 3 ms, faster than 47.36% of C++ online submissions for Same Tree.
Memory Usage: 10 MB, less than 42.97% of C++ online submissions for Same Tree.
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(n... | ALGO | 0.999968 | 6.675782 |
6634380c-c582-4d7e-8bdd-21f7b727be9c | OzziOsbarn/2044 | NetBeans.cpp | /*******************************************************************************
*
* 2019 TUSUR, FB Osipov Daniil
*
* File : NetBeans.cpp
* Compiler : NetBeans IDE 8.2 RC
* Version : 1.0
* Created File : 19.03.2019
* Last modified : 19.03.2019
*
* Support mail : <EMAIL>
*
*... | TOOL | 0.928771 | 3.211596 |
9e6899ab-ce6b-4fea-8c30-1afecc069638 | ypengluo/CPrimerPlus | bookcodes/chapter06/cinfish.cpp | // cinfish.cpp -- non-numeric input terminates loop
#include <iostream>
const int Max = 5;
int main()
{
using namespace std;
// get data
double fish[Max];
cout << "Please enter the weights of your fish.\n";
cout << "You may enter up to " << Max
<< " fish <q to terminate>.\n";
cout << "fi... | TOOL | 0.851677 | 3.531509 |
a0e113a9-88f4-4012-b671-8860494cf4e2 | shifasarthar/goldentouch22 | power.cpp | #include<stdio.h>
int main()
{
int base,exp;
long double result=1.0;
printf("Enter a base number:");
scanf("%d",&base);
printf("Enter an exponent:");
scanf("%d",&exp);
while(exp!=0){
result*=base;
--exp;
}
printf("Answer=%.0lf",result);
return 0;
}
| ALGO | 0.999935 | 3.258741 |
1d536ef2-ee3f-4fa1-9ab5-59747c09ce7c | Anshu1Gupta/CP_-_DSA | Digit_Operation.cpp |
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
std::mt19937 rng((long long) std::chrono::steady_clock::now().time_since_epoch().count());
//sorting map by values;
bool sortbyCond(const pair<long long, long long>& a,
const pair<long long, long long>& b)
{
if... | ALGO | 0.999951 | 4.755997 |
dd58749e-3d85-47df-b176-d4730caa3082 | ishandutta2007/codeforces | wzyyn/normal/1510/B.cpp | #include<bits/stdc++.h>
using namespace std;
const long long inf=1000000000000000000ll;
int q[2000200],l,r,cnt,n,d,x,hd[2200],la[2200],f[2200],lo[2200];
struct node{int to,next,c,val;}e[2000010];
char s[1100];
bool inq[2200];
long long dis[2200];
vector<int> pa;
void add(int x,int y,int c,int val)
{
e[++cnt]=(node){... | ALGO | 0.999934 | 3.619712 |
db641fd2-83d1-48e7-a344-2c41cad32ee2 | SwapnilSoni1999/framework_av-pfos | media/libstagefright/codecs/amrnb/enc/src/g_code.cpp | /*
------------------------------------------------------------------------------
Filename: /audio/gsm_amr/c/src/g_code.c
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: The return of L_mult was being stored in a Word16 before it ... | ALGO | 0.999898 | 6.735586 |
0c9d1a8b-5a50-47bb-899b-6591b3c08ce7 | Byeongchan99/Algorithm_Study | 2020-11-17-baekjoon1330Class1.cpp | 1330๋ฒ ๋ ์ ๋น๊ตํ๊ธฐ
๋ ์ ์ A์ B๊ฐ ์ฃผ์ด์ก์ ๋, A์ B๋ฅผ ๋น๊ตํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค.
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
using namespace std;
int main() {
int A, B;
scanf("%d %d", &A, &B);
if (A > B)
printf(">");
else if (A < B)
printf("<");
else
printf("==");
return 0;
}
| ALGO | 0.999917 | 4.169027 |
a1e9857f-1d23-4ca7-a085-2a186853876d | Angera-Silas/C-Codes-for-Beginners | factorial.cpp | #include<iostream>
using namespace std;
int main()
{
int a,fact=1,i;
cout<<"Enter the number: ";
cin>>a;
for(i=a;i>0;i--)
{
fact*=i;
}
cout<<"factorial of "<<a<<" is "<<fact<<"\n";
return 0;
} | ALGO | 0.999793 | 3.461339 |
21f18b2a-6b70-40a3-9e06-d610cc7bd4bc | alexanderommel/Competitive-Programming | Codeforces/Easy Assembly/e1773.cpp | #include <bits/stdc++.h>
#define pb push_back
#define vi vector<int>
#define ll long long
#define vll vector<long long>
#define fr(s,n,i) for (long long i=s; i<n; ++i)
#define fri(s,e,i) for (long long i=s; i>=e; --i)
#define len(arr) arr.size()
#define viin(vec,n) fr(0,n,i){int x; cin>>x; vec.pb(x);}
#define vllin(vec... | ALGO | 0.999856 | 4.19388 |
88159e0b-20aa-429d-8fd8-47a76fa4914b | YoungCIoud/PracticeOfFishAcmer | AtCoder/abc379/D.cpp | #include<bits/stdc++.h>
#ifdef LOCAL_MACHINE
#define debug(...) printf(__VA_ARGS__)
#define sp() system("pause")
#define IOS
#define cout cout << ">>>\t"
#else
#define debug(...)
#define sp()
#define IOS std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0)
#endif
using i64 = ... | ALGO | 0.998244 | 4.944371 |
383ccd26-74ab-4e1e-887e-c0414b5beb06 | ishandutta2007/codeforces | sevenkplus/normal/15/B.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
int t;
long long n,m,a,b,c,d;
for(scanf("%d",&t);t--;)
{
scanf("%I64d%I64d%I64d%I64d%I64d%I64d",&n,&m,&a,&b,&c,&d);
a=abs(a-c),b=abs(b-d);
printf("%I64d\n",n*m-2*(n-a)*(m-b)+max(n-2*a,0LL)*max(m-2*b,0LL));
... | ALGO | 0.999479 | 3.725889 |
c641e2a0-dd44-40fc-88a9-9d15e00e5ed5 | MahdiTavakol/Courses-EPCC-OpenMP-MandelbrotSet | C++_timing_memory_4/main.cpp | #include <cmath>
#include <iostream>
#include <fstream>
#include <chrono>
#include <map>
#include <omp.h>
#include "definitions.h"
#include "array.h"
#include "complex.h"
#include "memory.h"
#include "mandelbrot.h"
#include "mandelbrot_xmesh.h"
#include "mandelbrot_ymesh.h"
#include "mandelbrot_xmesh_innerloop.h"
#in... | TOOL | 0.923858 | 5.550952 |
3e87b241-824a-4af5-b143-4f8ef78e345a | ishandutta2007/codeforces | kubic/normal/639/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 300005
#define LIM 1000005
#define pb push_back
#define gc() (P1==P2 && (P2=(P1=buf)+fread(buf,1,LIM,stdin),P1==P2)?EOF:*P1++)
#define set(a,vl) memset(a,vl,sizeof(a))
char *P1,*P2,buf[LIM];
int n,m,c,nw,a1[N],a2[N],z1[N],z[N],vs[N],lg[N*2];bool ans;
int rt[N],dfn... | ALGO | 0.999977 | 4.089119 |
66d53e0d-a064-4f7c-9174-3a5e792b2b53 | Pramodms/opencv_images | samples/cpp/train_svmsgd.cpp | #include "opencv2/core.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/ml.hpp"
using namespace cv;
using namespace cv::ml;
struct Data
{
Mat img;
Mat samples; //Set of train samples. Contains points on image
Mat responses;... | ALGO | 0.949547 | 5.048038 |
312c1186-fcc7-4579-ac59-10704f1e8716 | alonso284/Competitive-Programming | Sorting and Searching/Sliding_Cost.cpp | // Alonso Huerta Escalante
// Link: https://cses.fi/problemset/task/1077/
#include <iostream>
#include <set>
#include <cstdlib>
using namespace std;
long long sumaMenores, sumaMayores;
long long n, k;
set< pair<long long,long long> > menores, mayores;
void level(){
if(mayores.size() > menores.size()){
set< pa... | ALGO | 0.999854 | 3.461863 |
6e464b14-7f83-47e6-b858-e70702696a6a | cwang588/algorithms | Codeforces Round #730 (Div. 2)/C.cpp | #include<bits/stdc++.h>
using namespace std;
const double eps=0.000000001;
double ans;
void dp(double c,double m,double p,double v,double now,int depth){
if(abs(p-1.0)<eps){
ans+=now*depth;
// cout<<now*depth<<endl;
return;
}
ans+=now*p*depth;
// cout<<now*depth*p<<endl;
if(c>0){
if(c<v){
if(abs(m)>=eps)d... | ALGO | 0.999598 | 4.126468 |
6d154e98-f345-429e-b8e4-b9b371474f21 | Haribala-09/hyprdots | User/History/-5cd0a4d3/SmwV.cpp | #include <bits/stdc++.h>
using namespace std;
#define rev(ans) reverse(ans.begin(), ans.end())
#define mems(a, n) memset(a, n, sizeof(a))
#define pb push_back
#define fst first
#define scd second
#define int long long
using pii = pair<int, int>;
using pci = pair<char, int>;
void dbg_out() { cerr << endl; }
template ... | ALGO | 0.999888 | 4.375614 |
12e355c1-725d-4d1c-a142-3a2492194a14 | Amylo-jh/baekjoon | 2000s/2743.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
cin >> str;
cout << str.length();
} | ALGO | 0.992246 | 3.593743 |
a268d672-cba2-475c-b5fa-9306c7de6db9 | GaneshBhutekar/DSA | ALL_QUESTIONS/444_smallest_substring_widow.cpp | #include<iostream>
#include<vector>
#include<map>
using namespace std;
string smallest_substring(string str,string sub){
map<char,int> all;
// initialize the first substring characters in it.
int n = str.size();
int sub_n = sub.size();
for(auto c : sub){
all[c]++;
}
int min_size= IN... | ALGO | 0.999964 | 5.328894 |
677e7120-5b3b-4ccf-9015-4a4b7e89f0e9 | KyoMiyah/AtCoder | ABC400/c4.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<n; i++)
using ll = long long;
int main() {
ll n;
cin >> n;
int bok = 0, bng = 1e9+1;
while (bok +1 != bng) {
int bmid = (bok+bng)/2;
if (bmid * bmid <= n) bok = bmid;
else bng = bmid;
}
int a... | ALGO | 0.999878 | 3.932935 |
01192c04-b42e-4dba-ab96-798dea2fc505 | Yu-Fangxu/FoR | BlocksWorld/LLMs-Planning/planner_tools/VAL/src/DYNA.cpp | /*-----------------------------------------------------------------------------
VAL - The Automatic Plan Validator for PDDL2.2
$Date: 2009-02-05 10:50:11 $
$Revision: 1.2 $
Maria Fox and Derek Long - PDDL2.2 and VAL
Stephen Cresswell - PDDL2.2 Parser
Richard Howey - Continuous Effects, derived predicates,... | TOOL | 0.883868 | 4.117427 |
11e4835e-9d1b-47e1-8294-16a7485829b4 | CertifiedJoon/Recovery_Project | Cpp_Primer_revision/cp3/3_20.cpp | #include <iostream>
#include <vector>
int main(){
typedef std::vector<int>::size_type st;
std::vector<int> iv;
int i;
while (std::cin >> i)
iv.push_back(i);
for (st i = 0, j = iv.size() - 1; i <= j; ++i , --j)
std::cout << iv[i] + iv[j] << std::endl;
} | ALGO | 0.999413 | 4.230827 |
667a1352-ef06-4436-98f7-c05c035d09dd | anandspaces/dsa | array2.cpp | // creating and printing dynamic array
#include <iostream>
using namespace std;
int main() {
int size;
cout << "Enter the size of the array: ";
cin >> size;
cout << "Initializing the array...\n";
int* array = new int[size];
cout << "Enter values in array:\n";
for(int i = 0;i < size;i++) {
... | TOOL | 0.961194 | 3.74069 |
268ad36e-1add-45a2-b5b8-3d5d7b814db5 | Talha8001/DSA | day10.cpp | #include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void printSum(int arr[][3], int row, int col){
for(int row=0; row<3; row++){
int sum = 0;
for(int col=0; col<3; col++){
sum += arr[row][col];
}
cout<<sum<<" ";
... | ALGO | 0.999501 | 3.836406 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.