uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
441a858e-bb95-472e-b0f3-728c5d63b9e8 | shreyansh-2411/cpp_problems | codes/Sorting/count_sort.cpp | #include<iostream>
#include<vector>
using namespace std;
// function to count sort the array
void countSort(int arr[],int n,int N){
vector<int> a(N,0);
for(int i=0;i<n;i++){
a[arr[i]]++;
}
for(int i=1;i<N;i++){
a[i]+=a[i-1];
}
int ar[n];
for(int i=n-1;i>=0;i--){
a[ar... | ALGO | 0.999964 | 4.896278 |
a157a7e9-dae8-48a3-9bb6-fc5a5e072c9c | watashi/AlgoSolution | livearchive/2010/North_America.Greater_NY/4881.cpp | #include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
struct Point {
double x, y;
Point() {
}
Point(double x, double y) : x(x), y(y) {
}
double abs() const {
return hypot(x, y);
}
Point operator*(double o) const {
return Point(x * o, y * o);
}
Point operator+(const Point& o... | ALGO | 0.999147 | 3.540902 |
4c1aee54-b83f-4554-aba8-b85ad071a2fa | huangallen2008/cppcode | code/CSES/Movie Festival/Movie Festival.cpp | #include<bits/stdc++.h>
using namespace std;
int n,c=0,t=0,an=0;
main()
{
cin.tie(0);
cin.sync_with_stdio(0);
cin>>n;
vector<pair<int,int>> v(n);
for(int i=0;i<n;i++) cin>>v[i].second>>v[i].first;
sort(v.begin(),v.end());
while(c<n) {
while(c<n && v[c++].second<t){}
if(c>=n &... | ALGO | 0.999971 | 4.192872 |
a8137e1e-5c1c-44ec-ba42-f1458d738221 | igor89856/Algoritimos-2 | Lista 1/EX 4.cpp | #include<iostream>
using namespace std;
int main(){
int n=1,s,cont=0;
while(cont<3){
s=0;
n++;
for(int i=1;i<n;i++){
if(n%i==0){
s+=i;
}
}
if(s==n){
cout<<n<<" ";
cont++;
... | ALGO | 0.999909 | 3.807826 |
905b280f-0335-44f7-884d-803b3296f669 | backengineering/llvm-msvc | libcxx/src/filesystem/directory_iterator.cpp | #include <__assert>
#include <__config>
#include <errno.h>
#include <filesystem>
#include <stack>
#include <utility>
#include "error.h"
#include "file_descriptor.h"
#if defined(_LIBCPP_WIN32API)
# define WIN32_LEAN_AND_MEAN
# define NOMINMAX
# include <windows.h>
#else
# include <dirent.h> // for DIR & friends
#e... | TOOL | 0.859661 | 7.848988 |
70e2765d-e320-45f1-8574-9e561f7c7d5f | CC-WO/meikaiCbasic | meikaiCbasic/c8/list8-1.cpp | //̓ƕ_̓ij
#include <stdio.h>
int sqr_int(int x)
{
return(x * x);
}
double sqr_double(double x)
{
return(x * x);
}
int main(void)
{
int nx;
double dx;
printf("͂Ă:");
scanf_s("%d", &nx);
printf("̒l̓:%d\n", sqr_int(nx));
printf("͂Ă:");
scanf_s("%lf", &dx);
printf("̒l̓:%f\n", sqr_double(dx));
return(0);
} | TOOL | 0.901726 | 3.482884 |
a44aa9c7-2e5a-4919-b9dd-09b71ecfa2f6 | StavrosChryselis/hackerrank | Game Theory/Kitty and Katty.cpp | /*
****************************************************************
****************************************************************
-> Coded by Stavros Chryselis
-> Visit my github for more solved problems over multiple sites
-> https://github.com/StavrosChryselis
-> Feel free to email me at <EMAIL>
****... | ALGO | 0.999587 | 3.838558 |
af5a2e34-62c7-4c27-b1e0-2b3cd92e840f | PerthCharles/Coding | leetcode/C&C++/medium/JumpGameII.cpp | /*
* Jump Game II
* Given an array of non-negative integers, you are initially positioned at the first index of the array.
*
* Each element in the array represents your maximum jump length at that position.
*
* Your goal is to reach the last index in the minimum number of jumps.
*
* For exa... | ALGO | 0.999956 | 6.213249 |
0e3312f7-a8eb-4cf5-ba7a-08ace6567f98 | voldigoad-7/leetcode-gfg-solutions | 513-find-bottom-left-tree-value/513-find-bottom-left-tree-value.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.999996 | 6.374712 |
a68011e3-f5e9-4e77-8bbe-8601c227bfaf | ishandutta2007/codeforces | a_g/normal/1190/E.cpp | #include <bits/stdc++.h>
using namespace std;
// source: flashmt (https://codeforces.com/problemset/submission/1190/58870568)
const int maxn = 1e5+5;
const int lvl = 18;
const double PI = acos(-1);
int n, m;
int x[maxn];
int y[maxn];
int up[2*maxn][lvl];
double dists[maxn];
double angles[maxn];
bool check(double dis... | ALGO | 0.999987 | 4.504185 |
ff793f2d-1a20-4c91-8a83-c0e3db3306f8 | Ranamalsingh12/C-Programing | binarySearch/binaryseaQues.cpp | // pair<int, int> firstAndLastPosition(vector<int>& arr, int n, int k)
// {
// }
#include<iostream>
using namespace std;
int firstOcc(int arr[],int n, int key){
int s = 0;
int e = n-1;
int mid = s + (e-s)/2;
int ans = -1;
while(s<=e){
if(arr[mid]==key){
ans = mid;
... | ALGO | 0.999903 | 4.978456 |
925fc55a-256a-4748-8d78-2fcfc894150b | wangtongxue-369/xcpc_Code_file | file/codeforces/race2/178_edu_div2/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define INF 0x3f3f3f3f
#define PII pair<ll, ll>
const ll mod = 1e9 + 7;
const ll MAXN = 500005;
const ll base1 = 131;
const ll base2 = 127;
ll _ = 1, n, m, ans = 0, a[MAXN]; // f[MAXN];
void solve()
{
ll k;
cin >> ... | ALGO | 0.999905 | 4.595525 |
c6c22e8d-955a-41ad-afb9-908d00c90891 | maxnelso/algorithms_competitions | top_coder/SRM 630/Egalitarianism3Easy.cpp | #include <vector>
#include <list>
#include <fstream>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <c... | ALGO | 0.999391 | 3.703534 |
94526a08-6515-4a7a-af36-c483dea2ff62 | lkegel/idxrepr | src/d_tic.cpp | #include <Rcpp.h>
#include <time.h>
using namespace Rcpp;
// This is a simple example of exporting a C++ function to R. You can
// source this function into an R session using the Rcpp::sourceCpp
// function (or via the Source button on the editor toolbar). Learn
// more about Rcpp at:
//
// http://www.rcpp.org/
//... | TOOL | 0.868295 | 6.109708 |
e2eeb12c-2778-4818-86b7-cf31131d2667 | NinjaOS/packages_inputmethods_LatinIME | native/dicttoolkit/src/utils/arguments_parser.cpp | #include "utils/arguments_parser.h"
#include <unordered_set>
namespace latinime {
namespace dicttoolkit {
const size_t ArgumentSpec::UNLIMITED_COUNT = S_INT_MAX;
bool ArgumentsParser::validateSpecs() const {
std::unordered_set<std::string> argumentNameSet;
for (size_t i = 0; i < mArgumentSpecs.size() ; ++i)... | TOOL | 0.895385 | 7.133923 |
b3073d84-388f-422a-b9d6-d1fb44eb9399 | thiagomoraiis/programacao-de-computadores | lista7/k.cpp | #include <iostream>
using namespace std;
int main() {
int DIMENSAO = 5;
float matrizA[DIMENSAO][DIMENSAO];
float somaDiagonal = 0;
for (int i = 0; i < DIMENSAO; ++i) {
for (int j = 0; j < DIMENSAO; ++j) {
cout << "Digite o elemento A[" << i << "][" << j << "]: ";
cin ... | ALGO | 0.991202 | 4.34518 |
b1bd38b4-d319-492f-a4fa-68f6d63650db | heavenMOJANG/ICPC | .history/Codeforces/CF1998/C_20240811144100.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
int n, k; cin >> n >> k;
vector<int> a(n + 1), b(n + 1);
for (int i = 1; i <= n; ++ i) cin >> a[i];
f... | ALGO | 0.999986 | 4.056796 |
69c68bc9-c4dc-43a9-93de-aa790af407d5 | Sp-177/CODEFORCES | B_Erase_First_or_Second_Letter.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define f first
#define sec second
#define pb push_back
#define pu push
#define ins insert
#define po pop()
#define pob pop_back()
#define pof pop_front()
#define pf ... | ALGO | 0.999928 | 5.144057 |
bf9d71d5-9788-4dbc-b6fd-8e9799cfe77c | rkwhrcjsaud/kibum | 프로그래머스/3/92345. 사라지는 발판/사라지는 발판.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
int N, M;
int dir[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
int INF;
int sol(vector<vector<int>> board, vector<int> aloc, vector<int> bloc, int turn)
{
vector<int> pos = turn % 2 ? bloc : aloc;
if (board[pos[0]][pos[1]] == 0)
... | ALGO | 0.999756 | 5.3028 |
f4d89d9e-c9c7-4f8a-b28d-73fcb30b7bab | ArYTaN003/programs | Backtracking/NQueens.cpp | #include <bits/stdc++.h>
#include <vector>
using namespace std;
int matrix[11][11];
bool canPlace(int n,int row,int i) {
for(int p=row-1;p>=0;p--){
if(matrix[p][i]!=0){
return false;
}
}
for (int p = row - 1, j = i - 1; p >= 0 && j >= 0; p--, j--) {
if (matrix[p][j] == 1) {
return false;
... | ALGO | 0.999896 | 4.864182 |
4671bc21-1e1b-45e7-a5f4-53a8030cef2e | JoaBories/CppCarGame | Utils.cpp | #include "Utils.h"
Utils::Utils()
{
}
Utils::~Utils()
{
}
float Utils::SqrLenght(Vector2 vector)
{
return (vector.x * vector.x) + (vector.y * vector.y);
}
float Utils::Lenght(Vector2 vector)
{
return sqrtf(SqrLenght(vector));
}
Vector2 Utils::Normalize(Vector2 vector)
{
if (vector.x == 0 && vector.y == 0) retur... | TOOL | 0.981039 | 6.242114 |
8dcefb1e-e7c5-4137-a0ec-f4a568f83e30 | ashutosh2706/leetcode-solutions | Trees/2265-count-nodes-equal-to-average-of-subtree.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.999858 | 6.585402 |
0988e624-3bec-4ab7-98b1-d9eb4ba1f4c9 | Hossam44/Codeforces-Problem-Solving | A. Shortest path of the king/main.cpp | #include <iostream>
#include <string>
#include <map>
#include <queue>
#include <vector>
#include<algorithm>
#include <set>
#include <stdlib.h>
using namespace std;
int w,e;
int fx[]={-1,-1,0,1,1,1,0,-1};
int fy[]={0,-1,-1,-1,0,1,1,1};
string sd[]={"U","LU","L","LD","D","RD","R","RU"};
bool valid(int a,int s)
{
if(... | ALGO | 0.999985 | 3.244146 |
5c374fbd-d949-4479-90c9-5552e1675aa3 | quocbao0603/InterviewQuestion | Source Code/solve_xor_thamkhao.cpp | /*
Author: Bauz
Tags: interview, XOR problem
*/
#include<bits/stdc++.h>
using namespace std;
#define INT_SIZE 32
vector<int> arr;
int FindUniqueNumber(int n, int m, vector<int>& arr){
int ones = 0, twos = 0;
int common_bit_mask;
for (int i = 0; i < arr.size(); i++) {
// "ones & arr[i]" gives the ... | ALGO | 0.999996 | 4.25668 |
395f91f7-9859-46e7-9ddc-acf479a97ebe | thevishaal26/cppcodesVishal | insertionSort.cpp | #include<iostream>
using namespace std;
void printArray(int *A, int n){
for(int i = 0; i<n; i++){
cout<<A[i]<<" ";
}
cout<<endl;
}
void insertionSort(int *A, int n){
for(int i=1; i<n;i++){
cout<<"Running insertion sort pass number "<<i<<endl;
int j = i-1; int key = A[i];
... | ALGO | 0.99998 | 4.589266 |
81efc4de-3607-4f16-be85-5bac3d1811e4 | lowsfish/OI | templates/二维BIT.cpp | //POJ 2155
#include<iostream>
#include<cstdio>
#include<cstring>
#define M 1010
using namespace std;
int bit[M][M];
int N,T;
void init()
{
memset(bit,0,sizeof(bit));
}
int lowbit(int x)
{
return x&-x;
}
void update(int x,int y)
{
for(int i=x;i<=N+1;i+=lowbit(i))
for(int j=y;j<=N+1;j+=lowbit(j))
{
bit[i][j]++... | ALGO | 0.998926 | 3.347154 |
c7038002-6f1c-4704-afc1-902181476082 | koNoJOJOga/Algorithmic_learning-main | ACWingBasement/基础算法_高精度.cpp | #include <iostream>
#include <vector>
using namespace std;
const int N = 1e6 + 10; // +10 防止出现边界问题
// C = A + B
vector<int> add(vector<int> &A, vector<int> &B) // 小细节,如果不加引用会把整个数组copy一遍
{
vector<int> C;
int t = 0;
for (int i = 0; i < A.size() || i < B.size(); i ++ )
{
if (i < A.size()) t +=... | ALGO | 0.999941 | 4.540233 |
7613a0b3-5075-45f4-b7cd-aa95771096e3 | prakharmosesOK/ChatApplication | Core/Source/Core/ExtraRes/BoostAiso/boost_1_84_0/libs/url/example/mailto/mailto.cpp | //[example_mailto
/*
This example parses a mailto URL into a new
view type and prints its components to
standard output.
*/
#include <boost/url/grammar/ci_string.hpp>
#include <boost/url/grammar/parse.hpp>
#include <boost/url/optional.hpp>
#include <boost/url/rfc/absolute_uri_rule.hpp>
#include <boost/url... | TOOL | 0.932607 | 6.230598 |
3f7b47b1-9907-4e1f-aec6-ff3ae1818e3f | hvdieu/mycode | Cpp/mincost2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef pair<long long, int> lli;
typedef long long ll;
typedef unsigned long long ull;
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Rep(i,a,b) for(int i=a;i>=b;i--)
#define fi first
#define se second
#define pb push_back
#define sz(s) int(s... | ALGO | 0.999741 | 3.511266 |
82a63703-7ce0-4c90-92bf-e92971eca987 | wongjessica/csci13600-labs | lab_09/main.cpp | /*
Author: Jessica Wong
Course: CSCI 133
Instructor: Zamansky
Assignment: Lab_09
*/
#include <iostream>
#include "func.h"
using std::cout;
using std::endl;
using std::string;
int main(){
cout << "Lab 9: Pointers\n" << endl;
Coord3D pointP = {10, 20, 30};
Coord3D pointQ = {-20, 21, -22};
cout << "length(pointP): "... | TEST | 0.922707 | 4.444378 |
08e489b6-2dcb-48c0-a196-d851efef9552 | Siddhi-kothekar/leetcode_sol | 0002-add-two-numbers/0002-add-two-numbers.cpp | class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
ListNode* lnew = new ListNode(); // This will be our dummy head
ListNode* current = lnew; // Pointer to construct the new list
int sum = 0; // This will store the current sum and carry
while (l1 != nullpt... | ALGO | 0.999825 | 6.95535 |
e09406df-224a-446b-997a-c1615610b670 | Shahriar-Seam/Programming | CPP/Assiut ICPC/Sheet 4/E.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
long long sum = 0, len, i;
cin >> str;
len = str.length();
for (i = 0; i < len; i++) {
sum += str[i] - '0';
}
cout << sum;
return 0;
} | ALGO | 0.999305 | 4.497516 |
a3545f49-5c83-40ae-9b1e-4c2454875d96 | opencv/opencv_contrib | modules/optflow/src/rlofflow.cpp | namespace cv {
namespace optflow {
Ptr<RLOFOpticalFlowParameter> RLOFOpticalFlowParameter::create()
{
return Ptr<RLOFOpticalFlowParameter>(new RLOFOpticalFlowParameter);
}
void RLOFOpticalFlowParameter::setUseMEstimator(bool val)
{
if (val)
{
normSigma0 = 3.2f;
normSigma1 = 7.f;
}
... | ALGO | 0.998178 | 6.574787 |
eece8374-9a15-4f91-bdab-dcc1b177ce52 | parasnaulia/Dsa | Graph/safe_states_using_dfs.cpp | #include <iostream>
using namespace std;
#include <bits/stdc++.h>
vector<int> safe(8, 0);
void Mapi(unordered_map<int, vector<int>> &umap, int u, int v)
{
umap[u].push_back(v);
// umap[v].push_back(u);
}
bool dfs(int node, int parent, unordered_map<int, vector<int>> &adj, vector<int> &vis, vector<int> &path... | ALGO | 0.999968 | 3.853556 |
e71b8349-2be8-41f4-b993-f67d41e9fbba | YAJATapps/android_system_core | fs_mgr/libfs_avb/util.cpp | #include "util.h"
#include <dirent.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <thread>
#include <android-base/stringprintf.h>
#include <android-base/unique_fd.h>
#include <linux/fs.h>
namespace android {
namespace fs_mgr {
bool NibbleValue(const char& c, uint8_t* value) {
CHECK(value != nullptr)... | TOOL | 0.923715 | 6.831247 |
e6d0081c-135e-40dc-b8f9-0ac6c9018853 | arshlanali/DSA-Problems | 236-lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lca(TreeNode* root, TreeNode* p, TreeNode* q){
if(root==nullptr or root== p o... | ALGO | 0.999992 | 6.424063 |
91a00c99-311c-4faf-8209-ec8713390692 | Rahwik/DSA-IN-CPP | 16_Binary_Search_Tree/12_binary_search_tree.cpp | //Set in C++ STL
#include<iostream>
#include<set>
using namespace std;
int main()
{
set<int,greater<int>>s;
s.insert(10);
s.insert(1);
s.insert(5);
s.insert(4);
s.insert(201);
s.insert(54);
s.insert(42);
s.insert(443);
s.insert(23);
for(auto it = s.begin(); it != s.end(); ++i... | TOOL | 0.948427 | 6.881811 |
ef8d4d0e-906b-442c-8613-b9d30c5c8a05 | ishandutta2007/codeforces | al13n/normal/283/A.cpp | #pragma comment(linker, "/STACK:512000000")
#define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <ctime>
#include <numeric>
#include <vector>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iomanip>
... | ALGO | 0.997825 | 3.355632 |
ebbda13a-03e4-4a0e-ae9b-c04267d1ccb3 | MiguelVera08/C-Exercises-Programs | Armstrong.cpp | //Armstrong Number program to check if number input is Armstrong or not. An Armstrong number is a number equal to the sum ob its digits.
//For example 0,1,153,370,371,407
//
//371 = (3*3*3)+(7*7*7)+(1*1*1)
//where:
//(3*3*3)=27
//(7*7*7)=343
//(1*1*1)=1
//So: 27+343+1=371
#include <iostream>
using... | ALGO | 0.9998 | 4.910697 |
5d3a69e3-a5c8-4e76-849e-edaab7b62a29 | stamp465/C_Programming | Camp2_60-61/Basic/congestion.cpp.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int Threshold,M,Timeout;
cin >> Timeout >> M >> Threshold;
cout << M << endl;
int save=0,show=M;
while(1)
{
int N;
cin >> N;
if(N-save>Timeout )
{
Threshold/=2;
show=M;
}
... | ALGO | 0.999969 | 3.780674 |
3070942c-e5e1-4a97-b3f2-3c5a80ff4314 | SastaStudent/Coding_Ninjas | DP/Fibonacci.cpp | #include <iostream>
using namespace std;
int fibo(int n)
{
if(n==0)
{
return 0;
}
if(n==1)
{
return 1;
}
return fibo(n - 1) + fibo(n - 2);
}
int fibhelper(int *arr, int n)
{
if(n==0)
{
return 0;
}
if(n==1)
{
return 1;
}
if(arr[n]!=-1)
{
... | ALGO | 0.999975 | 4.507644 |
a5f0a711-9f08-4b16-a7aa-0bfc432ef103 | MostafaMohamed2001/C-Data-Structure | .history/hello_20240701124819.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
// string s;
string s[n];
for (int i = 0; i < n; i++){
cin >> s[i];
}
cout << s[1][0];
// // to check if the word repeated in the arr
// for (int i = 0; i < n; ++i){
// for (int... | ALGO | 0.999527 | 3.139625 |
f1124a71-975b-47e3-841b-4d21d4c68250 | ishandutta2007/codeforces | fengzhengwei/normal/17/E.cpp | #include<bits/stdc++.h>
#define ll long long
//#define int ll
#define dd double
using namespace std;
char gc(){static char buf[1<<16],*s,*t;if(s==t){t=(s=buf)+fread(buf,1,1<<16,stdin);if(s==t)return EOF;}return *s++;}
//#define getchar gc
ll read()
{
char c;
ll w=1;
while((c=getchar())>'9'||c<'0')if(c=='-')w=-1;
ll... | ALGO | 0.999995 | 3.870822 |
3d69c863-a4c0-4cb1-a058-8ef82769483f | H-Shen/MyCodeCollection | Hackerrank/Cpp/Preprocessor_Solution.cpp | #define INF 100000005
#define foreach(v, i) for (int i = 0; i < n; i++)
#define io(v) cin >> v
#define toStr(x) #x
#define minimum(a, b) a = min(a, b)
#define maximum(a, b) a = max(a, b)
#define FUNCTION(it_is, useless)
#include <iostream>
#include <vector>
using namespace std;
#if !defined toStr || !defined io || !... | ALGO | 0.999923 | 4.356276 |
c7cc41bf-915c-45e7-a16c-e33e98ab6666 | h3136514/Algorithm | baekjoon/수학/15595.cpp | // 해시, 소수점(오차범위)
#include <iostream>
#include <string>
#include <unordered_map>
#include <set>
using namespace std;
int N, scoreN, scoreR, memori, runt, lang, codeL, faliSum;
string user;
set<string> accesSum;
unordered_map <string, int> m;
// 정답 비율 계산하기
int main(){
cin >> N;
for(int i = 0; i < N; i++){
... | ALGO | 0.988421 | 3.844718 |
8b4af750-ccd6-4eab-b28f-bd4f13e3c246 | fgandellini/Genius | Tour.cpp | #include "Tour.h"
namespace Genius {
static bool CompareNodes(const pNode first, const int second) {
return first->Id == second;
}
pNode referenceNode = NULL;
struct NodeSorterByDistanceFromReferenceNode {
bool operator ()(pNode const& node1, pNode const& node2) const {
double distanceFromNode1 = reference... | ALGO | 0.926443 | 5.254452 |
5bc5c2aa-bf50-4509-9663-3a56c442f7bd | liangkyle08/competitive-programming | Kilonova/sap.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
const int MOD = 1e9+7;
int N, Q;
int arr[500001];
vector<int> adjList[500001];
int leftRange[500001];
int rightRange[500001];
int curPos = 0;
pair<long long, int> segTree[2000001]; // sum, last value index
int nodeVal[500001];
int tempL... | ALGO | 0.999957 | 5.096796 |
53bfbc4e-f36a-473e-9323-d4c5f9a778bf | viniciusrcamargo/Exercises_College | Trabalhos 17-10/Exer4.cpp | #include<iostream>
using namespace std;
void Produto(int F[], int G[]){
for(int i = 0; i < 20; i++){
cout<<"Informe um valor o " << (i+1)<<" do primeiro vetor"<<endl;
cin>>F[i];
}
cout<<endl;
for(int i = 0; i < 20; i++){
cout<<"Informe um valor o " << (i+1)<<" do segundo vetor"<<e... | ALGO | 0.997365 | 3.722224 |
f4bbc6aa-7435-4c77-9026-8b7cb9b429c0 | JungMinWoo99/kw-watermark-project | FrequencyDomainImageProcessing/main2.cpp | #include "DCTTransformer.h"
#include <opencv2/opencv.hpp>
#include <vector>
#include <iostream>
#include <random>
#include<math.h>
#include<algorithm>
using namespace std;
using namespace cv;
#define TH_DC 100.0
#define TH1 0.032
#define INSERTSIZE 2
float WEIGHT = 0.01;
//
vector<float> generateRandomSequence() {
... | ALGO | 0.992654 | 3.798742 |
333987ce-888e-45c3-a31a-8ebfe97c889d | Suhas-G/RayTracer | rt/integrators/recraytrace.cpp | #include <rt/integrators/recraytrace.h>
#include <rt/world.h>
#include <rt/intersection.h>
#include <rt/solids/solid.h>
#include <rt/coordmappers/coordmapper.h>
#include <rt/materials/material.h>
#include <rt/lights/light.h>
namespace rt {
bool RecursiveRayTracingIntegrator::textureMaterialPresent(const Solid* solid) ... | ALGO | 0.910389 | 5.835961 |
3b78907f-922a-49af-8dde-b7eab5924459 | ALEXMAI4/Object-oriented-programming-of-radio-engineering-problems | 15.10.24/[15.10.24].cpp | /* ЗАДАНИЕ 1
Указатели:
1. Напишите программу, которая создает целое число, затем создает указатель на это число
с помощью указателя поменяйте содержимое целого числа и выведите его на экран.
2. Напишите программу, которая динамически выделяет память для массива из 5 целых чисел,
заполните массив с... | ALGO | 0.97147 | 3.360491 |
5cd2585d-0972-4170-b11a-a2763fe446c3 | arifuljannatarif/programming-solutions | 884__B - Japanese Crosswords Strike Back__Accepted.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,t,sum=0,c=0,g=false;
cin>>n>>t;
for(int i=0; i<n; i++)
{
int x;
cin>>x;
sum+=x;
}
if((sum+n-1)==t)
cout<<"YES\n";
else
cout<<"NO\n";
} | ALGO | 0.999975 | 3.458218 |
200d8b48-e959-4366-b315-fa19a79b10ec | karygauss03/Leetcode-Solutions | 1679-shortest-subarray-to-be-removed-to-make-array-sorted/1679-shortest-subarray-to-be-removed-to-make-array-sorted.cpp | class Solution {
public:
int findLengthOfShortestSubarray(vector<int>& arr) {
int right = arr.size() - 1;
while (right > 0 && arr[right] >= arr[right - 1]) {
right--;
}
int ans = right;
int left = 0;
while (left < right && (left == 0 || arr[left - 1] <= a... | ALGO | 0.999976 | 5.977702 |
3a69a7d4-bc45-4287-a8d8-1cbd413a8703 | barrett24/Algorithms | 이전것/1181.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool comp(const string &s1, const string &s2){
if(s1.size() == s2.size()){
return s1 < s2;
}else{
return s1.size() < s2.size();
}
}
int main(){
int t;
string s;
vector<string> v;
cin >> t;
w... | ALGO | 0.999923 | 4.649495 |
942137ff-97a9-46ed-8b3d-88e450c3ec9b | shreyanshsatvik/datastructures | graph/graph.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int e;
cin>>e;
vector<int> adj[n];
for(int i=0;i<e;i++)
{
int a,b;
cin>>a>>b;
adj[a].push_back(b);
adj[b].push_back(a);
}
for(int i=0;i<=6;i++)
{
cout<<i<<"->";
... | ALGO | 0.999939 | 3.528691 |
53c8bc81-9d3b-443b-938d-1f99b61d28cf | Phant0m-a/Bloc_clean_arch | 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.9988 | 6.76073 |
051625d3-e555-4ace-8a53-7b7e8eb9ca18 | Astrohelo/Computer_Graphics | 3. házi/Skeleton.cpp | #include "framework.h"
template<class T> struct Dnum {
float f;
T d;
Dnum(float f0 = 0, T d0 = T(0)) { f = f0, d = d0; }
Dnum operator+(Dnum r) { return Dnum(f + r.f, d + r.d); }
Dnum operator-(Dnum r) { return Dnum(f - r.f, d - r.d); }
Dnum operator*(Dnum r) {
return Dnum(f * r.f, f * r.d + d * r.f);
}
... | ALGO | 0.93767 | 4.086245 |
7581699f-dc89-46a7-ad5b-84ac401a66ad | InzamZ/Inzam-XCPC-Code | Codeforces/UESTC_2021_Summer_Training_15_Div2/B.cpp | //InzamZ
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define REG register
// #define FREAD 1
const int maxn = 1e5 + 10;
const int maxb = 110;
const int inf = 1e9;
const ll Inf = 1e18;
const ll mod = 1e9 + 7;
#ifdef FREAD
inline char nc()
{
... | ALGO | 0.999893 | 3.601866 |
ea05d77d-3f79-4f9c-b963-e1f4b7d61bd7 | ravithakur-projects/Cpp-Data-Structures-and-Algorithms | trails.cpp | #include <iostream>
using namespace std;
int main(){
int x,rem;
int rev=0;
cin>>x;
while(x>0){
rem=x%10;
x=x/10;
rev=rev*10+rem;
}cout<<rev;
} | ALGO | 0.999752 | 4.734529 |
d08ae22c-85f3-4bca-8456-b3389159ebcd | victordpc/EDA | EDA-2/EDA-2/Tema8/Tema08-04.cpp |
#include "Tema08-04.h"
using namespace std;
void ejercicio0804() {
//int numCasos;
//int n;
//cin >> numCasos;
//for (int i = 0; i < numCasos; i++) {
// //Queue<int>* q = new Queue<int>();
// cin >> n;
// while (n != -1) {
// q->push_back(n);
// cin >> n;
// }
// cin >> n;
// cout << *q;
// q->reverse... | ALGO | 0.998768 | 4.084462 |
b3f77f9f-2f7b-4890-9cc0-10e106a18973 | Lauu029/EDA | Ejercicios/Ejercicios/Tema1-01-Los hermanos Dalton-PlantillaJuezCentinela.cpp | // Nombre del alumno .....
// Usuario del Juez ......
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
// 7 5 3 1
// 1 3 5 7
// Método auxiliar
// Comprueba si el vector es creciente o decreciente al calcular el sentido.
// Dependiendo del sentido conprueba recursivamente si "anterior" es m... | ALGO | 0.9992 | 4.117296 |
d7454c27-0c28-4e21-9417-097b5cb09494 | lmluque/abm | Geometria.cpp | #include <math.h>
#include "Geometria.h"
Geometria::Geometria(){
radio = 8.412710547954228;
radio_nuclear = 5.051670902881889;
area_superficial = 889.3685284131693;
polaridad = 0.0;
return;
}
void Geometria::actualizar_radio(Volumen& volumen){
static double cuatro_tercios_de_pi = 4.188790204786391;
radio = ... | ALGO | 0.9439 | 3.66997 |
4eb2ba95-259c-4962-9cde-d7278e84eaad | yash2723/Codechef | Practice Problems/1400 - 1500 (2star Beginner Level)/Total_Correct_Submissions.cpp | #include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define FAST ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define vi vector <int>
#define vll vector < ll >
#define pb push_back
#define endl '\n'
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a... | ALGO | 0.999672 | 3.563036 |
b732225b-45e7-44be-b8a8-7ee10b99d6c1 | ishandutta2007/codeforces | heno239/normal/1312/D.cpp | #pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>... | ALGO | 0.999962 | 4.337111 |
a00a961b-94c8-4fef-aadd-7279c239e4b6 | NeilSch/CS-Progs | cs111/HW2.cpp | #include<iostream>
#include<fstream>
using namespace std;
int main()
{
ofstream fout;
int star=2;
fout.open("triangle.txt");
do
{
if(star<1||star>50)
{
cout << "Invalid Input. Please Try Again." << endl;
}
cout << "Please specify the desired size of the triangle (1-50): " << endl;
cin >> sta... | ALGO | 0.880949 | 3.038985 |
c58b6558-7ee2-4295-8a7b-9eba8b9e2331 | pro-newcomer/CS106B_assignments | assign3/karel.cpp | /*
* Student: Yifan Yang
* Section: Wed 6:45
*
* This file is a recursion practice that calculates all shortest paths in a
* grid.
*/
#include <iostream> // for cout, endl
#include "recursion.h"
#include "testing/SimpleTest.h"
using namespace std;
/*
* This function takes two arguments `street` and `avenue`... | TEST | 0.993538 | 6.337533 |
ee95fc55-d139-4fb8-bd37-a11a8e1d61e3 | Johannyjm/c-pro | AtCoder/benkyokai/n2/k.cpp | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i < (n); ++i)
using namespace std;
using ll = long long;
int dy[] = {0, 1, 0, -1};
int dx[] = {1, 0, -1, 0};
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int h, w;
cin >> h >> w;
... | ALGO | 0.999925 | 4.789354 |
ae0dab9f-06bb-4d3a-8811-e7cc57cf6ada | islamifelipe/AGMO_exactAlgoritms | Corley_corrigido/2_OBJETIVOS/main.cpp | #include <iostream>
#include <map>
#include <string>
#include "Grafo.h"
#include <sys/times.h>
#include <unistd.h>
#include <pthread.h>
using namespace std;
struct tms tempsInit, tempsFinal; // para medir o tempo
int n, nA;
//map<int, int* > *X = new map<int, int* >[n+1];
map<int, int* > *X;
/* X é um vetor de ma... | ALGO | 0.999203 | 3.370821 |
b26df226-0612-4ab9-8470-f1b746a10302 | vkg001/DSA-important-question-solutions | permutation (recursion).cpp | #include<iostream>
#include<string>
using namespace std;
void permutation(string str, string ans)
{
char ch;
if(str.length()==0)
{
cout<<ans<<endl;
return;
}
int i=0;
while(i<str.length())
{
ch=str[i];
string ros=str.substr(0,i)+str.substr(i+1);
i++;
... | ALGO | 0.999937 | 4.797603 |
971c9300-d995-4213-bbc3-1d52e7be4fd2 | Harsh0721/data-structures-and-algorithms | djisktra.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 pb push_back
#define ll long long int
#define db double
#define SORTA(v) sort(v.begin(),v.end())
#define SORTD(v) sort(v.begin(),v.end(),greater<>())
#defi... | ALGO | 0.999966 | 3.984599 |
40316e34-a4a8-47e9-aba6-d3fbb3666676 | BleedingXiko/VoxelBones-4.1.3 | thirdparty/icu4c/common/filterednormalizer2.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_NORMALIZATION
#include "unicode/edits.h"
#include "unicode/normalizer2.h"
#include "unicode/stringoptions.h"
#include "unicode/uniset.h"
#include "unicode/unistr.h"
#include "unicode/unorm.h"
#include "cpputils.h"
U_NAMESPACE_BEGIN
FilteredNormalizer2::~FilteredNormalizer... | TOOL | 0.901956 | 7.671308 |
4647493d-1ba6-45be-bf7e-45af4ea36190 | Sid1608/LeetCode | 658-find-k-closest-elements/658-find-k-closest-elements.cpp | class Solution {
public:
vector<int> findClosestElements(vector<int>& arr, int k, int x) {
int n=arr.size();
priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>pq;
for(int i=0;i<n;i++){
pq.push({abs(arr[i]-x),arr[i]});
}
vector<int>ans;
... | ALGO | 0.999999 | 5.711149 |
f0e44ca0-1806-4df4-9b1e-4eebe00318d3 | FirestormViewer/3p-boost | boost/libs/graph/example/filtered_graph_edge_range.cpp | /*
Sample output:
filtered edge set: (A,B) (C,D) (D,B)
filtered out-edges:
A --> B
B -->
C --> D
D --> B
E -->
*/
#include <boost/config.hpp>
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/filtered_graph.hpp>
#include <boost/graph/graph_utility.hpp>... | ALGO | 0.999349 | 6.295903 |
d8bfcb12-154d-4636-9a24-6243140de002 | metehkaya/Algo-Archive | Problems/LeetCode/Solutions/0379.Design_Phone_Directory.cpp | class PhoneDirectory {
public:
unordered_set<int> myset;
PhoneDirectory(int maxNumbers) {
for( int i = 0 ; i < maxNumbers ; i++ )
myset.insert(i);
}
int get() {
if(myset.empty())
return -1;
unordered_set<int>::iterator iter = myset.begin();
int val... | ALGO | 0.989727 | 5.772737 |
00519c72-5787-4349-bbfe-a5b3d3bb70e5 | sasanklakimsetti/DSA-Practise | deletion_gfg.cpp | /*Given an array arr[] and a number k. The task is to delete k elements which are smaller than next element (i.e., we delete arr[i] if arr[i] < arr[i+1]) or become smaller than next because next element is deleted.
Example 1:
Input : arr[ ] = {20, 10, 25, 30, 40}
and K = 2
Output : 25 30 40
Explanation:
Firs... | ALGO | 0.999959 | 5.255821 |
3781110c-f2cc-45aa-a49f-2a6c9342b7d4 | diptu/Teaching | CSE 225L Data Structures and Algorithms/Resources/Codes Previous/Spring-2019-CSE225 1/Lab Final/main(21).cpp | #include<bits/stdc++.h>
#include"binarysearchtree.h"
#include"binarysearchtree.cpp"
using namespace std;
int main()
{
TreeType<int>BST;
BST.InsertItem(5);
BST.InsertItem(3);
BST.InsertItem(8);
BST.InsertItem(2);
BST.InsertItem(4);
BST.InsertItem(6);
BST.InsertItem(10);
int sum = ... | ALGO | 0.999976 | 4.407366 |
687df823-f215-4a7c-a607-458ccc2e8211 | z-wentao/algorithm_learning | Tree & Graph traversal/search/DFS/图的连通块划分.cpp | /*
通过多次深度优先遍历, 可以划分出一张无向图的各个连通块。
同理,对一个森林进行深度优先遍历,可以划分出森林中的每棵树,
如下代码:cnt就是无向图中连通块的个数,v 数组标记了每个点属于
哪个连通块。
*/
void dfs(int x) {
v[x] = cnt;
for (int i = head[x]; i; i = next[i]) {
int y = ver[i];
if (v[y]) continue;
dfs(y);
}
}
for (int i = 1; i <= n; i++) // 在 int main() 中
... | ALGO | 0.999688 | 4.841195 |
11d5ff6d-1882-47f6-8177-ed9504cd89b5 | qing42102/Physical_Simulation_Projects | furious_birds1/deps/libigl/include/igl/dot.cpp | // http://www.antisphere.com/Wiki/tools:anttweakbar
IGL_INLINE double igl::dot(
const double *a,
const double *b)
{
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
}
| TOOL | 0.962134 | 4.674337 |
81b8accc-1647-48d5-b81a-5b5c3f328c0f | Charbel-11/Competitive-Programming | Contests/Codeforces/627 Div3/D.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long ll;
int main() {
int n; cin >> n;
vector<int> a(n), b(n);
for (auto &x : a) { cin >> x; }
for (auto &x : b) { cin >> x; }
vector<int> aMinus(n), bMinus(n);
for (int i = 0; i < n... | ALGO | 0.999995 | 3.644991 |
5b8c7213-8ac6-41ca-a0f4-cf8ad1fe03f3 | Shashika2001/C--Ex | enum.cpp | #include <iostream>
using namespace std;
#include <conio.h> //for getche()
enum itsaWord { NO, YES };
int main() {
itsaWord isWord = NO;
char ch = 'a';
int wordcount = 0;
cout << "Enter a phrase: " <<endl;
do
{
ch = getche();
if(ch==' '|| ch=='\r')
{
if( isWord == YES )
{wordcount++;
isWord = NO; }
}
else
if( isWord =... | TOOL | 0.921528 | 3.293756 |
0f85ded4-044a-43dc-a240-5a520a1bb73a | zhbcolin/Learn_RayTracingTheRestofYourLife | test/pi_v2.cpp | #include "../src/rtweekend.h"
#include <iostream>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
int main() {
int inside_circle = 0;
int runs = 0;
std::cout << std::fixed << std::setprecision(12);
while(true) {
++runs;
auto x = random_double(-1, 1);
auto y = random_do... | ALGO | 0.998909 | 4.691802 |
3869d299-0293-43e1-8fdd-42b58e43fb32 | omarelsadanyy/bookly_app | 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 |
0f016b4e-bbad-4326-857f-88724a8d453a | vinamrajain19/Leetcode_Submissions | 1137-n-th-tribonacci-number/1137-n-th-tribonacci-number.cpp | class Solution {
public:
int tribonacci(int n) {
if(n == 0) return 0;
if(n == 1 or n == 2) return 1;
int a = 0;
int b = 1;
int c = 1;
for(int i = 3;i<=n;i++){
int n = a + b + c;
a = b;
b = c;
... | ALGO | 0.999986 | 6.15012 |
9e19b087-0866-4a14-a05e-31a6846c24c2 | miha53cevic/CPP | GameLikeProjects/Stacker V2.cpp | #include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;
//GLOBAL VARIABLES
enum direction {LEFT, RIGHT};;
class platform
{
public:
//CONSTRUCTORS
platform();
//METHODS
void draw();
void platform_move();
bool enter();
bool check();
//PUBLIC VARIABLES
bool... | TOOL | 0.871267 | 3.338758 |
0bb2d65f-5308-4e07-823c-d297d2a45a9a | Kashi1311/DSA-in-C-language | tut8.cpp | // inverted hybrid pattern //
#include <iostream>
using namespace std;
int main(){
int rows , columns;
cin>>rows>>columns;
for(int i=rows; i>=1; i--){
for(int j=1; j<=i; j++){
cout<<"*";
}
cout<<endl;
}
}
| ALGO | 0.999918 | 4.111834 |
543240c6-c2a1-4591-a771-dc8d3384d82b | cyndel1/src | engine/shared/library/sharedGame/src/shared/travel/TravelManager.cpp | #include "sharedGame/FirstSharedGame.h"
#include "sharedGame/TravelManager.h"
#include "sharedDebug/DebugFlags.h"
#include "sharedDebug/InstallTimer.h"
#include "sharedFile/Iff.h"
#include "sharedFoundation/ExitChain.h"
#include "sharedUtility/DataTable.h"
#include <map>
#include <vector>
#include <set>
// =========... | TOOL | 0.935668 | 5.697755 |
426116b5-5e2d-4785-95f7-03719e125b74 | blackix/blackix | Engine/Source/Runtime/Core/Private/Mac/MacPlatformProcess.cpp | /*=============================================================================
MacPlatformProcess.mm: Mac implementations of Process functions
=============================================================================*/
#include "CorePrivate.h"
#include "../../Launch/Resources/Version.h"
#include <mach-o/dyld.h>
... | TOOL | 0.955469 | 6.092449 |
ce405441-6f0c-488b-8044-0f61ea689a42 | anugrahk21/CPP-DSA | practicep107_hashing_1.cpp | #include <iostream>
using namespace std;
//Hashing is a technique to store and retrieve data in a fast and efficient manner.
//It is used to store key-value pairs.
#define HASH_SIZE 1000
class Student{
public:
int id;
string name;
Student(){
id = -1;
name = "";
}
};
Student Stud... | ALGO | 0.989037 | 5.760827 |
3b330638-fe04-452a-982b-4044c5496538 | AshaSatpathy08/SUPREME_2.0 | week3/ThirdLecture/towDvectore.cpp | #include <iostream>
#include<vector>
using namespace std;
int main()
{
// int arr[5];
// vector<int> v(5, 901);
// cout << "Size of vector : " << v.size();
// cout<< endl << "printing vector" << endl;
// for (int i = 0; i < v.size(); i++){
// cout << v[i] << " ";
// }
// cout << e... | ALGO | 0.974174 | 3.313621 |
11b7f160-0ba5-4415-a328-fbc9ce50b6fe | MostafaMohamed2001/C-Data-Structure | .history/hello_20240701122618.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
// string s;
string s[n];
for (int i = 0; i < n; i++){
cin >> s[i];
}
int cAppear = 0;
// to check if the word repeated in the arr
for (int i = 0; i < n; ++i){
for (int j = 0; j<... | ALGO | 0.999954 | 3.669542 |
a1123dc7-e400-4870-baff-f836b1202d3d | ishandutta2007/codeforces | rniya/normal/377/C.cpp | #define LOCAL
#include <bits/stdc++.h>
using namespace std;
#pragma region Macros
typedef long long ll;
typedef __int128_t i128;
typedef unsigned int uint;
typedef unsigned long long ull;
#define ALL(x) (x).begin(), (x).end()
template <typename T> istream& operator>>(istream& is, vector<T>& v) {
for (T& x : v) is ... | ALGO | 0.999921 | 5.070107 |
1609ea20-9384-4fc6-aa3b-07d2e1af6c46 | ehdwns1516/coding_test_practice | 프로그래머스/다리를 지나는 트럭(level2)/main.cpp | /*
https://programmers.co.kr/learn/courses/30/lessons/42583
문제 설명
트럭 여러 대가 강을 가로지르는 일차선 다리를 정해진 순으로 건너려 합니다. 모든 트럭이 다리를 건너려면 최소 몇 초가 걸리는지 알아내야 합니다. 다리에는 트럭이 최대 bridge_length대 올라갈 수 있으며, 다리는 weight 이하까지의 무게를 견딜 수 있습니다. 단, 다리에 완전히 오르지 않은 트럭의 무게는 무시합니다.
예를 들어, 트럭 2대가 올라갈 수 있고 무게를 10kg까지 견디는 다리가 있습니다. 무게가 [7, 4, 5, 6]... | ALGO | 0.999677 | 5.780874 |
3f46082f-af9f-4c11-8e15-6b21c875c128 | tomy9729/Algorithm | Baek/4673번_셀프넘버/main.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int d(int n);
int main()
{
cin.tie(NULL);
ios_base::sync_with_stdio(false);
//int N;
//cin >> N;
//cout << d(N);
int A[10001] = { 0, };
for (int i = 0; i < 10001; i++)
{
if (d(i)<10001)A[d(i)] = 1;
}
for (int i = 1; i < 10001... | ALGO | 0.998632 | 4.507223 |
6e71cd36-4d52-4880-acf6-ffe8f780eb91 | DolbyLaboratories/caf-platform-frameworks-av | media/libstagefright/codecs/mp3dec/src/pvmp3_alias_reduction.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_alias_reduction.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
----------------... | ALGO | 0.998786 | 3.930718 |
dadb2142-3ce2-430b-80c1-689afb9384b1 | voidGlitch/C-Basics | Problems on arrays/Med/prob8.1.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> printLeadersBruteForce(int arr[], int n) {
vector <int> ans;
int maxi = INT_MIN;
for(int i =n-1;i>=0;i--){
if(arr[i]>maxi){
ans.push_back(arr[i]);
}
maxi=max(maxi,arr[i]);
}
sort(ans.begin(),ans.end());
return ans;
}
int main() {
// Array... | ALGO | 0.99998 | 4.418597 |
61144759-e3f7-49aa-8747-bc7c216c29ca | Rajeshnds/Competitive-Programming | codeforces/dragonmas/codeforces(c++)_old/Joe_on_tv.cpp | #include<bits/stdc++.h>
using namespace std;
float n,a,i;
main(){
cin>>n;
for(i=n;i>=1;i--){
a+=(1/i);
}
cout<<a;
}
| ALGO | 0.999426 | 3.140587 |
3ee832c5-7a2d-4a9d-ae01-5dfb430bbe7a | fowzia-fariha/dsa-hive | 5_CycleDetectionUndirected(BFS).cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
#define opt() ios_base::sync_with_stdio(0);cin.tie(0);cout.... | ALGO | 0.999964 | 5.396803 |
adebf6b2-db50-44f0-98c7-412e612906d3 | r1407p/competitive-programing | codeforces_round/2023_08_24_Codeforces_Round_894(Div.3)/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define eb emplace_back
#define pb push_back
#define ALL(X) X.begin(), X.end()
#define rALL(X) X.rbegin(), X.rend()
typedef long long loli;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<loli, loli> pll;
typedef pa... | ALGO | 0.999902 | 3.596512 |
4c5209a6-6882-47f7-baa7-6e2f89ff7b4e | renhaofan/Source-Archive | OpenCV/opencv_contrib-3.4.5/modules/ximgproc/src/niblack_thresholding.cpp | #include "precomp.hpp"
#include <cmath>
namespace cv {
namespace ximgproc {
void niBlackThreshold( InputArray _src, OutputArray _dst, double maxValue,
int type, int blockSize, double k, int binarizationMethod )
{
// Input grayscale image
Mat src = _src.getMat();
CV_Assert(src.channels() == 1);
... | ALGO | 0.973193 | 6.460328 |
9e506afe-1045-4516-966f-8fc9c430c885 | SuryaPSG/cses | Mathematics/CountingNecklaces.cpp | #include<bits/stdc++.h>
using namespace std;
#define DONTSYNC ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) //dont use stdio with iostream functions //input and output are out of order now!
#define TEST long long T; cin>>T; while(T--)
#define endl "\n"
#define fori(a,start,end) for(int a=start;a<end... | ALGO | 0.999994 | 4.399594 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.