uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b8c433d8-a81e-4dfb-80aa-86ae8ddfe23c | youhyeoneee/Algorithm | 백준/기초 다지기/02.DP/9095.cpp | #include <iostream>
using namespace std;
int dp[12] = {0,};
int main(){
int T;
dp[1] = 1;
dp[2] = 2;
dp[3] = 4;
cin >> T; // 테스트 케이스
for (int i=0; i<T; i++){
int n;
cin >> n;
for(int j=4; j<=n; j++){
dp[j] = dp[j-1] + dp[j-2] + dp[j-3];
}
... | ALGO | 0.999979 | 4.00951 |
807081e6-9721-40c6-8116-d45b07b7858a | NikolaM4/neetcode | Arrays and Hashings/two-integer-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> results;
for(int i = 0; i < nums.size(); i++)
for(int j = 0; j < nums.size(); j++)
if(nums[i] + nums[j] == target && i != j)
{
results.push_back(i)... | ALGO | 0.999808 | 6.135486 |
c5ae3be6-49fd-46eb-8c82-ece67db4aaac | suankun/cpp_snippets | Codewars/7kyu/10.Pair, map, set, tuple/The Office I - Outed.cpp | // https://www.codewars.com/kata/57ecf6efc7fe13eb070000e1/train/cpp
#include <string>
#include <map>
std::string outed(const std::map<std::string, int> &meet, const std::string &boss){
double totalRating = 0;
for (std::pair<std::string, int> p : meet) {
if (p.first == boss)
totalRating += 2... | TOOL | 0.86171 | 5.594877 |
b319ad0e-1e1a-412e-9eb4-36f09fb0af88 | realshak7781/Interview_DS_Algo | DP/3592. Inverse Coin Change.cpp | class Solution {
private:
vector<int> res;
vector<vector<int>> dp;
int recur(int idx, int amount, const vector<int>& coins) {
if (amount == 0)
return 1;
if (amount < 0 || idx >= coins.size())
return 0;
if (dp[idx][amount] != -1)
return dp[idx][amou... | ALGO | 0.999992 | 5.616074 |
1b68fec8-3301-4847-aa0a-1de7cb76d3c8 | itsme3030/codeForces | codeforces/1873/F.cpp | #include<bits/stdc++.h>
using namespace std;
long long t = 0;
#define ll long long int
#define gcd(a, b) __gcd((a), (b))
#define lcm(a, b) (a * b) / gcd(a, b)
// #define int long long
const ll mod = 1000000007;
const long double pi = 3.14159265358979323846264338327950288419716939937510582097494459230;
// typedef lon... | ALGO | 0.999475 | 3.566519 |
f5cd915f-f3d6-486f-a15e-0bb24fe0ccd2 | dhe032/baekjoon | 2675.cpp | #include<iostream>
#include<string>
using namespace std;
int main(void) {
int T;
cin >> T;
while (T--) {
int R;
string S;
cin >> R >> S;
for (string::iterator iter = S.begin(); iter != S.end(); ++iter) {
for (int i = 0; i < R; ++i) {
cout << *iter;
}
}
cout << endl;
}
} | ALGO | 0.998118 | 3.670673 |
d943eca3-4953-45fb-80e1-753519345327 | Jhe-Yun/Snake | src/snake.cpp | #include "snake.h"
#include<iostream>
#include<vector>
using namespace std;
snake::snake(int start_x, int start_y, int head_num)
{
/**
* 蛇初始化
* \param start_x int 傳入蛇頭的X座標
* \param start_y int 傳入蛇頭的y座標
* \param head_num int 傳入蛇的長度
*/
for(int i=head_num-1;i>=0;i--) ///將蛇身的x,y,數字加... | ALGO | 0.996717 | 4.59302 |
e699ade1-ca20-42c4-b7fc-101583b08f55 | linodurannn/Practica-C- | Primer Programa con Coment.cpp | /*
Titulo: Primer programa con comentarios
Autor: Juan David Meza Gonzales
Descripcion: Primer programa para analizar su estructura.
Fecha: 2024-01-10
*/
#include <iostream> //Inclusion de la librearia de entrada y salida.
using namespace std; //El uso de espacio de nombre para STD de la I/O.
int main() //Funcion ... | ALGO | 0.969158 | 4.014987 |
9cc0dde3-6463-467f-918e-377fe3c72cb6 | Mes0903/mes_detect_ball | 3rdparty/Eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
MatrixXf::Index maxIndex;
float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex);
std::cout << "Maximum sum at position " << maxIndex << std:... | ALGO | 0.999918 | 4.220459 |
cd396018-88b2-4d8e-a7ce-d1a7752e37fd | Akshat-Ajmera/LeetCode_Solutions | 96-unique-binary-search-trees/unique-binary-search-trees.cpp | class Solution {
private:
int solve(int n, vector<int> &dp) {
if(dp[n] != -1) return dp[n];
if(n == 0 || n == 1) return dp[n] = 1;
int ans = 0;
for(int i=0; i<n; i++) {
ans += solve(i, dp) * solve(n-i-1, dp);
}
return dp[n] = ans;
}
public:
int num... | ALGO | 0.999997 | 6.124053 |
7bf8ff94-d5d9-4274-8c98-a4e359b496f3 | SCahmedmohamed/Competitive-Programming | Codeforces GYM/ICPC Assiut University Community/Sheet #2/C. Even, Odd, Positive and Negative.cpp | // By Ahmed Mohamed Ibrahim .Mar/09/2023 19:57
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define TC int t;cin>>t;while(t--)
#define endl '\n'
#define el '\n'
#define F first
#define S second
#define One_Piece_3mk ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int N = 1e4 + 5 , inf ... | ALGO | 0.99981 | 4.755605 |
f30a2bb5-c48e-4d55-a36e-e3ae7219828a | Madhu2244/League-External-Script | TargetSelector.cpp | #include "TargetSelector.h"
#include "HeroData.h"
#include "Offsets.h"
#include <vector>
GameObject* FindClosestTarget(LoLProcessInfo& lolInfo, DWORD64 heroListArray, DWORD64 heroListSize, GameObject localHero) {
std::vector<GameObject*> allHeros;
GameObject* closestTarget = nullptr;
for (int i = 0; i < R... | ALGO | 0.986933 | 5.578217 |
d6dc9d7e-0cdd-4b09-befb-4a7472de2b72 | VarunVeginati/leetcode | 0904-fruit-into-baskets/0904-fruit-into-baskets.cpp | class Solution {
public:
int totalFruit(vector<int>& fruits) {
int ans = 0;
int a = fruits[0];
int b = -1;
int lo = 0;
int hi = -1;
pair<int,int> m = make_pair(lo,-1);
for(int i=1; i<fruits.size(); i++) {
if(fruits[i]!= a) {
... | ALGO | 0.999973 | 6.000797 |
e5a26304-7bd6-45db-a85a-e41826316a74 | jgjung9/algorithm-test-practice | BOJ/C++/done/11723.cpp | #include <iostream>
using namespace std;
int set = 0;
void add(int x) {
set |= (1 << (x - 1));
}
void remove(int x) {
set &= ~(1 << (x - 1));
}
void check(int x) {
if (set & (1 << (x - 1))) {
cout << 1 << '\n';
} else {
cout << 0 << '\n';
}
}
void toggle(int x) {
set ^= (1 <... | ALGO | 0.999462 | 5.571651 |
eea26283-4d02-458e-a528-2a0579b502bf | Thyme0113/astnn_with_semi-supervised_learning | ssl_75/data/src/fibonacci/recursive92.cpp | int memo[45] = {0};
int Fibonacci(int n) {
if(n == 0 || n == 1) return memo[n] = 1;
if(memo[n] != 0) {
return memo[n];
}
return memo[n] = Fibonacci(n - 2) + Fibonacci(n - 1);
}
int main() {
int n;
cin >> n;
cout << Fibonacci(n) << endl;
return 0;
}
| ALGO | 0.99997 | 5.259754 |
f2cb38d3-3e5a-46a8-8504-3e030acf179c | PhuczBN/DSA | DSA3025. Truc toa do.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
bool cmp(pair<int,int>a,pair<int,int>b) {
if(a.second==b.second) return a.first>b.first;
return a.second<b.second;
}
void test() {
int n;
cin>>n;
pair<int,int> a[n];
for(int i=0; i<n; i++) {
cin>>a[i].first>>a[i].second;
}
sort(a,a+n,cmp);
int ... | ALGO | 0.999938 | 5.182645 |
05439bb3-49db-469e-b3f7-16452744b5d8 | anyatamax/MIPT_Algorithms_and_Data_strustures | 3_semester/3_contest/T.cpp |
// Абитуриент Василий решил подать документы в ФПМИ. Так как Василий живёт достаточно далеко, он решил спланировать своё путешествие заранее.
// В результате долгих размышлений он пришёл к выводу, что на дорогу у него есть не более T минут, так как приёмная комиссия скоро закроется. Бюджет будущего студента также огр... | ALGO | 0.999542 | 4.391848 |
f96934a0-f7cc-442e-9f8a-593d9daf0cd5 | Aayush-Pandey05/DSA | arrays/program_03.cpp | #include<iostream>
using namespace std;
int main(){
int arr[6]= {1, 3, 4, 5, 7, 98};
int sum = 0;
for(int i = 0; i<6; i++){
sum += arr[i];
}
cout<<"The sum of all the elements of the array is:- "<<sum;
} | ALGO | 0.9937 | 3.283275 |
ec3e62a0-bbef-4b8a-bbb2-56dd8489397d | cou929/topcoder | MazeMaker.cpp | // BEGIN CUT HERE
// END CUT HERE
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
using namespace std;
class MazeMake... | ALGO | 0.999804 | 4.516706 |
c91d8cef-858f-455a-82a2-a369106b5ad0 | Viritha-D/CodeNest | lemonade_ex.cpp | #include<iostream>
using namespace std;
bool lemonade(int arr[],int n){
int five=0;
int ten=0;
for(int i=0;i<n;i++){
if(arr[i]==5){
five++;
}
else if(arr[i]==10){
if(five>0){
five--;
ten++;
}
else{
return false;
... | ALGO | 0.99924 | 5.295373 |
46c094a6-58f4-48f5-a76c-710bd167b568 | Gnaroshi/practice-algorithm-solvedac | Competition/Hjroh_Cup/1/A1.cpp | // problem: 스네이크
// id:
// time taken:
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
if (n % 2 == 1 && m % 2 == 1)
{
cout << m * n - 1;
}
else
cout << n * m;
return 0;
} | ALGO | 0.99998 | 3.492441 |
18b19713-85cb-4fe2-b3b9-319b1787289d | Kent2256/Leetcode_pactice | C++/105_constructTree/Main.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999982 | 6.705492 |
6d790f9f-61aa-4d0c-8953-a4afa8f9ab3f | ishangujarathi/CSES-Problem-Sheet | Introductory Problems/6_Number Spiral.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int y,x;
cin>>y>>x;
}
} | ALGO | 0.996435 | 3.522809 |
f76c8904-0e8b-4e47-9d3d-2c7ceb7de38f | arsbars24/C-homework | 1550 Timus/1550 Timus/1550 Timus.cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <Cmath>
#include <iomanip>
using namespace std;
int main() {
double H, W;
double x, y;
double r, PI;
double VP, VC;
PI = M_PI;
cin >> H >> W;
cin >> x >> y;
cin >> r;
x = abs(x);
y = abs(y);
if (y > x)
y = x;
VP = W * W * H / 3;
VC = PI * r * r * H ... | ALGO | 0.998037 | 3.665179 |
e5190d99-2fa9-46b5-90aa-f6a6d915d6a7 | ProgrammingProblems/Volume1 | selection/selection.cpp | int select(std::vector<int>* array, size_t k) {
sort(array->begin(),
array->begin() + array->size());
return array->at(k);
} | ALGO | 0.990672 | 4.336352 |
0e06c6be-07fa-4901-800e-a86bf5a15e6b | andrew-canada/competitive-programming | cses/dp/1639-3.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
typedef long long ll;
const int mxN = 5e3;
ll dp[mxN + 1][mxN + 1];
int main()
{
string s1, s2;
cin >> s1 >> s2;
int n = s1.size(), m = s2.size();
for (int i = 1; i <= n; i++)
{
dp[i][0] = i;
}
for (int j = 1;... | ALGO | 0.999942 | 4.0499 |
2f6a7ad5-b62e-4a4a-b847-5cfee3bb080b | Anurag-Singhal1/DSA_lovebabbar | gfg and spoj/spoj_paratha.cpp | #include<iostream>
#include<vector>
#include<algorithm> // for using binary search : STL
using namespace std;
bool possibleSol(vector<int> cookRanks, int np, int mid){
int currP = 0; // initial cooked paratha count
for(int i=0;i<cookRanks.size();i++){
int r = cookRanks[i], j=1;
int tim... | ALGO | 0.999788 | 4.201982 |
6c068aee-f63e-4bca-93fe-1b485de7eeaf | yuliy/sport_programming | codeforces/677/C/main.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <deque>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <list>
#include <algorithm>
#include <cmath>
using namespace std;
using ui64 = unsigned long long;
using i65 = long long;
static const ui64 MOD = 1e9 + 7;
ui64 Convert... | ALGO | 0.999916 | 5.212562 |
b85a15a2-8934-4d1a-9f2f-79dba8119813 | suciluz/competitive-programming | CodeCopiers/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fin '\n'
int main() {
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int n; cin>>n; unordered_set <int> s;
for(int i=0,in; i<n; i++) {cin>>in; if(in!=0)s.insert(in);}
cout<<n-s.size()<<fin;
}
| ALGO | 0.999838 | 3.694708 |
40ac9014-0ae7-4895-9850-e9bd4aa47010 | Jeff09github/firebase-get-to-know-flutter | friendly_chat/step_03/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.997514 | 6.789978 |
4eda9a4e-3b1d-4d75-ab9c-87e1000777ec | kenny824319/Algorithm-Design-and-Analysis | mini-homework/Ada's Demo Album-DP.cpp | #include <iostream>
#include <climits>
#include <vector>
using namespace std;
int main(){
int n;
long long x, y, z;
cin >> n >> x >> y >> z;
auto num = vector<long long>(n, 0);
for(int i = 0;i < n;i++)
cin >> num[i];
auto dp = vector<long long>(n, 0);
dp[1] = x * num[0] + z * num[1];
long long res = dp[1]... | ALGO | 0.999731 | 3.514605 |
a7a0a1b8-e6ce-4c7c-a9e3-d02af4f08ff2 | Husainbw786/LeetCode | 1381-design-a-stack-with-increment-operation/1381-design-a-stack-with-increment-operation.cpp | class CustomStack {
public:
vector<int>v;
int n;
CustomStack(int maxSize) {
n = maxSize;
}
void push(int x) {
if(n == v.size())
{
return;
}
v.push_back(x);
}
int pop() {
if(v.size() > 0)
{
int ... | ALGO | 0.999848 | 5.678469 |
7752332e-1b4b-4a52-9a4f-e364dae19409 | FreeFalcon/freefalcon-central | src/sim/airframe/roll.cpp | /******************************************************************************/
/* */
/* Unit Name : roll.cpp */
/* ... | ALGO | 0.965419 | 4.079093 |
7b5f5eb6-22e3-4c5a-888e-d93973fa3999 | paul2705/OI | OJ/lougu/P5020.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=1e2+5;
const int MAXS=5e4+5;
int T,n,a[MAXN];
int f[MAXS],ans;
int main(){
scanf("%d",&T);
while (T--){
int mx=0; ans=0;
scanf("%d",&n);
for (int i=0;i<MAXS;i++) f[i]=0;
for (int i=1;i<=n;i++) scanf("... | ALGO | 0.999876 | 4.064619 |
76ac2401-0aa8-4774-ac9e-b7851baa9d97 | p0unter/dude_cpp | projects/String/string4.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
main() {
char str[] = "Pounter";
char *ptr;
ptr = strchr(str, 'r');
printf("%x\n", ptr);
printf("%s\n", ptr);
char *ptr2;
ptr2 = strstr(str, "Pounter");
printf("%x\n", ptr2);
printf("%s\n", ptr2);
... | TOOL | 0.98787 | 3.917392 |
9d67a351-fa03-4acd-9170-eb0a7debbc1b | Unotherk/proyecto-estructuras-de-datos | Tabla_hash.cpp | #include "Tabla_hash.h"
#include <string>
#include <sstream>
#include <algorithm>
#include <cstdlib> // Para system()
using namespace std;
// Constructor
TablaHash::TablaHash() : tabla(TAMANO_TABLA) {}
// Funcin para limpiar pantalla
void TablaHash::limpiarPantalla() {
#ifdef _WIN32
system("cls");
#else
sys... | ALGO | 0.986741 | 5.576581 |
4ed38f6e-e11c-407d-a25e-22f1f77d47fb | venkyvt7/competitive-programming-1 | COMPFEST/2018/Final Round/A. Kocok.cpp | #include<bits/stdc++.h>
#define LL long long
#pragma GCC Optimize("O3")
using namespace std;
const LL n = 3005, MOD = 1e9 + 7;
int N;
int cnt[n][16], dp[2][1 << 16], string_bit[n];
string S[n];
void read ()
{
cin >> N;
for (int i = 1; i <= N; i ++)
{
cin >> S[i];
for (int j = 0; j < S[i].length(); j ++)
... | ALGO | 0.999994 | 4.533484 |
106ded73-eecb-4535-8d9d-c3aff35c88c9 | ljcaviedesb/Simulaciones_cpp | 2.Metodos_de_Integracion/Animaciones/c7_2Planetas.cpp | #include <iostream>
#include <cmath>
#include "../../vector.h"
/////////////////////////////////////////////////////////////////
// Dos planetas //
// //
// En este programa se simula y anima el movimiento ente do... | ALGO | 0.99952 | 4.625406 |
77420d0d-b6a9-400d-b074-3e55c97951c9 | zhengyang0106/CPractice | oj127.cpp | /*************************************************************************
> File Name: oj127.cpp
> Author:zhengyang
> Mail:<EMAIL>
> Created Time: 2019年07月21日 星期日 13时42分57秒
************************************************************************/
#include<iostream>
using namespace std;
#include<stdio.h>
#inclu... | ALGO | 0.998439 | 3.416925 |
839a92b4-ca08-431c-b545-36bff6506c91 | PlatinumNote/PlatinumCoin | src/checkpoints.cpp | #include <boost/assign/list_of.hpp> // for 'map_list_of()'
#include <boost/foreach.hpp>
#include "checkpoints.h"
#include "main.h"
#include "uint256.h"
namespace Checkpoints
{
typedef std::map<int, uint256> MapCheckpoints;
// How many times we expect transactions after the last checkpoint to
// be slowe... | TOOL | 0.908448 | 6.249832 |
9a9a5199-6a18-4b05-9628-be82e91a2c76 | amirphl/learning | leetcode/maximum-value-of-k-coins-from-piles.cpp | // https://leetcode.com/problems/maximum-value-of-k-coins-from-piles/
struct hashFunction
{
size_t operator()(const vector<int>
&myVector) const
{
std::hash<int> hasher;
size_t answer = 0;
for (int i : myVector)
{
answer ^= hasher(i) + 0x9e3779... | ALGO | 0.999858 | 5.786849 |
eb11afed-9804-4587-a31e-bf401886e103 | Bakser/Werewolf | newClient/stringoperate.cpp | #include "stringoperate.h"
std::vector<QString> split(QString text, QString pattern)
{
std::vector<QString> ans;
int last = 0, next;
while ((next = text.indexOf(pattern, last)) != -1) {
if (last < next)
ans.push_back(text.mid(last, next - last));
last = next + 1;
}
if (l... | TOOL | 0.97466 | 4.450244 |
34956278-460d-4811-93c7-f969c31000b3 | HenriqueIII/learning-cpp | Capitulo 4/exercicios/exercicio18.cpp | #include <iostream>
const int BITS_OF_CHAR = 8;
inline char getDigit (unsigned val){
return val + (val<10?'0':'A'-10);
}
char * getStrBase(unsigned num, int base =16){
const int MAX_BUFF = sizeof(int) * BITS_OF_CHAR + 1;
static char str[MAX_BUFF];
char * res = str + MAX_BUFF;
*--res=0;
if (nu... | ALGO | 0.97467 | 5.007737 |
25c2b893-660d-4e6d-9404-57869332d0a3 | anaezes/AdventOfCode2020 | days/day3.cpp | #include "days.hpp"
#include <vector>
#include <iostream>
unsigned int countTrees(std::vector<std::string> map, unsigned int incrementY, unsigned int incrementX);
void day3()
{
std::cout << "Day 3 \n";
std::vector<std::string> data = utils::getVecDataStr("days/inputs/day3.txt");
unsigned total = countTr... | ALGO | 0.999715 | 5.906839 |
1928e152-6966-46a6-ae1f-7eafc3570aec | ThomasKidane/Competitive_Programming | baekjoon/Arithmeticoperations.cpp | #include<bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
#define endl "\n";
#define ff first
#define ss second
#define forn(i,n) for(int i=0;i<n;i++)
#define dbgv(v) cout<<#v<<" "<<v<<endl
#define dbga(a,n) forn(i,n-1) {cout<<a[i]<<' ';} cout<<a[n-1]<<'\n';
void solve(){
ll n,m;
... | ALGO | 0.999757 | 3.968746 |
41ebe919-ece6-4bd2-adab-7f93ffc2e8fe | AST-TheCoder/CP-Solutions | CodeForces/GNU C++14/1604A | Era/133618090.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define Max 100000000000000
#define min_heap priority_queue <ll, v... | ALGO | 0.999876 | 4.026354 |
cbc31ebc-7c40-4b56-8971-2e7bc9199361 | lsuhpchelp/lammps-5Sep14cuda65 | src/compute_temp_ramp.cpp | #include "mpi.h"
#include "stdlib.h"
#include "string.h"
#include "compute_temp_ramp.h"
#include "atom.h"
#include "update.h"
#include "force.h"
#include "group.h"
#include "modify.h"
#include "fix.h"
#include "domain.h"
#include "lattice.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* -------... | ALGO | 0.971965 | 6.688829 |
b8a6d2a4-15ac-491d-979f-2ad3d3266e7f | RAMYANAGARAJA/C-codes | Bubblesort.cpp | //function for bubble sort
class Solution {
public:
void bubbleSort(vector<int>& arr) {
// code here
int n=arr.size();
for(int i=0;i<arr.size();i++)
{
bool swapped=false;
for(int j=0;j<n-i-1;j++)
{
if(arr[j]>arr[j+1])
... | ALGO | 0.999937 | 5.638166 |
6f93cd47-f58c-4ab8-878e-3870c8293666 | Sameer12223044/DSA | Array/Move zeroes to end.cpp | #include<bits/stdc++.h>
using namespace std;
void moveZeroes(vector<int>& nums){
int j=0;
for(int i=0;i<nums.size();i++){
if(nums[i]!=0){
swap(nums[i],nums[j]);
j++;
}
}
}
int main(){
vector<int> nums={1,0,2,0,3,4,5,0,6,0,7,8,9};
moveZeroes(nums);
for(int num:nums){
cout<<num<<" ";
}
cout<<endl;
r... | ALGO | 0.999765 | 5.040684 |
99fd7624-0813-482d-a26e-c4223b237fd4 | alexandraback/datacollection | solutions_5631572862566400_1/C++/SouthRa/P3.cpp | #include<cstdio>
#include<vector>
using namespace std;
int love[1005];
bool cnt[1005];
int ko[1005];
vector<int> k;
void init()
{
int i, j;
for(i=0;i<1003;i++){
cnt[i]=0;
ko[i]=0;
}
k.clear();
}
int circle_detect(int a)
{
bool used[1005];
vector<int> v;
int i, tmp, ans;
for(i=0;i<1003;i++) used[i]=0;
... | ALGO | 0.999777 | 4.123369 |
da53db3d-547e-4905-85cd-0dfd43583e6e | MichaelSedrak/Interactive-ARAP | ARAP/libs/libigl-2.2.0/include/igl/copyleft/quadprog.cpp | #include "quadprog.h"
#include <vector>
#include <Eigen/Dense>
IGL_INLINE bool igl::copyleft::quadprog(
const Eigen::MatrixXd & G,
const Eigen::VectorXd & g0,
const Eigen::MatrixXd & CE,
const Eigen::VectorXd & ce0,
const Eigen::MatrixXd & CI,
const Eigen::VectorXd & ci0,
Eigen::VectorXd& x)
{
... | ALGO | 0.999966 | 6.218396 |
f66b9883-b963-4075-8d2a-350e3b82022a | kuntalojha/CodeChef | School_INTEST.cpp | // Made by KUNTAL OJHA 31/01/2022
// CodeChef Begineers level.
// Link: https://www.codechef.com/submit/INTEST
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,c,count=0;
cin>>t>>c;
while(t--)
{
int i;
cin>>i;
if(i%c==0)
{
count ++;
}
... | ALGO | 0.999138 | 3.917783 |
bdc4febf-7ce8-4e4a-92ba-b0796617540e | The-Ashwani-Kumar/CSES-Sheet-Solutions | Sorting and Searching/22. Tasks and Deadlines.cpp | #include<bits/stdc++.h>
#define ll long long
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define fg(i,a,b,gap) for(ll i=a;i<=b;i+=gap)
#define v(dataType) vector<dataType>
#define vv(dataType) vector<vector<dataType>>
#define vp(dataType1,dataType2) vector<pair<dataType1,dataType2>>
#de... | ALGO | 0.999878 | 3.720266 |
ac83859e-5097-4286-acc2-3b234ac0b343 | abhiram138b/LEETCODE | 852-peak-index-in-a-mountain-array/852-peak-index-in-a-mountain-array.cpp | class Solution {
public:
int peakIndexInMountainArray(vector<int> A) {
int l = 0, r = A.size() - 1, mid;
while (l < r) {
mid = (l + r) / 2;
if (A[mid] < A[mid + 1])
l = mid + 1;
else
r = mid;
}
return l;
}
}; | ALGO | 0.999938 | 5.787193 |
b922e0a5-0f00-437d-b973-58aee182b453 | chu-siang/problem_solve | UVA/p200/p10200/p10200.cpp | //10200
#include <iostream>
using namespace std;
int sum[10001];
int judge(int x){
for(int i = 2;i * i <= x;++i)
if(x % i==0)
return 0;
return 1;
}
int main()
{
int a, b;
sum[0] = 1;
for(int i = 1;i <= 10000;++i)
sum[i] = sum[i - 1] + judge(i * i + i + 41);
while... | ALGO | 0.995294 | 3.56827 |
9bdb028f-e0d9-4d5b-9ea1-bdf4dea0a00d | anaypaul/LeetCode | RemoveComments.cpp | class Solution {
public:
vector<string> removeComments(vector<string>& source) {
bool blockOpen = false;
bool singleOpen = false;
vector<string> res;
string temp = "";
for(int i = 0; i<source.size(); i++){
if(blockOpen == false){
temp = "";
... | ALGO | 0.99858 | 4.890345 |
fa127289-6678-4b1a-8aac-1924de42e2ee | harshaveenar/Data-Structures | Quick Sort.cpp | #include <stdio.h>
void quickSort(int arr[], int left, int right) {
int i = left, j = right;
int tmp;
int pivot = arr[(left + right) / 2];
while (i <= j) {
while (arr[i] < pivot)
i++;
while (arr[j] > pivot)
j--;
if (i <= j) {
tmp = arr[i];
... | ALGO | 0.999997 | 5.582018 |
3f51dcf1-2463-4c05-801f-c984abb6eb38 | RohanKumar01/Leet-Code | Solutions/intToEng.cpp | class Solution {
public:
vector<pair<int, string>> nums ={{1000000000, "Billion"}, {1000000, "Million"},
{1000, "Thousand"}, {100, "Hundred"}, {90, "Ninety"}, {80, "Eighty"}, {70, "Seventy"},
{60, "Sixty"}, {50, "Fifty"}, {40, "Forty"}, {30, "Thirty"}, {20, "Twenty"}, {19, "Nineteen"},
{18, "Eighteen"... | ALGO | 0.999155 | 6.42671 |
df1d6bcf-a927-4d23-82a0-0802d4de4017 | rkdtmdals7710/BoJ_solve | 1439.cpp | #include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int diff=0;
for(int i=0; i<s.size()-1; i++){
if(s[i]!=s[i+1])
diff++;
}
if(diff==0)
cout << 0;
else if(diff%2==1){
diff++;
cout << diff / 2;
}
else
cout <... | ALGO | 0.999987 | 3.467775 |
b60abe9a-e9ee-4abf-b828-1ea8333973f2 | CUNGVANTHANG/C-plus-plus | C++ Theory/Basic C++/Practive 1/B5.cpp | #include <iostream>
int main(){
int length, width, cir, area;
std::cin >> length >> width;
cir = (length + width) *2;
area = length * width;
std::cout << cir << " " << area;
return 0;
} | ALGO | 0.99948 | 4.08392 |
f9e932b0-b068-410f-b290-fa6ef2436766 | llvm/clangir | libc/src/math/nvptx/ceilf.cpp | #include "src/math/ceilf.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, ceilf, (float x)) { return __builtin_ceilf(x); }
} // namespace LIBC_NAMESPACE_DECL
| ALGO | 0.86269 | 5.42824 |
eaa3f992-b85c-4928-a37c-8bc146b4116c | bm-mit/Codeforces | 1917B_EraseFirstOrSecondLetter.cpp | //* 238953003 Dec/26/2023 19:35UTC+7 Minh4893IT B - Erase First or Second Letter GNU C++14 Accepted 31 ms 1500 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ss stringstream
#define endl "\n"
#define LLMAX INT64_MAX
#define IF(cond, t, f) (cond ? t : f)
#define OFILE(finp, fout) freope... | ALGO | 0.999947 | 5.610678 |
03496a85-a6d4-4750-a6f3-6d960d8c48db | Altorias/CPlusPlus-Primer | Additional Practice/cplusplus/thread/practiceCPModelQueue.cpp | #include <iostream>
#include <pthread.h>
#include <semaphore.h>
#include <queue>
class ThreadSafeQueue{
private:
int max_capacity;
queue<int> ts_queue;
sem_t m_empty;
sem_t m_full;
pthread_mutex_t lock;
public:
// 构造函数
ThreadSafeQueue(){
sem_init(&m_empty, 0, 0);
// 设计为队列最大容量
sem_init(&m_full,0,0);
pth... | TOOL | 0.924789 | 3.615218 |
f0213144-169d-4d33-a5e4-506acaf999b3 | 19shmily/LeetCodeTest | 58.最后一个单词的长度.cpp | #include<iostream>
#include<string>
using namespace std;
class Solution_58 {
public:
int lengthOfLastWord(string s) {
int ret = 0;
int flag = 0;
for (int n = s.size() - 1; n >= 0; n--)
{
if (s[n] != ' ')
{
ret++;
flag = 1;
... | ALGO | 0.999045 | 4.618937 |
e0d6bd52-a9ba-4e5a-93c2-52eaa3410c81 | ShreyasKadiri/Coding-Mafia-Contests | Irritating_Queries.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e6+100;
vector<int> suffix_array(string &s)
{
int n = s.size(), N = n + 256;
vector<int> sa(n), ra(n);
for(int i = 0; i < n; i++) sa[i] = i, ra[i] = s[i];
for(int k = 0; k < n; k ? k *= 2 : k++)
{
vector<int> nsa(sa), nra(n), cnt(N... | ALGO | 0.999662 | 4.190147 |
55bbda29-886b-4c18-8516-aa8db1e6b8ce | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10284_3.cpp | #include<bits/stdc++.h>
using namepspace std;
int main(){
int k , a , b;
cin >> k >> a >> b;
int q = b/k;
if(k*q >= a)
cout<<"OK";
else
cout<<"NG";
} | ALGO | 0.998572 | 3.898569 |
de25a35e-4e47-4b27-8571-1f5e81cad1e6 | barrystyle/SUQA-0.17.1 | src/timedata.cpp | #if defined(HAVE_CONFIG_H)
#include <config/suqa-config.h>
#endif
#include <timedata.h>
#include <netaddress.h>
#include <sync.h>
#include <ui_interface.h>
#include <util.h>
#include <utilstrencodings.h>
#include <warnings.h>
static CCriticalSection cs_nTimeOffset;
static int64_t nTimeOffset GUARDED_BY(cs_nTimeOffse... | TOOL | 0.88621 | 6.610408 |
8a7d3ac7-e467-4ef3-ad17-a95393f3fcd6 | pablomerca/metodos-numericos | laboratorio/clase 5/eigen/eigen_ctypes_test.cpp |
#include <iostream>
#include <eigen3/Eigen/Dense>
#include <dlfcn.h>
using namespace Eigen;
extern "C" {
void matrix_vector_multiply(double* matrix, double* vector, double* result, int rows, int cols) {
Map<MatrixXd> mat(matrix, rows, cols);
Map<VectorXd> vec(vector, cols);
Map<VectorXd> ... | ALGO | 0.870789 | 3.91628 |
66777a19-67bd-4114-9fa0-aa2267f3ce8c | Ankit3019/SomeThing | Problem Solution/codeStudio_DectectAndremoveLoop.cpp | #include <iostream>
#include <vector>
using namespace std;
Node *floydDectectLoop(Node *head)
{
if (head == NULL)
return NULL;
Node *slow = head;
Node *fast = head;
while (slow != NULL && fast != NULL)
{
fast = fast->next;
if (fast != NULL)
{
fast = fas... | ALGO | 0.999884 | 4.900139 |
a03b998e-9f15-4223-af28-dd30689b70d0 | saktheeswaranswan/leetcode-monk-version-big-examples | first-missing-positive/first-missing-positive.cpp | class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
int n=nums.size();
int i=0;
while(i<n){
if(nums[i]<=0 || nums[i]>n)
i++;
else{
int v=nums[i]-1;
if(nums[i]!=i+1 && nums[v]!=v+1)
{
... | ALGO | 0.999972 | 5.079278 |
759761d6-4f5a-4859-a6b6-9dd91a0007a8 | anas3a/Online-Judge-Solutions | 796_-_Critical_Links.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpi = vector<pii>;
using vpl = vector<pll>;
#define pb push_back
#define mp make_pair
#define... | ALGO | 0.999661 | 4.3799 |
34077767-47c8-4eeb-96fb-70dc97393ae6 | NewUU-CS111-Fall2023/week-4-assignment-lifo-fifo-Sohib04 | src/task3.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
int evaluateExpression(string expression) {
stack<int> st;
for (char ch : expression) {
if (ch >= '0' && ch <= '9') {
st.push(ch - '0');
} else {
int operand2 = st.top();
st.pop();
... | ALGO | 0.999582 | 5.781065 |
61ea57df-b0b7-425c-b335-1781606aa018 | sargun4/leetcode | 835-linked-list-components/linked-list-components.cpp | class Solution {
public:
int numComponents(ListNode* head, vector<int>& nums) {
unordered_set<int> set(nums.begin(),nums.end());
int res=0;
while(head!=NULL){
if(set.count(head->val)){//if head's val exisit in nums
if(head->next==NULL || !set.count(head->next->val... | ALGO | 0.999956 | 5.854906 |
3ad888c5-da44-4bc9-9a8e-d06412cf8784 | SantiMor05/Indusmatica | Indusmática/5to ciclo/Algoritmia/Arboles/Edward-Amplitud_ConNodoArbolComoElementoDeCola/main.cpp | /*
* File: main.cpp
* Author: Ana Roncal
*
* Created on 27 de octubre de 2024, 16:56
*/
#include <iostream>
using namespace std;
#include "ArbolBB.h"
#include "funcionesABB.h"
#include "Elemento.h"
#include "funcionesAB.h"
#include "funcionesCola.h"
#include "Cola.h"
/*
* ARBOLES BINARIOS 2024-2
* Clase AB... | ALGO | 0.997 | 4.883391 |
4b371acc-e853-4e50-974d-3910d9a98414 | alexleeucsc/cse216proj | firrtl-sig-klee/kleetests2/kleetests/klee_extract/generated_cpp_files/klee_extract_14_4_8.cpp |
#include <array>
#include "uint.h"
#include "sint.h"
#include <iostream>
#include "klee.h"
#include <assert.h>
#include <algorithm>
template<int w1, int b1, int b2>
void callextract()
{{
uint64_t a;
klee_make_symbolic(&a, sizeof(a), "a");
a = a & ((1 << w1)-1);
UInt<w1> a16u(a);
uint64_t c;
... | ALGO | 0.881602 | 5.347022 |
64ff65ab-961e-43bb-8b1b-31d784d4b084 | ishandutta2007/codeforces | leaf1415/normal/1272/B.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#define llint long long
using namespace std;
llint Q;
string s;
int l, r, d, u;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> Q;
for(int q = 0; q < Q; q++){
cin >> s;
l = r = d = u = 0;
for(int i = 0; i < s.size(); i++){
if(s[i] =... | ALGO | 0.999892 | 4.18631 |
7c42a5db-5a0d-4651-ac21-e7741c8c8c2c | thm1d/Competetive-Programming | Codeforces/977c.cpp | #include<bits/stdc++.h>
#define forl(i,n) for(i=0;i<n;i++)
using namespace std;
int main()
{
int n,k,i;
cin>>n>>k;
int a[n];
forl(i,n) cin>>a[i];
sort(a,a+n);
if(n==k)
cout<<a[n-1];
else if(k==0)
if(a[0]>1)
cout<<"1";
else
cout<... | ALGO | 0.999986 | 3.230168 |
7817d5b2-58f8-4278-818c-3e34c287e82a | anuragpras/gfg-solutions | Difficulty: Easy/Product array puzzle/product-array-puzzle.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
vector<long long int> productExceptSelf(vector<long long int>& nums) {
int n=nums.size();
vector<long long ... | ALGO | 0.999837 | 6.640987 |
a80d6791-0ba0-4931-a486-4e745892fe24 | saumyap48/cpp | Sort_An_Array.cpp | /*
Dutch National Flag Algorithm (Short Notes)
Purpose:
Sort an array containing only 0, 1, and 2 in one pass and O(1) space.
Logic:
Use 3 pointers:
low → region for 0s
mid → current element
high → region for 2s
Steps:
If arr[mid] == 0: swap with low, low++, mid++
If arr[mid] == 1: mid++
If arr[mid] == 2: s... | ALGO | 0.999874 | 6.301856 |
c3b28eee-1fc4-4f3e-bfca-b5ed0af55d54 | Mohamad-hammad/Leetcode | 0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int buy=0,sell=0;
int maxprofit = 0;
for(int i=0;i<prices.size();i++)
{
if(prices[sell] - prices[buy]<0)
{
buy = sell;
sell++;
}
else if(price... | ALGO | 0.999919 | 6.04851 |
9bb2ec44-2541-45cf-8375-6c58ad676771 | Jiheyy/study | 1152.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main() {
string sentence = "";
int answer = 0;
cin >> sentence;
answer = sentence.size();
cout << answer;
}
| ALGO | 0.963771 | 3.354668 |
116aa9cf-4742-4b21-a897-75b0e697027a | Szymi76/Codeforces | B. Borze.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string ciag;
cin>>ciag;
int n=0;
while(n<ciag.length())
{
if(ciag[n]=='.') {cout<<"0"; n++;}
else
{
if(ciag[n+1]=='.') {cout<<"1"; n+=2;}
else {cout<<"2"; n+=2;}
}
}
retur... | ALGO | 0.999842 | 3.327107 |
584e56d5-3ca1-4952-bd24-d89aecbb803b | Hiyabye/Baekjoon | 04xxx/04714.cpp | #include <iomanip>
#include <iostream>
using namespace std;
void solve(void) {
double n; cin >> n;
while (n >= 0) {
cout << fixed << setprecision(2) << "Objects weighing " << n << " on Earth will weigh " << n*0.167 << " on the moon.\n";
cin >> n;
}
}
int main(void) {
ios::sync_with_stdio(false);
cin... | ALGO | 0.994867 | 4.271091 |
c05d2e9a-aa7c-4ebc-8b2d-4023d319c1ff | didrlgus/algorithm-practice | baekjoon/2631.cpp | // 줄세우기
#include<bits/stdc++.h>
using namespace std;
int n,arr[205],dp[205],ret=1;
int main() {
scanf("%d",&n);
for(int i=0;i<n;i++) {
scanf("%d",&arr[i]);
dp[i]=1;
}
for(int i=1;i<n;i++) {
for(int j=i-1;j>=0;j--) {
if(arr[j]<arr[i]&&dp[j]+1>dp[i]) {
d... | ALGO | 0.999933 | 3.834331 |
cf53e268-cfab-4544-9b8f-731237cdb0af | vivek07i/Learning-CPP | battleship.cpp | #include <iostream>
using namespace std;
int main()
{
// this is multi dimensional array which is used tlo make a ganme of battleship
// We put "1" to indicate there is a ship.
bool ships[4][4] = {
{ 0, 1, 1, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 1, 0 },
{ 0, 0, 1, 0 }
};
// Keep track of how many hits the pla... | ALGO | 0.956791 | 3.352531 |
590fa142-32b8-4b79-bffe-3202e289222c | ManishBisht777/StriverSdeSheet | binary tree/symmetrictree.cpp | bool helper(TreeNode* left, TreeNode* right)
{
if(!left && !right) return true;
else if((left &&!right)|| (right && !left)) return false;
else if(left->val!=right->val) return false;
return helper(left->left, right->right) && helper(left->right,right->left);
}
b... | ALGO | 0.999989 | 6.252687 |
d41bcd5b-5d7a-4a2b-9aec-f0aa6dffc856 | Bostrix/FSL-randomise | miscmaths/armawrap/tests/newmat/tmt8.cpp |
//#define WANT_STREAM
#include "include.h"
#include "newmatap.h"
#include "tmt.h"
#ifdef use_namespace
using namespace NEWMAT;
#endif
// **************************** test program ******************************
void Transposer(const GenericMatrix& GM1, GenericMatrix&GM2)
{ GM2 = GM1.t(); }
// this is a routin... | ALGO | 0.99074 | 5.021385 |
c7a1d3b3-0900-4b37-b8db-3dfafcfbfed6 | sspeedy99/APS-2020 | Codechef/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
const int INF=1e9+5;
vector<int> times = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 };
int32_t main()
{
IOS;
int t,m1,y1,m2,y2,flag1,flag2;
cin>>t;
while(t--) {
cin>>m1>>y1>>m... | ALGO | 0.999878 | 4.051479 |
ab584164-d463-4a8c-8687-8508c5d37eaa | BlokCAT/PacthTracing | PathTracing/BVHStruct.cpp | #pragma
#include "BVHStruct.hpp"
#include <algorithm>
#include <iostream>
void BVHstruct::BuiltBVH( int t )
{
if (!objects.empty())
{
root = recursiveBuildBVH(objects ,t);
}
return;
}
void BVHstruct::deleteNode(BVHnode* node)
{
if (node)
{
if (node->lift)deleteNode(node->lift);
if (node->right)deleteNode(n... | ALGO | 0.986623 | 3.925806 |
bb3afb22-1627-40ae-8650-7ae80233f53c | okuraofvegetable/AtCoder | atcoder.jp/abc022/abc022_c/Main.cpp | // #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
// #pragma GCC option("arch=native", "tune=native", "no-zero-upper")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef l... | ALGO | 0.999708 | 4.948734 |
366e18f6-7680-41ce-9f3c-fe0f8253474c | kliment-olechnovic/ftdmp | core/voronota/expansion_js/src/dependencies/utilities/eigen_pca.cpp | #include <cmath>
#include <stdexcept>
#include <Eigen/Dense>
#include "utilities/eigen_pca.h"
namespace eigen_pca
{
void compute_pca_and_project_on_basis(const int components, const bool no_zscores, std::vector< std::vector<double> >& io_data)
{
if(io_data.empty() || io_data.front().empty())
{
throw std::runtime... | ALGO | 0.998455 | 6.023701 |
04230dca-f84d-431d-910d-b676650e4005 | beni1026/-Algorithm- | 11728 배열합치기/소스.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int n, m;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL), cout.tie(nullptr);
cin >> n >> m;
vector<int> v(n + m);
for (int i = 0; i < n + m; i++) {
cin >> v[i];
}
sort(v.begin(), v.end())... | ALGO | 0.999835 | 3.160869 |
996826cc-de10-4ccc-aac5-c51bfe0159f1 | proRamLOGO/Competitive_Programming | CF_Educ/A.cpp | #include <bits/stdc++.h>
#define llui long long unsigned int
using namespace std ;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin) ;
freopen("output.txt","w",stdout) ;
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t ;
cin >> t ;
while ( t-- ) ... | ALGO | 0.999856 | 4.722493 |
b4e50bd7-4c15-486b-9b8a-143b157589ad | Mulab11/cntt2016-hw1 | TC-SRM-587-div1-550/zzx.cpp | #include <iostream>
#include <cstdio>
#include <utility>
#include <cassert>
#include <map>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <sstream>
#include <bitset>
#include <fstream>
#include <string... | ALGO | 0.998298 | 4.149451 |
bfc43e9c-45d0-4571-a839-a7efcc092c6e | deniscostadsc/playground | solutions/beecrowd/1263/1263.cpp | #include <cstdint>
#include <cstdio>
#include <iostream>
#include <string>
int main() {
std::int16_t c;
std::uint16_t i;
bool begin, match;
std::int16_t previous_letter, current_letter;
std::string lower = "abcdefghijklmnopqrstuvwxyz";
std::string upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
std::... | ALGO | 0.999859 | 4.447385 |
21755c88-075e-4be2-a5b4-775f6281151c | Ashu6622/DSA_Playlist | OOPs/Polymorphism/file_2.cpp | #include <bits/stdc++.h>
using namespace std;
// function overloading
class Math
{
public:
void calculate(int a)
{
cout << a * a << endl;
}
void calculate(int a, int b)
{
cout << a * b << endl;
}
void calculate(int a, int b, int c)
{
cout << a * b * c << endl... | TOOL | 0.976581 | 3.928989 |
6f5c7e3c-b7ed-40b5-b928-30b9cb52eba1 | PNNL-Comp-Mass-Spec/DeconEngineV2 | Readers/brukerBAF/mzBruker.cpp | #include "StdAfx.h"
#include "mzBruker.h"
#include <iostream>
#include <sstream>
#include "MyLibraryRegistry.h"
#include "BAFConverter.h"
void FillCommandLineVector(VectorString& vecCommandLine,
int argc, TCHAR* argv[] );
bool CheckNoFlag(const std::string& toCheck);
void Parse(const VectorString& vecCommandLin... | TOOL | 0.885442 | 3.888734 |
41cc6dd9-3a54-4879-861c-b9487463880c | kaiumuddin/DSA-Codes | Tree_Binary_Tree_Phitron/15.is_node_present____postorder____coding_ninja.cpp | /************************************************************
Following is the Binary Tree node structure
template <typename T>
class BinaryTreeNode
{
public :
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data)
{
... | ALGO | 0.99982 | 5.680119 |
89477805-0cb3-48bd-acf9-9614cbc86c8a | jkane1628/HtmControlCenter | src/htm/Cell.cpp | #include "Cell.h"
#include "Column.h"
#include "Region.h"
#include "SegmentUpdateInfo.h"
extern MemManager mem_manager;
Cell::Cell(void)
{
}
Cell::~Cell(void)
{
}
void Cell::Retire()
{
// Release all Segments.
Segment *segment;
while ((segment = (Segment*)(Segments.RemoveFirst())) != NULL) {
mem_manager.Releas... | ALGO | 0.956438 | 6.697633 |
f6762f7b-6907-4264-b037-fa30acf36503 | jiang-congcong/ncnn | ncnn-master/src/layer/arm/batchnorm_arm.cpp | #include "batchnorm_arm.h"
#if __ARM_NEON
#include <arm_neon.h>
#endif // __ARM_NEON
namespace ncnn {
DEFINE_LAYER_CREATOR(BatchNorm_arm)
int BatchNorm_arm::forward_inplace(Mat& bottom_top_blob, const Option& opt) const
{
int dims = bottom_top_blob.dims;
if (dims != 3)
return BatchNorm::forward_inpl... | ALGO | 0.961884 | 5.88368 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.