uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d2a086a3-cb15-43f5-a70a-d52205ac1e08 | sarvex/leetcode-shakespeare | solution/1900-1999/1915.Number of Wonderful Substrings/Solution.cpp | class Solution {
public:
long long wonderfulSubstrings(string word) {
vector<int> counter(1024);
counter[0] = 1;
long long ans = 0;
int state = 0;
for (char c : word) {
state ^= (1 << (c - 'a'));
ans += counter[state];
for (int i = 0; i < 1... | ALGO | 0.999936 | 5.60345 |
9f8c676f-249b-41e3-9c5c-026a81446817 | adhikareeprayush/CPP-ACES-2081-SUBMISSIONS | BCT/nandani/code/passbyvalue.cpp | #include<iostream>
using namespace std;
void increment(int n)
{
n=n+1;
}
void incrementbyreference(int& c)
{
c=++c;
}
int main(){
int a=2;
increment(a);
cout<<"a after increment()=>"<<a<<endl;
incrementbyreference(a);
cout<<"a after incrementbyreference()=>"<<a<<endl;
return 0;
} | ALGO | 0.992507 | 3.523501 |
d56fe0d8-a502-48ae-9025-a4494f96f515 | VishalSuledeveloper/Design_Analysis_and_Algorithm | ass3.cpp | #include<iostream>
#include<algorithm>
#include<array>
#include<chrono>
using namespace std;
int minimum_cabs(int**, int);
bool compare(int *, int *);
int main(void) {
int n;
cout << "Enter number of passengers: ";
cin >> n;
int** passengers = new int*[n];
for (auto i = 0; i < n; i++) {
cout << "Enter ... | ALGO | 0.999505 | 5.543844 |
57dc3a9e-d6ad-463f-83d3-34531977122b | raincross7/code-similarity | codes/train_code/problem018/problem018_478.cpp | // 問題の URL を書いておく
//
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
//#define ENABLE_PRINT
#if defined(ENABLE_PRINT)
#define Print(v) \
do {\
c... | ALGO | 0.999911 | 3.730041 |
082ebcc5-f570-4c94-95d7-bc0ca83d8139 | PatelManav/Codeforces_Backup | 235A.cpp | /*May The Force Be With Me*/
#include <bits/stdc++.h>
#include <stdio.h>
#include <ctype.h>
#pragma GCC optimize ("Ofast")
#define ll long long
#define MOD 1000000007
#define endl "\n"
#define vll vector<long long>
#define mll map<long long,long long>
#define pll pair<long long, long long>
#define all(c) c.begin(),c.en... | ALGO | 0.99999 | 4.44274 |
126de424-6ac9-4b19-9fc8-48167a8f0a6a | subyun/BAEKJOON | 11729.cpp | #include<stdio.h>
#include <iostream>
#include <cmath>
using namespace std;
void hanoi(int n, int start, int mid, int end) {
if (n == 1)
printf("%d %d\n", start, end);
else {
hanoi(n - 1, start, end, mid);
printf("%d %d\n", start, end);
hanoi(n - 1, mid, start, end);
}
}
int main ()
{
... | ALGO | 0.999783 | 4.106095 |
d912aafc-78c8-41c8-a8d1-1450376b628d | hugary1995/FragCount | eigen/unsupported/doc/examples/FFT.cpp | // To use the simple FFT implementation
// g++ -o demofft -I.. -Wall -O3 FFT.cpp
// To use the FFTW implementation
// g++ -o demofft -I.. -DUSE_FFTW -Wall -O3 FFT.cpp -lfftw3 -lfftw3f -lfftw3l
#ifdef USE_FFTW
#include <fftw3.h>
#endif
#include <vector>
#include <complex>
#include <algorithm>
#include <iterator>... | ALGO | 0.992928 | 6.129515 |
42dbc26d-f310-4f8a-b2e1-5eb1096502d3 | aditi415/Numerical-Analysis | MATRIX CLASS/main.cpp | // main.cpp
#include "matrix.hpp"
#include <iostream>
#include <fstream>
#include <vector>
int main() {
Matrix A;
if (!A.readFromFile("49l.txt")) {
std::cerr << "Failed to read matrix from 49l.txt\n";
return 1;
}
std::ifstream bfile("49r.txt");
if (!bfile.is_open()) {
std::... | ALGO | 0.999814 | 5.562627 |
92f63730-204e-4447-96e8-7af62da60884 | Morbi-OS/external_skia | gm/convex_all_line_paths.cpp | #include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSiz... | TEST | 0.924798 | 3.776178 |
fa515e10-7856-4726-bc3c-fc3ec4edec8c | Web3Expert47/faceRecognition | src/main/resources/opencv/sources/modules/video/src/bgfg_KNN.cpp | //#include <math.h>
#include "precomp.hpp"
namespace cv
{
/*!
The class implements the following algorithm:
"Efficient Adaptive Density Estimation per Image Pixel for the Task of Background Subtraction"
Z.Zivkovic, F. van der Heijden
Pattern Recognition Letters, vol. 27, no. 7, pages 773-780, 2006
http://www.zo... | ALGO | 0.995071 | 6.176331 |
9e6ad413-c630-4b39-900c-eeeb3fa60385 | nmtoan883/OOP_28TECH | SLIDE/C++/Mang1Chieu/B24_ViTriDauTienViTriCuoiCung.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int Maxn = 1e6 + 1;
int ans[Maxn];
int main()
{
int n , x ; cin >> n >> x;
int a[n];
for(int i= 0 ; i < n ;i++) cin >> a[i];
int vtd , vtc , ok = 0;
for(int i = 0 ; i < n ;i++)
{
if(a[i... | ALGO | 0.999976 | 4.637677 |
f81a87d1-ea0b-4750-b772-7caed358c4ec | da-karakum/HashTable | Steps/Table-4.cpp | #include <iostream>
#include <limits.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
//#include <immintrin.h>
//#include <xmmintrin.h>
//измерение функций после каждого изменения
typedef unsigned short hash_t;
const char* alloc_n_copy(const char* src)
{
int len = strlen(src);
char* dest = (ch... | TOOL | 0.941375 | 4.202158 |
e53a2bbc-9c3c-479f-bef9-b1b5357c9248 | adarshgiri125/practiceQuestion_CPP | Easy/Find all possible paths from top to bottom/find-all-possible-paths-from-top-to-bottom.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:
void solve(int i, int j,vector<vector<int>> &grid, int n, int m , vector<vector<int> > &ans, vector<int> &temp ){
if(i == n-1 && ... | ALGO | 0.99976 | 6.464633 |
8f1460b6-757b-49ff-80ba-a5265a3f72dd | Randowlh/Project_ACM_2021 | code/luogu/CF750D.cpp | #include <bits/stdc++.h>
using namespace std;
const int inf = 0x7FFFFFFF;
typedef long long ll;
typedef double db;
typedef long double ld;
template<class T>inline void MAX(T &x,T y){if(y>x)x=y;}
template<class T>inline void MIN(T &x,T y){if(y<x)x=y;}
template<class T>inline void rd(T &x){
x=0;char o,f=1;
while(... | ALGO | 0.999989 | 3.748987 |
52701c47-ea07-44d9-8e1c-bf11d050560b | plane411ticket/OOP | 23520401_BTTH1/Bai_06A/Buoi01_Bai06A.cpp | #include <iostream>
#include <vector>
using namespace std;
//So khop tung ki tu de xac nhan su xuat hien cua mang A trong B va dem so lan
int main()
{
//Khoi tao gia tri
int sopt_A, sopt_B;
vector <int>solan, mang_A, mang_B;
sopt_A = 0;
sopt_B = 0;
//Nhap so luong phan tu cua hai mang
cout... | ALGO | 0.999463 | 3.723236 |
8c9b0ee2-f42e-46b7-a984-7f5dac2f60a5 | ayushmaanxs/Data-Structures-and-Algorithms-in-Cpp | Pattern Printing/Pattern21.cpp | // Numeric Hollow inverted half pyramid
#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter number of rows: ";
cin >> n;
int b = 1;
for (int row = 0; row < n; row++)
{
int a = b;
for (int col = 1; col <= n - row; col++)
{
if (row == 0 |... | ALGO | 0.995097 | 4.182451 |
90821059-9ce5-47e4-a06a-f47278c69cc9 | ankeshbanerjee/cpp-and-dsa | Questions/Lecture 63 Binary trees part 1/04_check_if_two_trees_are_identical_or_not.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node * left;
Node * right;
Node (int data){
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
Node * createBinaryTree (Node * root){
cout << "Enter the data: " ;
int data;
c... | ALGO | 0.999724 | 4.2898 |
c0493157-b352-4030-b43d-f3224c84c632 | yjbong/problem-solving | boj/1958/1958.cpp | #include <cstdio>
#include <cstring>
char x[111],y[111],z[111];
int d[111][111][111];
int max2(int a, int b){
if(a>b) return a;
else return b;
}
int main(void){
int xl,yl,zl;
scanf("%s",x+1);
scanf("%s",y+1);
scanf("%s",z+1);
xl=strlen(x+1);
yl=strlen(y+1);
zl=strlen(z+1);
fo... | ALGO | 0.999694 | 3.758225 |
bf783853-b528-4d1b-a00a-ebfced7dff90 | Mattehxx/GamePlannerMobile | 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 |
397588c9-8014-427b-afd4-0256a3b72f93 | jlnn4171/projects | c++/miniChals/basicArith/sub.cpp | #include <iostream>
int main(){
int a, b;
std::cin >> a;
std::cin >> b;
std::cout << a << " - " << b << " = " << a - b;
} | ALGO | 0.997402 | 3.853889 |
218520e7-c19a-450d-8849-8e359a65cd38 | JoinBelieve/TheCProgrammingLanguage | chapter1/1_5_4.cpp | /**
* 统计行数、单词数、字符数
*/
#include <stdio.h>
#define IN 1
#define OUT 0
int main(){
int c , nl , nw , nc , state;
state = OUT;
nl = nw = nc = 0;
while ((c = getchar()) != EOF)
{
++nc;
if (c == '\n')
{
++nl;
}
if (c == ' ' || c == '\n' || c == '\t'... | ALGO | 0.9519 | 3.143291 |
6fb28387-7764-4f6f-b9e9-ffce9fa7aca6 | NurD04/PP1 | Lab8/I.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin >> n;
vector<int>s(n);
for (int i = 0; i < n; i++)
{
cin >> s[i];
}
cin >> k;
for (int i = 0; i < n; i++)
{
if (s[i] == k)
{
cout << "Yes";
return 0;
}
}
cout << "No";
}
| ALGO | 0.999995 | 3.739259 |
19d140e4-ad25-4a93-9c6d-810960f07019 | DynamicOvi/UVA-Solved-Problems | UVA-264 (Count on Cantor).cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t,n,p,q,r,s,u,v,w;
while(scanf("%d",&t)!=EOF)
{
n=1;
while(1)
{
p=n*(n+1)/2;
if(p>=t)
{
break;
}
r=p;
n++;
}
s=t-r;
... | ALGO | 0.999044 | 3.503662 |
1b6f7c51-6c82-4a5b-869d-a5a33f57a218 | lizethvilla8888/parcial_ | canon_defensivo.cpp | #include "canon_defensivo.h"
canon_defensivo::canon_defensivo()
{
}
canon_defensivo::canon_defensivo(float d, float Ho, float Xo, float Yo, float d0, float a, float Vxo, float Vyo, float Vi)
{
distancia = d;
posicion_x_canon_defensivo = Ho;
posicion_inicial_x_canon_defensivo = Xo;
posicion_inicial_y_... | ALGO | 0.978781 | 5.133632 |
194a5d72-e584-42bf-904f-b3f7876e5c97 | BYMBOUTSA/code_c- | classe_generique/fctgen.cpp | #include <iostream>
#include "rectangle.hpp"
template <typename T>
const T & minimum(const T &x, const T &y) {
return x < y ? x : y;
}
int main () {
int a, b;
std::cout << "a : ";
std::cin >> a;
std::cout << "b : ";
std::cin >> b;
std::cout << minimum(a, b) << std::endl;
double c = 3... | ALGO | 0.966795 | 3.578719 |
dbb786d6-4db4-49c6-aaa9-38fbdb7ba306 | ishandutta2007/codeforces | oleh1421/normal/1671/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define endl '\n'
using namespace __gnu_pbds;
typedef long double ld;
//#define int ll
using namespace std;
mt19937 rnd(time(NULL));
typedef long long ll;
const ll mod=998244353;
const ll inf=1000000000000000001;
const int N=300010;
ll a[N];
ll d[N];
voi... | ALGO | 0.999756 | 5.36634 |
0bb7b5b4-26a9-4e4d-9d5a-8112b654af3d | zhzh2001/Learning-public | c++实用代码/test&code/动态最小生成树2238 Mst/1.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#define N 50005
#define M 200005
#define ll long long
#define dep_max 19
#define inf (1<<30)
int x[M],y[M],z[M],zz[M],num[M],d[M],ord[M],opt[M],f[N],n,m,q;
ll base_ans;
struct recover{
int a[M*5],b[M*5],cnt;
int find(int x){
if (f[x]==x)return... | ALGO | 0.999746 | 3.648346 |
99a66d65-887d-40b0-bd42-b27ffee19f99 | sripriyaagarwal16/DSA-Basic_to_hard_level | recursion3/subsetsumtoK.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<unordered_map>
using namespace std;
void getuniquesubsethelper(vector<int>& arr, int index, vector<int>& current, vector<vector<int>>& result) {
result.push_back(current);
for (int i = index; i < arr.size(); i++) {
if (i > index ... | ALGO | 0.999851 | 5.910179 |
1e476909-f9be-4f18-8208-a0eab33279b3 | eXistence/fastflow | examples/matmul/tbb_matmul.cpp | #include <tbb/parallel_for.h>
#include <tbb/blocked_range.h>
#include <tbb/task_scheduler_init.h>
#include <ff/utils.hpp> // just for ffTime
static long N=0; // matrix size
static double* A=NULL; // this is pretty much equivalent to: double * restrict A = NULL;
static double* B=NULL; // this is pretty mu... | ALGO | 0.998228 | 4.478365 |
3dc9852c-9627-4ce8-be01-acdc696e38b5 | nobu-k/tekitou | src/c++/xbyak/ssecopy.cpp | #include <iostream>
#include <vector>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <stdint.h>
#include <sys/time.h>
#include <xbyak/xbyak.h>
using namespace std;
double gettimeofday_sec()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec + (double)tv.tv_usec*1e-6;
}
// Assumption... | ALGO | 0.957546 | 4.736926 |
8597c8aa-7422-400e-915b-fd72ceb70217 | wanghu534/CPP | Lessons/C1A-13 原测二/1.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int threeFlag = (n%3 == 0);
int fiveFlag = (n%5 == 0);
int sevenFlag = (n%7 == 0);
if (threeFlag)
{
if (fiveFlag)
{
if (sevenFlag)
cout << "3 5 7";
else
... | ALGO | 0.999963 | 4.09096 |
324e47eb-59e2-430d-8ef7-8d8a3d650308 | come880412/Leetcode_practice | Solution/3318.cpp | class Solution {
public:
vector<int> findXSum(vector<int>& nums, int k, int x) {
const int n = nums.size();
map<int, int, greater<int>> record;
vector<int> ans;
for (int i = 0; i < n - k + 1; ++i) {
priority_queue<pair<int, int>> pq;
int cntx = 0;
... | ALGO | 0.999973 | 5.457467 |
f079d558-5152-4e4f-b4d4-3f20529c0765 | Theprathamshah/LeetCode-1 | 682-baseball-game/682-baseball-game.cpp | class Solution {
public:
int calPoints(vector<string>& ops) {
stack<int> mystack;
char ch;
int a = 0,b = 0;
for (auto& str: ops) {
ch = str[0];
switch(ch)
{
case 'C':
mystack.pop... | ALGO | 0.999805 | 6.031891 |
03687715-912b-4c01-9abc-15298a590f49 | mainul3195/All | 2/A - Irreversible operation.cpp | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
string s;
cin >> s;
reverse(s.begin(), s.end());
long long ans=0, w=0;
for(int i=0; i<s.size(); i++)
{
if(s[i]=='W')
w++;
else
ans+=w;
}
cout << ans << "\n";
return 0;... | ALGO | 0.999846 | 3.662783 |
18bea82e-d38a-435a-a53e-6fe1e8adf9f3 | ArvinZJC/BUAAHND_G2T1_C- | L4/L4_A1_2.cpp | /* L4_A.pdf, Assignment 1, 5-digit number code encryptor;
my 2nd method (with an array) which is more practical than my 1st method */
#include <iostream>
using namespace std;
/* Encrypt a 5-digit number code. */
void Encrypt(int numberCode)
{
int number[5];
cout << "Your number code encrypted: ";
// loop to ... | ALGO | 0.999791 | 4.010524 |
1727fbb8-e3e6-43fc-be1a-92f26cd40466 | yingling-group/lammps-mspin | src/INTEL/pair_buck_intel.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Rodrigo Canales (RWTH Aachen University)
------------------------------------------------------------------------- */
#include "pair_buck_intel.h"
#include "atom.h"
#include "comm.h"
#include "error.... | ALGO | 0.947603 | 6.379068 |
3981419d-6325-4363-8c20-7593d5146162 | codeforsmart/Cp-contest | cf contest/edu 76/4.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define mod 1000000007
#define endl "\n"
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define lb lower_bound
#define debug(x) cout<<"["<<#x<<": "<<x<<"]"<<endl
#define f(i,p,n) for(ll i=p;i<n;i++)
ll exp(ll a,ll b,ll m... | ALGO | 0.999476 | 3.66028 |
43584e84-fa54-43c8-9d47-f8252c0306fd | MasterIceZ/CP-COM | POSN_62/1st_BRR2/Exercise_60/20_Castle_King.cpp | /*
TASK : Castle King
AUTHOR : Pana Wanit
LANG : C++
SCHOOL : RYW
*/
#include<bits/stdc++.h>
using namespace std;
const int mxN = 5e5+1;
int a[mxN];
int main(){
ios::sync_with_stdio(0),cin.tie(0);
int n,sum=0;
cin >> n;
for(int i=0; i<n; i++) cin >> a[i],sum+=a[i];
sum*=2;
sort(a,a+n);
sum += a[0] + a[n-1]... | ALGO | 0.999932 | 3.67692 |
0bc9f315-4c6e-4ddb-802e-66b7f8090b15 | B-Betty/ImuCam-KLT | app/src/main/cpp/eigen3/blas/double.cpp | #define SCALAR double
#define SCALAR_SUFFIX d
#define SCALAR_SUFFIX_UP "D"
#define ISCOMPLEX 0
#include "level1_impl.h"
#include "level1_real_impl.h"
#include "level2_impl.h"
#include "level2_real_impl.h"
#include "level3_impl.h"
double BLASFUNC(dsdot)(int* n, float* x, int* incx, float* y, int* incy)
{
... | ALGO | 0.998921 | 5.138801 |
5ef9dfb1-a90e-4835-871a-ce8ffb972adc | xuxiaofengz/algorithm-template | 数据结构模版/数学/逆元/线性推逆元及快速幂.cpp | //洛谷:P3811 【模板】模意义下的乘法逆元
ll inv[N];
ll n,mod;
//费马小定理
ll qpow(ll x,ll b)
{
ll res=1;
while(b){
if(b&1)res=(res*x)%mod;
x=(x*x)%mod;
b>>=1;
}
return res;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);cout.tie(nullptr);
cin>>n>>mod;
inv[1]=1;
cout<<inv[1]<<"\n";
//线性推
for(int i=2;i<=n;... | ALGO | 0.999986 | 3.953761 |
95590dc7-233d-4e8c-b88b-0bcdf69bfbb2 | anas3a/Online-Judge-Solutions | B_Pipeline.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
#defin... | ALGO | 0.999966 | 4.365247 |
473ed1c9-6691-49e7-aa54-953fc96a6f76 | Monika692/Question-Paper | 201/1b.cpp | /*Convert the following infix expression into postfix expression using Stack (Show all steps)
(A*B)/C+D*(G-H)+I/E Answer-> AB*C/DGH-*IK/++ */
#include<iostream>
#define MAX 10
using namespace std;
int top=-1;
char stack[MAX];
void push(char x)
{
stack[++top]=x;
}
char pop()
{
char p=stack[top];
top--;
... | ALGO | 0.999838 | 3.672077 |
c976aa0e-4f5a-41b7-b06b-a10f4457c395 | Hx-hus/cpp_code | 17_10_22/17_10_22/1,c.cpp | #include<stdio.h>
//int main()
//{
// double a, b, c;
// double d = 0;
// double e = 0;
// scanf_s("%lf%lf%lf", &a, &b, &c);
// d = a + b + c;
// e = d / 3;
// printf("%.2lf %.2lf", d, e);
// return 0;
//}
//
//
//
int main()
{
int a = 0;
while (scanf_s("%d", &a) != EOF)
{
int b = a % 2;
if (b == 0)
print... | ALGO | 0.999585 | 3.548567 |
31df435f-bea3-4883-9e37-e06a9bf40657 | c304728539/itpp-fastica | include/itpp/base/bessel/chbevl.cpp | #include <itpp/base/bessel/bessel_internal.h>
/*
* Evaluate Chebyshev series
*
* int N;
* double x, y, coef[N], chebevl();
*
* y = chbevl( x, coef, N );
*
* DESCRIPTION:
*
* Evaluates the series
*
* N-1
* - '
* y = > coef[i] T (x/2)
* - i
* i=0
*
* of Ch... | ALGO | 0.999944 | 5.57724 |
167ae641-1436-4fb6-b299-a42b81d87648 | SamAinsworth/gem5-triangel | src/systemc/tests/systemc/misc/synth/combo/switch5/switch5.cpp | /*****************************************************************************
switch5.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/****************************************************************************... | TOOL | 0.98155 | 4.533247 |
24efe6e5-c343-464f-a827-f946bea798e9 | rakibul0026/ICPC-Preparation-Bootcamp | For loop, while loop, do_while loop/B. Prime checking.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
long long num;
cin>>num;
bool isPrime = true;
if(num == 0 || num == 1){
isPrime = false;
}
for(int i=2;i<= sqrt(num);i++){ //
if(num % i == 0){
isPrime = false;
break;
}
}
if... | ALGO | 0.999867 | 4.47735 |
42a9aeef-7542-4128-b5c9-c96f3eda2969 | ChuanzhouYao/zkSNARK-LLVM | libs/libsnark/depends/libff/depends/xbyak/sample/calc.cpp | /*
@author herumi
tiny calculator
This program generates a function to calc the value of
polynomial given by user in run-time.
use boost::spirit::classic
see calc2.cpp for new version of boost::spirit
*/
#include <stdio.h>
#include <sstream>
#include <map>
#define XBYAK_NO_OP_NAMES
#include "xbyak/xbyak.h"
#ifde... | TOOL | 0.992945 | 5.781719 |
45a1cef4-8b75-4256-8a9d-d01263404d2f | ganghe74/algo | algospot/07_FANMEETING.cpp | // 시간초과..
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
void normalize(vector<int>& num) {
num.push_back(0);
for (int i=0;i<num.size()-1;++i) {
if (num[i] < 0) {
int borrow = (abs(num[i]) + 9) / 10;
num[i+1] -= borrow;
num[i] += borrow * ... | ALGO | 0.999698 | 4.224566 |
d7b95bf4-972a-4965-938a-97dafbba8082 | Nirmalkumar-A/Spiderman | 2.mono alphabetic.cpp | #include <stdio.h>
void encrypt(char *plaintext, char *key, char *ciphertext) {
int i;
for (i = 0; plaintext[i] != '\0'; i++) {
char ch = plaintext[i];
if (ch >= 'A' && ch <= 'Z') {
ciphertext[i] = key[ch - 'A'];
}
else if (ch >= 'a' && ch <= 'z') {
ciphe... | ALGO | 0.999112 | 4.052366 |
5d309fb7-6e68-44be-8d4d-3701e0282609 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/WatchingCpl_20210103151505.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999998 | 4.270729 |
f74fc13d-3e1d-4902-9fb8-bf02e986c9f3 | ishandutta2007/codeforces | liti/normal/73/D.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
const int maxN = 1000*1000 + 10;
vector<int> c[maxN], comp;
bool check[maxN];
int dfs( int node )
{
if( check[node] )
return 0;
int val = 1;
check[node] = 1;
for(int i =0; i< c[node].size() ; i++... | ALGO | 0.999991 | 4.104672 |
b270d6f8-b2ea-46dd-bfbb-84edd8542e5a | 09charu/toppr | 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 |
4b5a85b3-9482-4b56-958f-7e02e4f05ceb | gssdromen/leetcode | Unique Paths/main.cpp | #include<iostream>
#include<vector>
#include<string>
using namespace std;
template <typename T> ostream& operator <<(ostream& cout,vector<T>& v){
typename vector<T>::iterator it;
cout<<"[";
for (it=v.begin(); it!=v.end(); it++){
if (it == v.end()-1){
cout<<*it;
}else{
... | ALGO | 0.999128 | 5.740916 |
71327f93-a116-44ac-a9dc-f6c3f4649cb4 | MMMustafakamran/Parallization_IST_BubbleSortNetwork | dev2/tau_install/tau-2.34/examples/mpishlib/ring.cpp | #include <Profile/Profiler.h>
#ifndef TAU_GROUP_RING
#define TAU_GROUP_RING TAU_GET_PROFILE_GROUP("RING")
#endif /* TAU_GROUP_RING */
#include <stdio.h>
#include <mpi.h>
#include "ring.h"
double A[1024][1024], B[1024][1024], Cary[1024][1024];
static const int anz = 512;
void C::method() {
TAU_PROFILE("void C::metho... | ALGO | 0.998552 | 3.587367 |
03f20213-ae1c-44cb-902b-277bf7011001 | bluefcat/word-quiz | generator.cpp | #pragma once
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <regex>
#include "util.cpp"
using std::string;
using std::vector;
using std::map;
//regex
using std::regex;
using std::smatch;
class Generator{
public:
Generator(){};
~Generator(){};
void insert_data(string data){
... | TOOL | 0.875069 | 4.450375 |
28b6b218-b196-4e6f-9d9f-5edf2f01fca0 | Icay12/LeetCode | Cpp/83_RemoveDuplicatesfromSortedList.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* deleteDuplicates(ListNode* head) {
ListNode* prev = head, *cur = head;
while(cur != NULL) {
i... | ALGO | 0.999947 | 5.792397 |
99b2c22b-ac00-4c15-a4de-d60c4efa74ab | tomicmilos57/Binary_Search_Tree-BST- | bintree.cpp | #include "bintree.hpp"
#include "stack.hpp"
#include <iostream>
using namespace std;
//Constructor
template <typename info>
Node<info>::Node(info var, Node *father, Node *left, Node *right, int height)
{
this->father = father;
this->left_son = left;
this->right_son = right;
this->var = var;
this->height =... | ALGO | 0.999814 | 4.257529 |
24ddccc5-6c57-454c-b676-34c7f94d65ef | momentum-mod/game | mp/src/cryptopp/md2.cpp | // md2.cpp - modified by Wei Dai from Andrew M. Kuchling's md2.c
// The original code and all modifications are in the public domain.
// This is the original introductory comment:
/*
* md2.c : MD2 hash algorithm.
*
* Part of the Python Cryptography Toolkit, version 1.1
*
* Distribute and use freely; there are n... | ALGO | 0.997788 | 6.842621 |
144b716b-e339-49e7-8e92-6e93cb39652d | MaxBubblegum47/LLVM_13_MBLAZE | clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp | #include "handle_llvm.h"
#include "input_arrays.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/CommandFlags.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/Execut... | TOOL | 0.925479 | 7.874723 |
d605b2b5-12a1-460a-b397-efe735a07a97 | 7azoma/Senior-Training-2021 | Problem Solutions/Advanced Data Structures/UVA Potentiometers - BIT.cpp | // https://vjudge.net/problem/UVA-12086
#include <bits/stdc++.h>
#define S second
#define F first
using namespace std;
typedef long long ll;
const int N = 2e5 + 5;
struct BIT
{
int tree[N];
void init()
{
memset(tree, 0, sizeof tree);
}
void add(int pos, int val)
{
for(++pos ;... | ALGO | 0.999799 | 3.558631 |
9aa0fabc-c336-4fd3-a491-33feda3818b0 | prakhar9125pandey/C-Programs | C_Programs/LINEAR SEARCH 1.cpp | #include <stdio.h>
int main()
{
int ar[10]={29,10,14,37,14,12,23,65,12,2};
int val;
printf("Enter the element you want to search: ");
scanf("%d", &val);
for(int i=0; i<9; i++) // linear search
{
if(val==ar[i])
{
printf("\n Element found at location %d", i);
... | ALGO | 0.99883 | 3.342629 |
7ecdb2c1-eff7-4b65-847e-40b57619cda4 | traviszeng/AlgorithmDatastructureByCPLUSPLUS | Interview Code/HUYA/huya2.cpp | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include<algorithm>
struct ServerSelector
{
// η(0)
typedef int server_index_t;
// Ȩ
typedef size_t weight_t;
std::vector<weight_t> myWeight;
std::vector<weight_t> myWeightTemp;
size_t weightSum=0;
size_t weightSumTemp = 0;
// ηбȨرʼʱ... | ALGO | 0.999685 | 4.249691 |
1ed2809e-2980-4cd7-84b8-886725147111 | marslin0724/PinAstar | PinAstar/ABP_AStarDecode.cpp | #include "AStarDecode.h"
// use Best Graph Algorithm (BGA)
void ABP(MATRIX<__int8>& G, DECODING_INFO& decoding_info) {
vector<size_t> permutation_seq(G.Col_number);
//initial permutation_seq
for (size_t i(0); i < permutation_seq.size(); ++i)
permutation_seq.at(i) = i;
MATRIX<__int8> H,sorted_H,tmp_H;
tmp_H.Bui... | ALGO | 0.999993 | 3.801208 |
d49a00d8-5778-4969-879e-4629e7d03ee0 | AntoniosLagios/Data-structures | Stacks.cpp | //Using std::stack from the STL
#include <iostream>
#include <stack>
int main() {
std::stack<int> s;
// Push elements
s.push(10);
s.push(20);
s.push(30);
// Access the top element
std::cout << "Top element: " << s.top() << std::endl;
// Pop elements
s.pop();
std::cout << "Top ... | ALGO | 0.998841 | 6.302971 |
1d87e913-3b57-40af-827d-ac762a8d5c01 | cerebropine/DSA | searching/first_1_array.cpp |
/*
Given a sorted array consisting of
0
′
s
and
1
′
s
. The task is to print the index of first
1
in the given array. You must write an algorithm with
O
(
l
o
g
(
n
)
)
runtime complexity.
Input Format
The first line of input contains
N
, size of the array
The second line of input contains
N
space-separate... | ALGO | 0.999979 | 5.176662 |
b78f6fd8-38af-4e32-92d3-9b2e51d5b9d0 | sizhewan/Algorithm-Course | 半数集问题.cpp | #include<iostream>
#include<fstream>
using namespace std;
int half(int n);
int sigma(int buttom, int top);
int half(int n)
{
if (n == 1)
return 1;
else if (n == 2)
return 2;
else if (n == 3)
return 2;
else
return 1 + sigma(1, n / 2);
}
int sigma(int buttom, int top)
{
int sum = 0;
for (int i = buttom; ... | ALGO | 0.999913 | 4.616719 |
ae45c94d-699c-469d-a30c-e7108164af65 | sinian666/codes_102_4 | cpp_副本43/chapter_backtracking/permutations_i.cpp | /**
* File: permutations_i.cpp
* Created Time: 2023-04-24
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 回溯算法:全排列 I */
void backtrack(vector<int> &state, const vector<int> &choices, vector<bool> &selected, vector<vector<int>> &res) {
// 当状态长度等于元素数量时,记录解
if (state.size() == choices.size()... | ALGO | 0.999972 | 5.578971 |
2cb4f41c-5093-41da-a46f-2a351a342f58 | Avinash192211117/avinash | blabla.cpp | #include <stdio.h>
int main()
{
int num;
scanf("%i", &num);
if (num>0)
printf("positive");
if (num==0)
printf("has no value");
else
{
printf("negative");
}
return 0;
}
| ALGO | 0.998643 | 3.385932 |
8424c373-fb89-4f7e-8c5c-7c9694f6d49e | wer277/AlgorytmyiZlozonosc | KodDoEgzaminu/sortowania.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct Dane{
int nr_leg;
int liczba_punktow;
bool operator > (const Dane &other) const{
return liczba_punktow > other.liczba_punktow;
}
bool operator < (const Dane &other) const{
return liczba_punktow < o... | ALGO | 0.999747 | 4.463679 |
71373242-6bc9-41f9-84fa-61891ac2bb82 | KayvanMazaheri/acm | sgu/154.factorial/154.cpp | #include <iostream>
#include <ctime>
using namespace std;
int main()
{
int q;
cin >> q;
double time = 0;
//for (q=0; q<2e2 + 4; q++)
{
int n=0;
int i= 0;
int l = 0;
if (q >= 9e7)
{
i = 360000015 / 5 ;
n = 9e7 ;
}
else if (q >= 8e7)
{
i = 320000015 / 5 ;
n = 8e7 ;
}
else if (q >= 7e7)
{
i = ... | ALGO | 0.999967 | 3.635715 |
2fbce639-aaa2-4bd9-88f6-1b41e0e6c566 | craniumrat/AoC2021 | CPP/Day1/Day1.cpp | #include <filesystem>
#include <vector>
#include <map>
#include <string>
#include <fstream>
#include <iostream>
#include <boost/spirit/home/x3.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
using namespace std::filesystem;
namespace day1
{
namespace ast
{
typedef std::map<std::string, int> bag_map;
typed... | ALGO | 0.897183 | 5.034099 |
60b6538c-453d-40cb-8136-1126ec80293f | codetatvaacademy/GU-Technical-Training-2026 | DheerajKumar/problem31.cpp | //31. WAP to check whether a number is perfect or not.
#include<iostream>
using namespace std;
bool sumDivisor(int number){
if(number <= 0){
return 0;
}
int sum = 0;
for(int i = 1; i <= number/2; i++){
if(number % i == 0){
sum += i;
}
}
if(sum == numbe... | ALGO | 0.996604 | 3.703965 |
ce1eaacf-b7bc-4df6-96fd-d895e6a31e0f | chinmayajha/Code | Codebreaker_evacuation.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
int n, m; cin >> n >> m;
vector<vector<int>> a(n + 1);
vector<int> incoming(n + 1, 0), ans(n + 1);
for(int i = 0; i < m; ++i) {
int x, y; cin... | ALGO | 0.999968 | 4.405906 |
fea59c38-049a-4ca8-8574-237cc50bdf28 | trinhgiahuy/Programming2_Spring_2021 | student/10/calculator/calculations.cpp | // Note that there is no need for "using namespace std",
// since no C++ standard libraries are used.
double addition(double left, double right) {
return left + right;
}
double subtraction(double left, double right) {
return left - right;
}
double multiplication(double left, double right) {
return left *... | TOOL | 0.930908 | 4.498352 |
532a6281-d3bd-4a6b-9418-1a24818a7370 | javaliu2/candcpp | algorithm/leetcode/simulation/1812.cpp | #include <string>
using namespace std;
class Solution {
public:
bool squareIsWhite(string s) {
int h = s[0] - 'a', v = s[1] - '1';
if ((h ^ v) & 1) {
return true;
}
return false;
}
}; | ALGO | 0.999474 | 5.348559 |
a59c9e7f-315e-46ec-a5c6-65281b4bafd8 | Tatotavella/Workshop-3_PBATEOTW_Chile | lammps-awsem/src/lammps-9Oct12/src/KSPACE/pair_lj_cut_coul_msm.cpp | /* ----------------------------------------------------------------------
Contributing authors: Stan Moore (SNL), Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_lj_cut_coul_ms... | ALGO | 0.999689 | 6.302255 |
cbb937b8-8388-47f3-9387-7d5d921fbcab | Priyankar96/face_recognize | opencv-master/opencv-master/modules/imgproc/src/resize.cpp | /* ////////////////////////////////////////////////////////////////////
//
// Geometrical transforms on images and matrices: rotation, zoom etc.
//
// */
#include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "hal_replacement.hpp"
#include "opencv2/core/hal/intrin.hpp"
#include "opencv2/core/utils/buff... | ALGO | 0.976364 | 3.011279 |
bbeed5ad-a6ba-49e0-9b50-dac3fab7c7f3 | charliesbot/leetcode | cpp/problem_0200/number_of_islands.test.cpp | #define CATCH_CONFIG_MAIN
#include "../catch_amalgamated.hpp"
#include "number_of_islands.cpp"
TEST_CASE("Number of Islands", "[number_of_islands]") {
Solution solution;
SECTION("Basic examples from problem statement") {
// Example 1: One large island
vector<vector<char>> grid1 = {
... | TEST | 0.983215 | 7.380165 |
2dbcf3ff-27f4-4596-89f9-a7ace6b987f7 | EgorMaksM/MyLibraryManager | book.cpp | #include "book.h"
bool operator==(const Book& book, const Book& other) {
return book.id == other.id &&
book.title == other.title &&
book.year == other.year;
}
int addBook(sqlite3*& DB, QString title, unsigned short int year) {
sqlite3_stmt* stmt;
const char* sql = "INSERT INTO BOOKS ... | TOOL | 0.870794 | 5.303357 |
0d8969b6-38fc-4eb2-a1d6-494077ff6f1f | TuZZiX/ROS_IDE_inc | boost_1_59_0/libs/graph/example/canonical_ordering.cpp | #include <boost/graph/planar_canonical_ordering.hpp>
#include <boost/graph/boyer_myrvold_planar_test.hpp>
using namespace boost;
int main(int argc, char** argv)
{
typedef adjacency_list
< vecS,
vecS,
undirectedS,
property<vertex_index_t, int>,
property<edge_index_t, int>
>
grap... | ALGO | 0.996269 | 7.278062 |
d9202771-ae2d-4671-9b1d-d16d4a670538 | dmitriy79/Freecash | src/arith_uint256.cpp | #include <arith_uint256.h>
#include <crypto/common.h>
#include <uint256.h>
#include <utilstrencodings.h>
#include <cstdio>
#include <cstring>
template <unsigned int BITS>
base_uint<BITS>::base_uint(const std::string &str) {
SetHex(str);
}
template <unsigned int BITS>
base_uint<BITS> &base_uint<BITS>::operator<<... | ALGO | 0.960104 | 6.712271 |
8f69ccaa-e74f-4ee5-bfac-8458d11d7934 | dharmu689/100-Days-Coding-Challenge | Day 17/Factorial of a Number.cpp | // Question - https://www.hackerrank.com/contests/day-17-recursion/challenges/factorial-of-a-number-64/problem
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
... | ALGO | 0.999994 | 5.850735 |
8fe753c5-010c-4ffc-8695-0dd3279f7633 | ishandutta2007/codeforces | autumnkite/normal/1477/C.cpp | #include <bits/stdc++.h>
const int N = 5005;
int n;
struct Point {
int x, y;
Point() : x(0), y(0) {}
Point(int _x, int _y) : x(_x), y(_y) {}
} a[N];
std::istream &operator>>(std::istream &in, Point &A) {
in >> A.x >> A.y;
return in;
}
Point operator-(const Point &A, const Point &B) {
return Point(A.x - B.x,... | ALGO | 0.999997 | 3.884192 |
2f4002f6-eceb-4b6d-b18c-cf233085df0a | atharva1554/Leetcode-question-solution- | Difficulty: Medium/Unique Paths in a Grid/unique-paths-in-a-grid.cpp | class Solution {
public:
int n, m;
int solve(int i, int j, vector <vector <int>>& grid, vector <vector <int>>& dp){
if(i >= n || j >= m || grid[i][j] == 1) return 0;
if(i == n-1 && j == m-1) return 1;
if(dp[i][j] != -1) return dp[i][j];
int total = solve(i+1, j,... | ALGO | 0.9999 | 6.219691 |
ed9cf7fb-b371-4519-b8a7-616bcc015cc7 | zulman/algo | primsheap/cpp/primsheap.cpp | /*
* File: main.cpp
* Author: oleg.chumakov
*
* Created on January 24, 2013, 10:11 AM
*/
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <sstream>
#include <cstddef>
#include... | ALGO | 0.999948 | 4.431803 |
0a292eb8-2ab6-49af-b063-461a024681d9 | amzeratul/halley | src/tools/tools/src/msdfgen/core/msdfgen.cpp |
#include "../msdfgen.h"
#include <vector>
#include "edge-selectors.h"
#include "contour-combiners.h"
#include "ShapeDistanceFinder.h"
namespace msdfgen {
template <typename DistanceType>
class DistancePixelConversion;
template <>
class DistancePixelConversion<double> {
DistanceMapping mapping;
public:
type... | ALGO | 0.98556 | 7.447403 |
19700dd9-61b2-4ed9-b118-bd86dfa38206 | Harsh-1-0/Advert_Of_Code | q8.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <set>
#include <fstream>
using namespace std;
void printArr(vector<string> arr)
{
for (int i = 0; i < arr.size(); i++)
{
cout << arr[i] << endl;
}
}
void printArr(vector<vector<int>> arr)
{
for (int i = 0; i < arr.size(); i+... | ALGO | 0.999273 | 4.370113 |
66069640-59b2-4521-81d6-0079710a1cff | mechiragjain/Algorithm-Toolbox-Coursera | Week 4/2_majority_element.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
int get_majority_element(vector<int> &a, int left, int right) {
//if (left == right) return -1;
//if (left + 1 == right) return a[left];
//write your code here
int n=a.size();
map<int, int> frequencyOfElements;
... | ALGO | 0.999914 | 4.494792 |
1ca47d50-2d31-47c6-a59d-6709d0b6c26b | WacArteec/MyCompiler | src/stack_for_comp.cpp | #include "stack_for_comp.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include <stack_for_comp.h>
#define stk_default_value 0
enum SizeChanger
{
MORE_SIZE,
LESS_SIZE
};
struct Stack_Struct
{
int* record = NULL;
size_t point = stk_default_value... | ALGO | 0.997211 | 3.967116 |
242d4162-bd26-4cf7-b862-39d2c6603b24 | EshaalB/Data-Structures | Queues/queues(2).cpp | //#include <iostream>
//#include <string>
//using namespace std;
//
//template <typename T>
//class Stack {
// T* arr;
// int currSize;
// int maxSize;
// int top;
//
//public:
// Stack() : currSize(0), maxSize(10), top(0) {
// arr = new T[maxSize];
// }
// ~Stack() { delete[] arr; }
//
// ... | ALGO | 0.965888 | 5.080242 |
f7600075-1e32-49c1-8c35-5e6606109c0f | ishandutta2007/codeforces | mahdi_jfri/normal/958/C1.cpp | #include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#incl... | ALGO | 0.999989 | 3.88695 |
88c37713-cacf-47fb-ae95-8ce4a7006347 | ELS2565/codetree-TILs | 240717/데이터 교환/exchange-data.cpp | #include <iostream>
using namespace std;
int main() {
int a = 5;
int b = 6;
int c = 7;
int tmp = b;
b = a;
a = c;
c = tmp;
cout << a << '\n' << b << '\n' << c;
return 0;
} | ALGO | 0.999412 | 3.261963 |
f7b653fe-b307-4e3d-b55f-261562d522a2 | iains/llvm-project-old | libcxx/test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp | // <algorithm>
// template <class InputIterator, class Predicate>
// bool
// any_of(InputIterator first, InputIterator last, Predicate pred);
#include <algorithm>
#include <cassert>
#include "test_iterators.h"
struct test1
{
bool operator()(const int& i) const
{
return i % 2 == 0;
}
};
int ... | TEST | 0.960048 | 6.69748 |
3d05d1f1-2fdb-4145-be3b-731ea042e019 | sarjakshah/opencv_sarjak | opencv/3rdparty/openexr/Imath/ImathVec.cpp | //----------------------------------------------------------------------------
//
// Specializations of the Vec2<T> and Vec3<T> templates.
//
//----------------------------------------------------------------------------
#include "ImathVec.h"
#if (defined _WIN32 || defined _WIN64) && defined _MSC_VER
// suppress... | TOOL | 0.86804 | 7.470541 |
fa147388-52ff-4133-9219-8aa0a9e2df5d | ishandutta2007/codeforces | 666sb666/normal/235/A.cpp | #include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
using namespace std;
#define GC getchar()
#define PC putchar
inline void read(int&n)
{int x=0,f=1;char ch=GC;while(ch<'0'||ch>'9'){if(... | ALGO | 0.999971 | 3.495854 |
998d57f6-af29-45bc-8b7f-17341730e6ab | Seb-Ltz/SnakeAI | source/NeuralNetwork.cpp | #include <iostream>
#include "NeuralNetwork.h"
NeuralNetwork::NeuralNetwork(unsigned int inputSize, unsigned int outputSize, unsigned int hiddenLayers,
unsigned int hiddenLayersSize) : inputSize(inputSize), outputSize(outputSize),
... | ALGO | 0.998641 | 4.094072 |
d3c9c804-ae32-4625-b39c-24b48f80f3f6 | zhaoyizheng0930/UnrealEngine | Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV32Build.cpp | #include "foundation/PxVec4.h"
#include "GuBV32Build.h"
#include "GuBV32.h"
#include "PxTriangle.h"
#include "CmPhysXCommon.h"
#include "PsBasicTemplates.h"
#include "GuCenterExtents.h"
#include "GuBV4Build.h"
#include "PsAllocator.h"
using namespace physx;
using namespace Gu;
#include "PsVecMath.h"
using namespace p... | ALGO | 0.996765 | 7.774337 |
ed73f357-3bc3-43d6-874b-bab942386189 | Gopalprajaapati/DSA | Day_21_array/roteta.cpp | #include <iostream>
using namespace std;
void rotate(int arr[], int size, int k)
{
int temp[size];
for (int i = 0; i < size; i++)
{
temp[(i+k) % size] = arr[i];
}
for (int i = 0; i < size; ++i)
{
arr[i] = temp[i];
}
}
int main ()
{
int arr[] = {1,2,3,4,5,6};
... | ALGO | 0.99983 | 4.71181 |
52e30b13-2be0-4b11-9065-e923b9f0ca44 | CodeCraftAdi/My-Journey | Codehelp - DSA/Lec 20-21 (array)/merging_sorted_Array.cpp | /*
int arr1[]={1,3,5,7,9};
int arr2[]={2,4,6};
1 2 3 4 5 6 7 9
*/
#include<iostream>
using namespace std;
void printArray(int ans[],int n)
{
for(int i=0;i<8;i++)
{
cout<<ans[i]<<" ";
}
}
void merge(int a1[],int n,int a2[],int m,int ans[])
{
int i=0,j=0,k=0;
/... | ALGO | 0.999814 | 3.664006 |
4e9cde3c-59ac-4a9b-bbf4-db11c5d9c4e0 | ishandutta2007/codeforces | lmoliver/normal/1183/H.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=111;
char s[N];
LL cnt[N][N]={0};
int main(){
LL n,k;
cin>>n>>k;
LL _k=k;
cin>>(s+1);
for(int i=n;i>=0;i--){
cnt[i][0]=1;
for(int c='a';c<='z';c++){
for(int j=i+1;j<=n;j++){
if(s[j]==c){
for(int k=0;k<n;k++){
LL &... | ALGO | 0.999995 | 3.671878 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.