uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6b945129-0899-47b1-a070-48757ff66be9 | svaze30/CompetitiveProgramming | 1916/x.cpp | #include <bits/stdc++.h>
#define endl "\n"
typedef long long ll;
#define loop0(i, n) for (ll i = 0; i < n; i++)
#define loop1(i, n) for (ll i = 1; i <= n; i++)
#define mp make_pair;
#define F first;
#define S second;
#define pb push_back;
void solve();
using namespace std;
int main() {
ios_base::sync_with_stdio(f... | ALGO | 0.999131 | 4.75316 |
4e255ca2-74c3-4f0f-ab28-a5763dfcf1e7 | codingNoob12/algorithm-study | cpp/바킹독_알고리즘/해시/20166.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
string grid[1000];
unordered_map<string, int> um;
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
void bfs(int i, int j) {
queue<tuple<int, int, string>> q;
string init;
init += grid[i][j];
um[init]++;
q.push({i, j, init})... | ALGO | 0.999811 | 5.383093 |
3ff900bd-4602-4964-a0fe-93a9c938e388 | M-Ayushi/competitive-programming | codeforces/1851/C.cpp | #include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x.size())
using namespace std;
void solve() {
int n, k, cnt = 0, lt = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; ++i) {
cin >> a[i];
if (a[i] == a[0] && cnt < k) {
++cnt;
lt = i;
}
}
if (cnt < k) {
cout << "NO\n";
return;
... | ALGO | 0.999969 | 4.062018 |
57e4e99f-9a1a-4b2e-8c5d-be64e1843611 | Iswar-Ch-Rana/Coding_DSA | tut54stack_implemention.cpp | /*
stack<int> st ;
st.push(2) ;
st.push(4) ;
st.pop() ;
cout<< "Printing the pop element "<< st.top() << endl ;
if (st.empty()) {
cout << "Stack is empty" << endl ;
}
else {
cout << "Stack is not empty" << endl ;
}
cout << "Size of stack = "<< st.size() << endl ;
... | ALGO | 0.996593 | 4.780824 |
061c50b3-6da8-4414-bf8b-454a86c74a72 | Mayankdev0923/CPP- | SORTING/countingsort.cpp | #include<iostream>
using namespace std;
void countingsort(int* arr, int n){
//finding freq array size
int maxval = INT32_MIN;
for(int i=0; i<n; i++){
maxval = max(maxval,arr[i]);
}
//creating freq arrray
int freq[maxval+1] = {0};
int index=0;
//upadteing freq arr.
for... | ALGO | 0.999985 | 5.246513 |
af7b5d73-5dbe-41f1-9c99-e1d184844772 | 256shadesofgrey/scipoptsuite | papilo/test/papilo/presolve/SparsifyTest.cpp | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* PaPILO --- Parallel Presolve for Integer and Linear Optimization */
... | TEST | 0.859555 | 7.379521 |
6a8666d7-6e2f-4081-a405-96fae173222c | iamkuntal2002/most_liked_questions | dfs/rightSideView.cpp | #include<bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/binary-tree-right-side-view/ | ALGO | 0.999479 | 5.356947 |
4f15c2fe-a92d-47b1-a8cf-70e4f25b8b72 | Sethawoot/camera-main-643450333-5 | 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.998756 | 6.772262 |
ac67bffa-121e-4b6e-a228-abe55c3c2706 | didrozdova/tasks_cpp | Samostoyatelnaya_rabota_2/If21/ConsoleApplication1/ConsoleApplication1.cpp | #include <iostream>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
if (x == 0 && y == 0) {
cout << 0 << endl;
}
else if (x == 0) {
cout << 1 << endl;
}
else if (y == 0) {
cout << 2 << endl;
}
else {
cout << 3 << endl;
}
return ... | ALGO | 0.999951 | 4.01541 |
44ac888c-3bdd-4d16-bb70-2a704c8b262b | WangShiSuiFeng24/helloworld | chapter_7/strgfun.cpp | // strgfun.cpp -- functions with a string argument
#include <iostream>
unsigned int c_in_str(const char *str, char ch);
int main()
{
using namespace std;
char mmm[15] = "minimum"; // string in an array
const char *wail = "ululate"; // wail points to string;
unsigned int ms = c_in_str(mmm, 'm');
... | TOOL | 0.969044 | 5.819243 |
d5b238cf-a241-4463-8c7c-13e7d4778325 | edelaguila/prograuno2k25 | 5. arreglos/Matrices/BasicoMatricesUniversidad.cpp | // Ejemplo de utilizacin de matrices codigo heredado de C
//Declaracin de Bibliotecas y librerias estandar de C++
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include <iomanip>
using namespace std;
//Declaracin de Constantes
#define NUMERO_ALUMNOS 5
#define NUMERO... | ALGO | 0.979559 | 4.109445 |
802c7dd4-1b3c-40a5-a537-1ed8316e66ac | XiaoXiaoLui/CodeForces | Round355/C.cpp | #include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
const int M = 1e9 + 7;
char s[100005];
int main()
{
ll ans = 1;
scanf("%s", s);
int i = 0, j;
ll cur;
for (i = 0; s[i]; i++)
{
if (s[i] >= '0' && s[i] <= '9')
{
cur = s[i] - '0';
}
else if (s[i] >= 'a' && s[i] <= ... | ALGO | 0.999657 | 3.918663 |
8cd85767-cf08-4717-b3cf-dde076fceb90 | tsega7659/2024-project-phase-mobile-tasks_gdg_flutter_group_5 | Dart_Tasks/task_9/api_in_flutter/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.997724 | 6.771107 |
59cc9dc1-c7d4-40c4-8d4e-aa9f16b25cf1 | GhassenNajaa/CodewarsChallenges | 7kyu/ShortestWord.cpp | /* Simple, given a string of words, return the length of the shortest word(s).
String will never be empty and you do not need to account for different data types.*/
#include <string>
int find_short(std::string str){
int count=0,i=0;
for(int i=0;i<str.length();i++){
if(str[i]==' ') count++;
}
std::string a... | ALGO | 0.995222 | 5.021849 |
c2784d5c-04e9-4247-9aeb-7502669276b5 | Cabbage-Cat/Algorithm-competition | SCU/wk6/H.cpp | #include <bits/stdc++.h>
using namespace std;
int n,r;
char base[17] = "0123456789ABCDEF";
char s[100000 + 10];
int main(){
while (scanf("%d%d",&n,&r)==2){
int flag = 0;
if (n<0) { flag = 1; n=-n;}
int i=-1,k;
while (n){
k = n%r;
s[++i] = base[k];
n/=r;
}
if (flag) putchar('-... | ALGO | 0.999796 | 3.593657 |
210c5c5c-a557-4ed8-b9f1-4ae537de1860 | jianlany/semicrystalline_publication_repo | src/main.cpp | #include <iostream>
#include "input_file.h"
#include "md_system.h"
#include "builder.h"
#include "end_bridge.h"
#include "lammps_writer.h"
#include "geometry.h"
#include "compute.h"
#include "slip.h"
#include "timer.h"
//! Performs a single MC step to build the system.
void build_system(const InputFile &opt);
//! Perf... | TOOL | 0.919249 | 4.479445 |
e8f9cca6-e8a8-4161-9fea-77d5927da7b2 | PCSlabhung/Spmm_kernel | HLS_code/Spmm_tb.cpp | #include "define.h"
#include "/home/hung52852/SPMM_kernel/scheduled_weight_par_8_block/schedule_weight0.h"
#include "/home/hung52852/SPMM_kernel/scheduled_weight_par_8_block/schedule_weight1.h"
#include "/home/hung52852/SPMM_kernel/scheduled_weight_par_8_block/schedule_weight2.h"
#include "/home/hung52852/SPMM_kernel/s... | ALGO | 0.999763 | 3.092712 |
4f1e9cfd-0f1d-42d5-9dd1-1fda0db87df7 | BU-DEPEND-Lab/Racecar | Related_Projects/sensor_perception/camera/stopsign_detection/src/stopSignDetection.cpp | // cpp includes
#include <iostream>
#include <vector>
#include <deque>
// opencv includes
#include <opencv2/core/core.hpp>
#include <opencv2/contrib/contrib.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/gpu/gpu.hpp>
// R... | ALGO | 0.924831 | 4.05695 |
5a087562-986d-4cb1-820d-6067d420dda0 | ishandutta2007/codeforces | ljc1301/normal/1326/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int T,n;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
if(n==1) printf("-1\n");
else
{
printf("2");
while(--n) printf("9");
printf("\n");
}
}
return 0;
} | ALGO | 0.999716 | 3.877168 |
112de2d3-7977-4b35-bec3-0e0abe5e432b | DeimosMH/DCH_CppPrimerPlus | programs/arfupt.cpp | #include <iostream>
// various notations, same signatures
const double *f1(const double ar[], int n);
const double *f2(const double[], int);
const double *f3(const double *, int);
int main()
{
using namespace std;
double av[3] = {1112.3, 1542.6, 2227.9};
// pointer to a function
const double *(*p1)(c... | TOOL | 0.902795 | 5.96881 |
cb78eadd-ca00-449e-b969-c2e15ef187ae | kylevedder/ServiceRobotControlStack | catkin_ws/src/control_stack/src/motion_planning/pid.cpp | #include <algorithm>
#include <limits>
#include <utility>
#include "cs/motion_planning/pid.h"
#include "cs/util/physics.h"
#include "shared/util/array_util.h"
#include "config_reader/macros.h"
namespace cs {
namespace motion_planning {
namespace params {
CONFIG_FLOAT(rotation_drive_threshold, "control.rotation_driv... | ALGO | 0.997469 | 6.643116 |
b1d988cf-edda-4ba7-80d2-5c51bd07771f | scen/ionlib | src/sdk/hl2_ob/utils/vbsp/prtfile.cpp | #include "vbsp.h"
#include "collisionutils.h"
/*
==============================================================================
PORTAL FILE GENERATION
Save out name.prt for qvis to read
==============================================================================
*/
#define PORTALFILE "PRT1"
struct cluster_portals... | ALGO | 0.954212 | 4.467473 |
5ce661a6-f660-4e6a-9a05-f81151e22b17 | rdstihz/Learning-and-Coding | src/contest/联想杯20210613/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL P = 1e9 + 7;
const int maxn = 2010;
LL f[maxn][maxn];
int main() {
int n, m;
scanf("%d%d", &n, &m);
f[0][0] = 1;
for (int i = 1; i <= n; i++) {
LL s = 0;
for (int j = 0; j <= m; j++) {
s = (s ... | ALGO | 0.999968 | 4.161021 |
abf41dfa-773c-47a1-b5ac-9c7ebd9a1c27 | sinian666/codes_102_2 | 1cpp_副本6/chapter_graph/graph_adjacency_matrix.cpp | /**
* File: graph_adjacency_matrix.cpp
* Created Time: 2023-02-09
* Author: what-is-me (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 基于邻接矩阵实现的无向图类 */
class GraphAdjMat {
vector<int> vertices; // 顶点列表,元素代表“顶点值”,索引代表“顶点索引”
vector<vector<int>> adjMat; // 邻接矩阵,行列索引对应“顶点索引”
public:
/* 构造方法 */
... | ALGO | 0.999537 | 6.276136 |
689e5026-d0ca-4c90-9d8f-90563439815e | sfindeisen/prgctst | potyczki-algorytmiczne/2014/B-1-lustra/lustra.cpp | #include <iostream>
#include <algorithm>
#include <vector>
const long MaxN = 1000000000;
struct tmr {
long w1;
long w2;
long h1;
long h2;
};
using namespace std;
vector<tmr> v;
int main() {
ios_base::sync_with_stdio(0);
long t = 0;
long n, w1, w2, h1, h2, minW, maxW, minH, maxH;
... | ALGO | 0.999551 | 4.215098 |
23b8a726-0b10-471c-8297-75e9bc2fa4bf | hieuhoangatm/C-thap-thap | SuaDen.cpp | #include<bits/stdc++.h>
using namespace std;
main(){
int n, k, b;
cin >> n >> k >> b;
int a[n];
for(int i=1;i<=n;i++) a[i]=0;
while(b--){
int x; cin >> x;
a[x]=1;
}
// int d=0;
// for(int i=1;i<=n;i++){
// if(a[i]==0) d++;
// }
int cnt=0;
for(int i=1;i<=k;i++){
if(a[i]==1) cnt++;
}
int ans=cnt;
... | ALGO | 0.999742 | 3.302303 |
7505179f-53ca-4c44-b2f6-835904bc299f | lucdon/LCRIndexing | src/algorithms/diGraphToGraph.cpp | #include "graphs/Graph.hpp"
#include "graphs/DiGraph.hpp"
std::unique_ptr<Graph> diGraphToGraph(const DiGraph& diGraph) {
auto graphPtr = std::make_unique<Graph>();
auto& graph = *graphPtr;
graph.setVertices(graph.getVertexCount());
std::vector<Vertex> verticesToAdd;
boost::dynamic_bitset<> visit... | ALGO | 0.912526 | 7.513581 |
359ca408-695f-40ff-9a8a-0ceee28d9fb5 | aayush751/Leetcode | 1298-reverse-substrings-between-each-pair-of-parentheses/reverse-substrings-between-each-pair-of-parentheses.cpp | class Solution {
public:
string reverseParentheses(string s) {
// now using wormhole technique
int n = s.size();
vector<int> oppoIndex(n,-1);
stack<int> st;
for(int i = 0; i < n; i++ )
{
if( s[i] == '(' )
{
st.push( i );
... | ALGO | 0.99997 | 5.898888 |
93982d1c-7868-4a07-a974-7df0b54e260c | yongho9064/cpp | Chapter06 --분기 구문과 논리 연산자/문제/1-7.cpp | #include <iostream>
#include <cctype>
#include <string>
int main(){
using namespace std;
string str1;
int vowels = 0;
int consonants = 0;
int etc = 0;
int count = 0;
cout << "ܾ ԷϽÿ ( q):\n";
while(cin >> str1 && str1 != "q"){
if(isalpha(str1[0])){
switch(str1[0]){... | ALGO | 0.984624 | 3.450856 |
5f6f453c-d11b-4a4b-859e-e2c7117027b3 | abaytek/Competitive-Programming | 155-min-stack/155-min-stack.cpp | class MinStack {
public:
vector<int> vec;
int size = 0;
MinStack() {
}
void push(int val) {
size++;
vec.push_back(val);
}
void pop() {
vec.erase(vec.begin()+size-1);
vec.resize(size-1);
size--;
}
int top() {
retur... | ALGO | 0.999823 | 6.366999 |
cd00c852-2d85-4c88-9eb4-f656470391cb | euclidesfreire/GAs | populacao.cpp | #include "populacao.h"
using namespace std;
Populacao::Populacao(int tamPopulacao, int tamCromossomo)
{
ra.SetSeed(time(0));
this->tamPopulacao = tamPopulacao;
this->tamCromossomo = tamCromossomo;
inicializarPoupulacao();
}
void Populacao::setCromossomos(vector<Cromossomo*> c)
{
this->cromossomos... | ALGO | 0.996844 | 4.893249 |
48e2e815-15a6-4edf-ac65-b5c38549fc93 | pr-atha-m/Striver-s-SDE-sheet | Recursion/Subsets Sum.cpp | #include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
void recursive_sum(vector<int> & v ,int i , int N , vector<int> &arr , int sum){
if(i == N){
// when i == N we push back the sum to our vector.
v.push_back(sum);
return;
... | ALGO | 0.99989 | 6.624978 |
54d4b41a-1b83-4a8f-803e-c1a54fd07fa5 | blessingcharles/AbacusCTF | playground/encrypter.cpp | #include <iostream>
#include <cstdlib>
#include <cstring>
unsigned char reduce(unsigned char *data, size_t len)
{
unsigned char result = 0;
for (size_t i = 0; i < len; i++)
{
result ^= ((data[i] << (i % 4)) | (data[i] >> (8 - i % 4)));
result += data[i] ^ i;
}
return result;
}
voi... | ALGO | 0.999519 | 4.401302 |
f98129c3-0a9e-4d6f-99be-8a6c66e8b4aa | cscvlab/3D-Objects-Compression | submodules/libigl/include/igl/embree/ambient_occlusion.cpp | template <
typename DerivedP,
typename DerivedN,
typename DerivedS >
IGL_INLINE void igl::embree::ambient_occlusion(
const igl::embree::EmbreeIntersector & ei,
const Eigen::PlainObjectBase<DerivedP> & P,
const Eigen::PlainObjectBase<DerivedN> & N,
const int num_samples,
Eigen::PlainObjectBase<DerivedS> ... | ALGO | 0.988309 | 6.708069 |
122129a0-8c4e-4e2b-9b97-dca21f6775ff | Syed-Sabeer/Book-Store-Flutter-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.998756 | 6.772262 |
c080784d-08df-444b-a7ed-d71307e4bb94 | Dinngger/cpp_class | prime.cpp | #include<iostream>
#include<iomanip>
#define max 1000
using namespace std;
int main(){
bool num[max];
int print=0;
for(int i=0; i<max; i++)
num[i] = true;
for(int i=2; i<=max; i++){
if(num[i-1] == true){
for(int j=2; i*j<=max; j++)
num[i*j-1] = false;
... | ALGO | 0.998993 | 3.59627 |
ddab9a92-9263-49eb-87c6-febd0f4bba22 | willytaada/Praktikum-Searching | GD2_Willyta Asmara D A_D4 MI A _19051397017_searching.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
int pencarian (char st[], char m)
{
int i, posisi,panjang;
i=0;
posisi=-1;
panjang=strlen(st);
while ((i<panjang-1)&&posisi==-1)
{
if (st[i]==m)
posisi=i;
i++;
}
return posisi;
}
int main()
{
printf("\t... | ALGO | 0.99997 | 4.368735 |
e3666284-7660-483a-bb78-3bc80f4cea7a | VolkRiot/FirstProgrammingEver | Linked_ListBuild.cpp | #include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
void InputValues();
void SetAll(string, float, float);
void DisplayAll(int);
struct Node
{
Node *Next;
string emp_id;
float hours;
float pay;
Node *Previous;
};
Node *P;
Node *Last = NULL;
Node *First = NULL;
Node *Middle;
Node ... | TOOL | 0.947847 | 3.698944 |
d811210f-dbe3-43d9-8a89-b8d379e18df8 | Cyb3rGhoul/LeetCode | 125-valid-palindrome/valid-palindrome.cpp | class Solution {
public:
bool isPalindrome(string s) {
int i = 0, j = s.length() - 1;
while (i < j) {
// Skip non-alphanumeric characters
while (i < j && !isalnum(s[i])) i++;
while (i < j && !isalnum(s[j])) j--;
// Compare characters
if (tolower(s[i]) !=... | ALGO | 0.998377 | 6.676804 |
26cb7789-47b4-4ad3-bc0b-4975df026a84 | Puppet2714/cgal-5.6 | Convex_hull_2/test/Convex_hull_2/ch2_point_with_info.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/convex_hull_2.h>
#include <CGAL/convex_hull_traits_2.h>
#include <CGAL/boost/iterator/counting_iterator.hpp>
#include <iostream>
#include <iterator>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef... | ALGO | 0.999947 | 6.094484 |
1d35f8e9-a18e-4951-a28b-2204b70fd9a9 | samclayj/AlgorithmAnalysis | Exploration6/Implementations/Temp/Knapsack_MF.cpp | #include <iostream>
#include <vector>
#include <iomanip>
#include <fstream>
#include <sys/timeb.h>
#include <time.h>
#define START 0
#define END 1
using namespace std;
int **dynamicTable;
int capacity;
int items;
vector<int> weights;
vector<int> values;
void printTable();
int max(int num1, int num2);
int MFKnapsac... | ALGO | 0.998371 | 3.498229 |
952cfc64-4a63-4c14-9083-4957cf06fb5d | TsaiJin/leetcode | 88.merge-sorted-array.cpp | /*
* [88] Merge Sorted Array
*
* https://leetcode.com/problems/merge-sorted-array/description/
*
* algorithms
* Easy (33.21%)
* Total Accepted: 286.9K
* Total Submissions: 853.6K
* Testcase Example: '[1,2,3,0,0,0]\n3\n[2,5,6]\n3'
*
* Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1... | ALGO | 0.999977 | 6.305115 |
8d30bbb0-2f8a-442c-b21f-3a164d3cf58e | tahmidul-islam-star/Codeforces-Problem-Solutions | 980 div 2 A0.cpp | #include<iostream>
#include<cstring>
#include<algorithm>
#include<set>
using namespace std;
#define endl '\n'
#define improve ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define ll long long
// Alhamdulillah
void Solve()
{
int n;cin>>n;
int arra1[n],arra2[n];
int maxi1= 0,maxi2 =0;
... | ALGO | 0.999858 | 4.539273 |
e1cee913-0138-41b2-b93c-efac4804fec2 | Yagnik007/Cpp | 53_insertionsort.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n];
for(int i=0; i<n; i++){
cin>>arr[i];
}
for(int i=1; i<n; i++){
int current = arr[i];
int j = i-1;
while(arr[j]>current && j>=0){
arr[j+1] = arr[j];
j--;
... | ALGO | 0.999997 | 4.139494 |
53cfcf3c-09d1-4613-bad9-d95336fa9ec2 | jh11240/baekjoon_online_judge | BackTracking/백준14888(연산자끼워넣기).cpp | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
int MaxNum=-1'000'000'000, MinNum=1'000'000'000,operandsSize;
int operandVisited[4];
//bool numVisited[12];
vector<int> nums;
//+ - * / 순서
vector<int> operands;
void Backtracking(int curStep, bool isNumTurn, int prevResult, int prevOperand) {
... | ALGO | 0.999857 | 4.190239 |
af801d2d-416d-4a08-b539-7dab9df17422 | SETURAJ/LeetCode-Solutions | interleaving-string/Wrong Answer/7-7-2022, 7_51_13 AM/Solution.cpp | // https://leetcode.com/problems/interleaving-string
class Solution {
public:
bool isInterleave(string s1, string s2, string s3) {
unordered_map<char,int>umap;
for(int i=0;i<s3.length();i++)
umap[s3[i]]++;
for(int i=0;i<s1.length();i++)
umap[s1[i]]--;
for(int... | ALGO | 0.999912 | 6.26535 |
9f985a90-db6f-452f-9ace-1649fc16bfef | DarkJyn/SPOJ_PTIT | PTIT014A_2014 Bài A - Đoán số.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(nullptr) -> sync_with_stdio(false);
int t;cin >> t;
cin.ignore();
while (t--){
string n;
getline(cin,n);
if(n == "dung") cout << "2\n";
else if(n == "lon hon") cout << "1\n";
else cout << "3\n";
}
} | ALGO | 0.991896 | 3.405363 |
c7e26c3c-f74c-4d9f-ba12-5976fb18c5c7 | CGAL/cgal-dev | Bounding_volumes/test/Bounding_volumes/rectangular_p_center_2_random1_test.cpp | #include <CGAL/Cartesian.h>
#include <CGAL/point_generators_2.h>
#include <CGAL/rectangular_p_center_2.h>
#include <CGAL/Random.h>
#include <CGAL/Timer.h>
#include <CGAL/algorithm.h>
#ifdef CGAL_USE_LEDA
#include <CGAL/leda_real.h>
#endif // CGAL_USE_LEDA
#include <vector>
#include <functional>
#include <algorithm>
#in... | ALGO | 0.998792 | 6.934205 |
de3652a4-914b-4772-82a3-9c25d5bf4966 | makio93/competitive-atcoder | typical90/typical90_by/main.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(... | ALGO | 0.99999 | 4.659671 |
6393bea2-3b4f-4e20-9bda-23a67db8aab6 | ixray-team/xray-vss-archive | net.ssa/xrLC/xrLight_Implicit.cpp | #include "stdafx.h"
#include "build.h"
#include "tga.h"
#include "xrThread.h"
#include "hash2D.h"
class ImplicitDeflector
{
public:
b_BuildTexture* texture;
lm_layer lmap;
vecFace faces;
ImplicitDeflector() : texture(0)
{
}
~ImplicitDeflector()
{
Deallocate ();
}
void Allocate ()
{
lmap.c... | TOOL | 0.970486 | 3.052561 |
a1d29f9a-b4f5-42d1-b1af-d525310de369 | GSGFs7/algorithm | acwing/3384. 二叉树遍历(指针).cpp | #include <iostream>
using namespace std;
/*
* 利用结构体和指针建立二叉树
* */
struct Node// 用结构体表示一个完整的节点
{
Node *l = nullptr;// 一个指向Node的指针,左孩子
Node *r = nullptr;// 右孩子
char val{};// 自身的值
};
// 利用先序建立二叉树
Node * build(Node * root)// 返回Node的指针
{
char c;
cin >> c;
if (c == '#') return nullptr;
root =... | ALGO | 0.999944 | 4.298224 |
1f31de89-9823-497e-9946-73b0491d96e8 | P0L3NARUBA/roblox-2016-source-code | Contribs/boost_1_56_0/libs/math/example/neumann_zeros_example_1.cpp | #ifdef _MSC_VER
# pragma warning (disable : 4512) // assignment operator could not be generated.
# pragma warning (disable : 4996) // assignment operator could not be generated.
#endif
#include <iostream>
#include <limits>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <iterator>
//[neumann_zero... | ALGO | 0.999242 | 6.335505 |
67959ace-396c-4195-bedd-026f0d89ed8f | Wibben/WCIPEG | p129ex5.cpp | #include <iostream>
#include <cctype>
using namespace std;
int main()
{
char f;
string line;
int cnt=0;
cin >> f; cin.ignore();
getline(cin,line);
f = toupper(f);
for(int i=0; i<line.length(); i++)
if(toupper(line[i])==f) cnt++;
cout << line << endl << cnt << endl;
return 0;
}
| ALGO | 0.988371 | 3.54082 |
a60e1d41-96c9-48b6-8103-74059f8dc830 | AimotoRyosuke/atcoder | work/abc/C/325_C_2.cpp | // 復習する
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
int main() {
int H, W;
cin >> H >> W;
vector<string> G(H);
for (auto &g : G)
cin >> g;
vector<vector<bool>> ... | ALGO | 0.999899 | 5.015255 |
468b351f-7520-436a-a701-b2212d1c0a76 | alexandraback/datacollection | solutions_5636311922769920_1/C++/vovanhuy22000/D-large.cpp | #include <iostream>
#include <set>
#include <time.h>
#include <stdio.h>
#include <fstream>
using namespace std;
void factor(int a[], int base, int num, int n){
for(int i = n - 1; i >= 0; i--){
a[i] = num % base;
num = num/base;
}
}
template<typename T>
void display(T a[], int n){
for(int ... | ALGO | 0.999443 | 3.286035 |
b1ebeefa-2170-467f-a3d8-35282e087ef0 | xinjunZ/miracl_test | poly.cpp | /*
* C++ class to implement a polynomial type and to allow
* arithmetic on polynomials whose elements are from
* the finite field mod p
*
* WARNING: This class has been cobbled together for a specific use with
* the MIRACL library. It is not complete, and may not work in other
* applications
*
* See Knuth Th... | TOOL | 0.993679 | 4.881686 |
6a0d5715-b507-45cf-bfd3-40d18379b7e0 | Rinnegatamante/eldritch-vita | Code/Libraries/Math/src/segment.cpp | #include "core.h"
#include "segment.h"
#include "triangle.h"
#include "aabb.h"
#include "collisioninfo.h"
#include "mathcore.h"
#include "sphere.h"
#include "cylinder.h"
#include "ellipsoid.h"
Segment::Segment()
: m_Point1()
, m_Point2()
{
}
Segment::Segment( const Vector& Point1, const Vector& Point2 )
: m_Point1( P... | ALGO | 0.987369 | 5.43336 |
6e0db2ab-ce76-41d5-ba89-b282bcc31c28 | chungers/lab616 | third_party/cpp/boost_1_43_0/libs/numeric/interval/examples/filter.cpp | #include <boost/numeric/interval.hpp>
#include <iostream>
namespace dummy {
using namespace boost;
using namespace numeric;
using namespace interval_lib;
typedef save_state<rounded_arith_opp<double> > R;
typedef checking_no_nan<double, checking_no_empty<double> > P;
typedef interval<double, policies<R, P> ... | ALGO | 0.99997 | 6.619447 |
43cf5f64-f060-414c-b556-e5b11d2d83a3 | rajesh-1920/Competitive_Programming_Problem_Solving | Codeforces/B_The_Number_of_Products.cpp | // Author: Rajesh Biswas
// CF : rajesh-1920
// Date : 09.08.2025
#include <bits/stdc++.h>
using namespace std;
//----------------------------(definition section)-----------------------------------------
#define dbg(x) cout << #x << " = " << x << '\n'
#define int long long int
#define fi first
#define sc second... | ALGO | 0.999955 | 4.105019 |
0dd22fe0-fd62-45d2-93c2-07e4d61e9c22 | simawn/comp371-bumper-cars | ThirdParty/FreeImage-3170/Source/OpenEXR/Imath/ImathFun.cpp | #include "ImathFun.h"
IMATH_INTERNAL_NAMESPACE_SOURCE_ENTER
float
succf (float f)
{
union {float f; int i;} u;
u.f = f;
if ((u.i & 0x7f800000) == 0x7f800000)
{
// Nan or infinity; don't change value.
}
else if (u.i == 0x00000000 || u.i == 0x80000000)
{
// Plus or minus zer... | ALGO | 0.973196 | 7.054082 |
1da1bfa5-ddf0-4cab-893e-b97851da2529 | muhammadjamalmatloob/PF_Lab07 | task09cp.cpp | #include <iostream>
using namespace std;
int calcultePrice(int money, int year);
int main ()
{
int m, y, price;
cout << "Enter money: ";
cin >> m;
cout << "Enter year: ";
cin >> y;
price = calcultePrice(m,y);
if (m >= price)
{
cout << "Yes! He will live a carefree life and wil... | ALGO | 0.994466 | 3.895725 |
3b8758d7-f8b1-4725-9d62-2c9d0bf1d1d2 | daniellebassetto/estrutura-de-dados-linguagem-c | Aula02/Aula02-Ex04.cpp | /*
Elabore uma funo que receba como parmetro uma string de no mximo 20 caracteres e um caractere. Retorne com a primeira
ocorrncia do caractere no string. Caso o caractere no exista na string, retorne com -1
*/
#include <stdio.h>
#include <string.h>
int busca(char *s, char C)
{
int i, p = -1;
for(i = 0; i < strle... | ALGO | 0.989899 | 3.793577 |
064e9f48-7227-42f9-916f-840025daba0e | aadityab7/Practice | 1046. Last Stone Weight.cpp | class Solution {
public:
int lastStoneWeight(vector<int>& stones) {
//use Priority Queue or Max heap to get the max elements quickly
priority_queue<int> pq(stones.begin(), stones.end());
int x, y;
while(pq.size() > 1){
y = pq.top();
pq.pop();
... | ALGO | 0.999976 | 5.694512 |
3334ea4e-69c5-440b-aef5-de9e725bdbb4 | sarvex/leetcode-chez | solution/2300-2399/2336.Smallest Number in Infinite Set/Solution.cpp | class SmallestInfiniteSet {
public:
unordered_set<int> black;
SmallestInfiniteSet() {
}
int popSmallest() {
int i = 1;
for (; black.count(i); ++i)
;
black.insert(i);
return i;
}
void addBack(int num) {
black.erase(num);
}
};
/**
* Your... | ALGO | 0.999027 | 5.545307 |
2d600480-eca9-4041-85ac-29f90c99a1bc | Shadat-tonmoy/ACM-Problem-Solution | LightOJ/1080 - Binary Simulation.cpp | #include<bits/stdc++.h>
#define MAX 100005
using namespace std;
struct node
{
int times=0,an;
} tree[3*MAX];
int arr[MAX];
int ans;
void build(int node,int b,int e)
{
if(b==e)
{
tree[node].times=0;
//cout<<node<<" range : "<<b<<" - "<<e<<" "<<tree[node].times<<endl;
return;
}
... | ALGO | 0.998604 | 3.801818 |
a921521e-4eb5-4b21-87d6-7b31bd2a4f94 | KunalNarkhedePatil/LogicBuilding | Queue/Practice.cpp | #include<iostream>
using namespace std;
class Queue
{
public:
int Front;
int Rear;
int *Arr;
int iSize;
Queue()
{
Front=Rear=-1;
this->iSize=10;
Arr=new int[iSize];
}
bool empty()
{
if(Front==-1 && Rear ==-1)
{
return true;
... | ALGO | 0.998489 | 4.104408 |
3f9f8ba0-0c15-4dec-ba0c-7e4ba5076d57 | usernameunavalible0/BadPaste | src/SDK/hl2_src/tier1/checksum_sha1.cpp | /*
100% free public domain implementation of the SHA-1
algorithm by Dominik Reichl <<EMAIL>>
=== Test Vectors (from FIPS PUB 180-1) ===
SHA1("abc") =
A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") =
84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
... | ALGO | 0.952444 | 6.840489 |
024d3c05-26d6-4cd5-ab79-246add2a54e0 | ianiketkumar7/CPP | CODES/20JunPepClass.cpp | #include<iostream>
using namespace std;
int LinearSearch(int arr[], int n, int target) {
for(int i = 0; i < n; i++) {
if(arr[i] == target) return i;
}
return -1;
}
int main(){
int n = 5;
int arr[n] = {1,2,3,4,5};
cout << "Position of target" << LinearSearch(arr, n, 3);
} | ALGO | 0.999477 | 5.430388 |
a1a7f2fc-c4c1-4322-9af1-2155d712647d | robyang1/cp | skilevel.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 69;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
using p... | ALGO | 0.999915 | 3.769945 |
1838bce9-66dc-4acb-89f0-baad5cb1efcd | nglong14/CP | 15-6/ksum.cpp | #pragma GCC optimize(3)
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC target("avx","sse2")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffas... | ALGO | 0.999995 | 4.087345 |
394d234b-4fef-41b4-8d2b-15b23b2b29dc | raincross7/code-similarity | codes/train_code/problem107/problem107_370.cpp | #include<iostream>
using namespace std;
#define MAX 16
int main(){
int a,b,n;
int na,nb;
bool road[MAX+2][MAX+2];
int dp[MAX+2][MAX+2];
int dx[]={0,1};
int dy[]={1,0};
int m;
while(1){
cin>>a>>b;
if(a==0&&b==0) break;
for(int i=0;i<MAX+2;i++){
for(int j=0;j<MAX+2;j++){
road[i][j]=false;
... | ALGO | 0.999264 | 3.763584 |
c8bab805-31df-49e7-a854-31309f936e0f | ReZeroS/LeetCode | 104.Maximum Depth of Binary Tree/test.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:
int maxDepth(TreeNode* root) {
if(!root){
return 0;
}
retur... | ALGO | 0.999355 | 6.530695 |
f7374bf5-5a0d-48b6-83f3-498a6bf340bd | nadim28/Competative_coding | courseraSum of Two Digits.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a=0,b=0,sum=0;
cin>>a>>b;
sum=a+b;
cout<<sum;
return 0;
}
| ALGO | 0.994017 | 3.196311 |
2690994f-af67-4a83-bab8-4f656e10ecb8 | Abhijitt25/study_c | Lab Assignments/lab 4/Class_assignment.cpp | #include<iostream>
using namespace std;
void swap(int&, int&);
int main()
{
int a,b;
cout<<"Enter two numbers: "<<endl;
cin>>a>>b;
cout<<"Before swap values are: "<<a<<" "<<b<<endl;
swap(a,b);
cout<<"After swapping values of a & b are: "<<a<<" "<<b<<endl;
}
void swap(int& p, int& q)
{
int temp=p;
p=q;
q... | ALGO | 0.998095 | 4.827029 |
bffa899d-6fad-4e72-abee-7e6d4ff8332d | 1119-2916/competitive-programming | atcoder/agc/034/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb ... | ALGO | 0.999942 | 4.402833 |
01cbb7c0-85fc-466f-99a1-8ddc6af20d92 | AlexandrosKaram/DS-Project-2023 | src/AVL.cpp | #include "../header/AVL.h"
#include "../header/funcs.h"
#include <iostream>
#include <fstream>
#include <chrono>
int AVL::getHeight(Node* node) {
if (node == nullptr) {
return -1;
}
return 1 + max(getHeight(node->left),getHeight(node->right));
}
int AVL::getBalanceFactor(Node* node) {
if (node... | ALGO | 0.994566 | 4.914987 |
ffe0b90a-9402-4a33-bdff-104201c574f4 | GrahamGoudeau/Sort-Implementations | main2.cpp | #include "sort2.h"
#include <iostream>
using namespace std;
int main()
{
Quicksort sorter;
sorter.readList();
sorter.sort();
cout << "Output:\n";
sorter.printArray();
return 0;
}
| ALGO | 0.999679 | 4.661161 |
bea4e7a6-37a5-4667-8bb0-d9a82e6d906a | kishanrajput23/Wipro-Unix-CPP-Systems | STL Containers/06.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
vector<int> v1{3, 1, 2, 3};
vector<int> v2{3, 1, 2, 3};
if(v1==v2)
{
cout<<" Equal ";
}
else
{
cout<<"Not Equal ";
}
return 0;
}
| ALGO | 0.99958 | 3.885968 |
007ea200-9958-47f4-ad19-9feb0f1f28a3 | Elliot-Adam/C-dev | Pointers/CppPointers_std_List_of_Pointers/CFunctionCall.cpp | // Computers1.cpp : Defines the entry point for the console application.
//
#include "FunctionTester.h"
#include "ClassTester.h"
#include "LinkedListTester.h"
#include <stdio.h>
#include <malloc.h>
int GlobalThree = 3;
struct Person
{
int age;
char gender; // M or F
};
int Add(int n1, int* n2)
{
// ... | TEST | 0.87311 | 3.41235 |
e40ba121-af0a-46b4-839f-e167c69b0bfa | oneseer/libcxx | test/std/algorithms/alg.sorting/alg.min.max/min_element_comp.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare>
// requires CopyConstructible<Compare>
// Iter
// min_element(Iter first, Iter last, Compare comp);
#include <algorithm>
#include <functional>
#include <random>
#include <cassert>
#include "test_macros.h"
#include... | TEST | 0.948976 | 6.480176 |
54ae37fa-02c0-4762-9e51-909cbdf4a885 | Divyanshu9794/cpp_practice | Equal Coins.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long t, x, y;
cin >> t;
while (t--) {
cin >> x >> y;
cout << ((x+2*y)%2 || (y%2 && x<2)? "NO" : "YES") << '\n';
}
return 0;
} | ALGO | 0.999616 | 4.273994 |
36ba07b1-eedb-433d-909f-b805e6202e08 | BartoszPiotrowski/ml-guidance-for-instantiation-in-CVC5 | CVC5/src/theory/theory_inference.cpp | #include "theory/theory_inference.h"
#include "theory/theory_inference_manager.h"
using namespace cvc5::kind;
namespace cvc5 {
namespace theory {
SimpleTheoryLemma::SimpleTheoryLemma(InferenceId id,
Node n,
LemmaProperty p,
... | TOOL | 0.944492 | 6.160981 |
a95b04dc-e3fa-4747-992b-d3a0bd6f793d | KhacLuong/T2011E_LBEP.chapter1 | HomeWork.C/HomeWork.lesson9/Bai4.BCNN.cpp | #include <stdio.h>
int BCNN(int x, int y){
if(x==0||y==0){
return 0;
}else{
for(int i=x; i<=x*y;i+=x ){
if(i%x==0&&i%y==0)
return i;
}
}
}
void inRaBCNN(int a, int b){
if(BCNN(a,b)==0){
printf("khong ton tai boi cua 0 ");
}else{
printf(" BCNN cua X va Y la: %d", BCNN(a,b));
}
}
int main()... | ALGO | 0.999624 | 3.923647 |
0db4a4e1-f58f-4886-bba9-6584b707a0f2 | Haneesh1827/Operating_System_Simulator | Process_Synchronization/dining_philsophers.cpp | #include"dining_philsophers.hpp"
//global varibles
sem_t forks_mutex[MAX_PHIL]; // mutex for forks
sem_t allphilcreated; //contional variable for philosophers threads to wait until all threads are created.
sem_t cout_mutex; //mutex for printing one at a time
int max_eattime;
int max_thinktime;
int left(int id, int n... | ALGO | 0.999106 | 3.634338 |
3b990bed-203a-4ccf-8695-1ff9a79e610a | curious-neeraj/code_house | dsa/sliding_window/minimum_window_substring.cpp | // Time Complexity - O(n)
// Space Complexity - O(1)
class Solution {
public:
string minWindow(string s, string t) {
vector<int> map(128,0);
for (char c : t)
map[c]++;
int t_size = t.size(), s_size = s.size(), begin = 0, end = 0;
int window = INT_MAX, head = 0... | ALGO | 0.999994 | 6.609726 |
6e20b4d1-9ad0-4f1e-b693-57c8d262fc6f | dhavalbathe/Data-Structures-and-Algorithms | DSA/Competitive Programming/Modular Arithematic/binaryNumber.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n; cin>>n;
cout<<(1<<n)<<endl;
return 0;
} | ALGO | 0.999547 | 3.182036 |
7f951d3b-3f3f-4f9f-b601-131e6fbec3de | wemadedis/wme | engine/third_party/bullet/include/Bullet/BulletSoftBody/btDefaultSoftBodySolver.cpp | #include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
#include "btDefaultSoftBodySolver.h"
#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
#include "BulletSoftBod... | ALGO | 0.926944 | 7.654786 |
9521b5b4-f2e5-40db-8c0e-6fc67c09e6fe | AbrarAli-SE/DSA-Lab | Lab_6/task_05.cpp | #include <iostream>
#include <string>
using namespace std;
class Song
{
public:
string title;
string artist;
Song *prev;
Song *next;
Song(string t, string a)
{
title = t;
artist = a;
prev = NULL;
next = NULL;
}
};
// Function to add a new song to the end of... | TOOL | 0.996927 | 6.033346 |
221bc384-d195-40c8-bb56-1afc2957519b | dj1vs/solutions | Поляков-Ерёмин/10/56/e.cpp | #include <iostream>
#include <cmath>
int main()
{
float x1, x2, y1, y2;
std::cin >> x1 >> y1 >> x2 >> y2;
printf("%.3f", sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
return 0;
} | ALGO | 0.999261 | 3.749573 |
a4d4254c-65e7-42a8-9050-088ff424ade0 | julianarocha12/Exercicios_beecrowd_C- | 1180 - Menor e Posição.cpp | #include <stdio.h>
int main()
{
int a,n, p, men;
scanf("%d", &n);
int x[n];
for(a=0; a<n; a++)
scanf("%d", &x[a]);
men=x[0];
for(a=1; a<n; a++)
{
if(men>x[a])
{
men=x[a];
p=a;
}
}
printf("Menor valor: %d\nPosicao: %d\n", men, p);... | ALGO | 0.999907 | 3.709166 |
979f32d4-a4e1-4ea3-91e1-38c06f6f78dd | CodeWilliamT/MyAlgorithms | C++_Algorithm/LeetCodeDemo/LeetCodeDemo/2288.cpp | using namespace std;
#include <iostream>
#include <string>
//麻烦模拟 字符串处理
//字符串格式化
//坑贼多:注意longlong越界,注意价格需要左右是边界或空格。
class Solution {
public:
string discountPrices(string s, int discount) {
string rst;
bool isPrice = 0,isSplit=1;
string tmp;
char tmps[15];
int len;
for... | ALGO | 0.998142 | 4.183165 |
f99d559c-16c4-4cc6-a45d-edfc662c8709 | vimalprogrammer/Python-TQ | SecondLargest.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
//Code here...
int t;cin>>t;while(t--)
{
int n;cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
int re... | ALGO | 0.999982 | 4.082346 |
e6931b9e-3977-43a5-8fa8-2647118c81e9 | BEPb/Cpp_stepik | 2_Execute_programms/2.2/2.2.3.Rec.cpp | // task 2.2.3.
#include <iostream>
using namespace std;
void rec()
{
int a=0;
cin >> a;
if ( a ==0 ) return;
rec();
cout << a << " ";
}
int main()
{
rec();
return 0;
} | ALGO | 0.999047 | 3.290674 |
4fb4a9a7-5e8f-4d2a-9ecd-63c2dd0a0aff | aashishanegi/cpp_programs | sample5.cpp | #include <iostream>
using namespace std;
int main()
{
int a,b;
cout<< "Enter number 1 : " <<endl;
cin>> a;
cout<< "Enter number 2 : " <<endl;
cin>> b;
cout<< "Number 1 is : " <<a <<endl << "Number 2 is : " <<b <<endl;
int c;
c=a;
a=b;
b=c;
cout<< "New value of number 1 is: "... | ALGO | 0.997292 | 3.270648 |
b8d24cbb-e683-4530-97d7-ca0bfe62925d | tacocat1234/neural-network-w-sgd | ppo.cpp | #include "ppo.h"
StateActionReward::StateActionReward(const std::vector<double>& state, const std::vector<double>& action, double reward) : state(state), action(action), reward(reward) {}
double PPO::getDiscountedRewards(Trajectory trajectory, double discountFactor){
double total = 0;
for (const auto& sar : t... | ALGO | 0.987443 | 5.212635 |
2379d897-91a1-49f2-8eee-2ab2f94ad3f0 | raincross7/code-similarity | codes/train_code/problem026/problem026_65.cpp | #include <bits/stdc++.h>
using namespace std;
int Bob, Alice, Draw, x ,y;
int main () {
cin >> x >> y;
if (x==y){
cout << "Draw" << endl;
}else if (y==1){
cout << "Bob" << endl;
}else if ((x>y)||(x==1)){
cout << "Alice" << endl;
}else if (x==1){
cout << "Alice" << e... | ALGO | 0.999992 | 3.543626 |
26e9fad0-d0ba-4963-bfd6-926cbccf9c9f | Shashank-Varnekar/Codechef | reverce.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--){
int n;
cin >> n;
int rev = 0, rem;
while(n > 0){
rem = n % 10;
rev = rev * 10 + rem;
n /= 10;
}
cout << rev << endl;
}
return 0;... | ALGO | 0.999933 | 5.028539 |
52850318-0516-4981-945a-6cf106f23845 | akshat-khosya/leetcode | 733-flood-fill/733-flood-fill.cpp | class Solution {
public:
vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int sc, int color) {
int n=image.size();
int m=image[0].size();
int **visited=new int*[n];
for(int i=0;i<n;i++){
int* arr=new int[m];
for(int j=0;j<m;j++){
... | ALGO | 0.987957 | 6.250236 |
fa1d63b5-e8ca-447d-be64-6100847ec84b | orijoon98/Algorithm_Study | C++/baekjoon/휴게소세우기_1477.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int N, M, L, ans;
vector<int> rest;
void Input() {
cin>>N>>M>>L;
// 휴게소를 놓을 수 없는 위치 추가
rest.push_back(0);
rest.push_back(L);
int position;
for (int i = 0; i < N; i++) {
cin>>position;
rest.push_back(position);
... | ALGO | 0.999991 | 4.326111 |
83456c39-09ef-4483-9ee6-dbde5e4b9d90 | MeiYing-cell/C-_code | Acwing/算法提高课/第一章 动态规划/状态机模型/1057股票买卖4_v2.cpp | #include<iostream>
#include<cstring>
using namespace std;
const int N = 1e5 + 10, M = 110;
int f[N][M][2];
int w[N];
int main(){
int n, k;
cin >> n >> k;
for(int i = 1; i <= n; i ++) cin >> w[i];
memset(f, -0x3f, sizeof f);
for(int i = 0; i <= n; i ++) f[i][0][0] = 0;
for(int i = 1; i <= n; i ++... | ALGO | 0.999983 | 3.459698 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.