uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e976482c-4442-406a-b92b-801bd5215767 | Nikitosh/AdventOfCode-2024 | 18/2.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define sz(x) (int) ((x).size())
#define forn(i, n) for (int i = 0; i < (n); ++i)
#define fornr(i, n) for (int i = (n) - 1; i >= 0; --i)
#define forab(i, a, b) for (int i = (a); i < (b); ++i)
#... | ALGO | 0.999968 | 4.156846 |
38cbe2dd-2fb7-4e6e-980a-da48b6261aa9 | Gabriel4256/algorithm-study | C++/NERD2.cpp | //처음에는 트리로 풀려고 했는데, 자꾸 시간초과가 떠서
//책을 참고해서 map을 이용해서 풀었다.
#include <iostream>
#include <vector>
#include <map>
using namespace std;
int no_of_nodes;
map<int, int> coords;
bool isDominated(int x, int y){
map<int, int>::iterator it = coords.lower_bound(x);
if(it == coords.end()) return false;
return y < i... | ALGO | 0.999519 | 4.097334 |
1ad774d6-b317-4221-a9cf-eea9b19895ab | TxJaydip/CP-solutions | codeforces_Binary Cut.cpp | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define pb push_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vpi vector<pair<int, int>>
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
ll MOD = (7 + (10e9));
string decToBin(ll num)
{
string str;
w... | ALGO | 0.999846 | 4.184675 |
96ef7836-5589-45f5-9c23-88ce739032bb | devpatel062/sem3-stuff | sem3/sem3 dsa/lab_04/1.cpp | /*
PRIYANSHU IS A PEACEFULL SOUL
*/
#include <bits/stdc++.h>
using namespace std;
/* Enter your code here. Read input from STDIN. Print output to STDOUT .p. */
class Stack
{
public:
int size;
int top;
char *arr;
};
int prec(char c)
{
if (c == '^')
return 4;
else if (c == '*' || c == '/'... | ALGO | 0.999951 | 4.948331 |
f1165e5d-dd3f-400c-9757-f700d14dbe68 | Th0masAndy/KKRT16 | thirdparty/linux/miracl/miracl_osmt/source/ecn4.cpp | /*
* MIRACL C++ Implementation file ecn4.cpp
*
* AUTHOR : M. Scott
*
* PURPOSE : Implementation of class ECn4 (Elliptic curves over n^4)
*
* 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
*... | ALGO | 0.993608 | 5.135552 |
f8bf870f-f181-4422-b0d8-42f105e97c06 | sgokhanbirkin/flutter_full_tutorial_velibacik | tutorial/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.998483 | 6.787361 |
ec4bbc45-c2a0-4d43-97f3-f847d68ddc4d | alexandraback/datacollection | solutions_5686275109552128_0/C++/monyura/main.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <bitset>
#include <memory>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <string>
#include <cstring>
#include <fstream>
#include <functional>
#include <stack>
#include ... | ALGO | 0.999639 | 3.840989 |
6cdc4522-5b09-4322-98c0-539cf60c2019 | artsung410/CnuStudy | Study/C++수업정리/백준/15633/2581.cpp | #include <iostream>
#include <queue>
using namespace std;
int M, N;
int main()
{
// 1. Է
cin >> M;
cin >> N;
int cnt = 0;
int result = 0;
queue<int> q;
if (M != N)
{
for (int i = M + 1; i < N; i++)
{
for (int j = 1; j < M; j++)
{
if (i % j == 0)
{
++cnt;
}
}
if (cnt == 1)... | ALGO | 0.999992 | 4.622616 |
aaaaa009-f9d3-4291-be6b-bf6f1b5342ea | Nayemuzzaman/URI_problem | uri1101.cpp |
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a,b,value;
while(true){
scanf("%d %d",&a,&b);
// if(a>b || b>a){
if(a<=0||b<=0){
break;
}else if(a>b){
value=0;
for(int i=b;i<=a;i++){
... | ALGO | 0.99947 | 3.809546 |
bdb1a084-5ac3-453e-8f16-bfb88b1eab7e | donibayu/Alpro-2 | Pertemuan 4/genapdanganjil.cpp | #include <iostream>
using namespace std;
int main()
{
int bil;
cout <<"Masukan bilangan bulat : ";
cin >>bil;
if(bil%2==0) {
cout <<bil<<"Adalah bilangan genap";
}
else {
cout <<bil<<"Adalah bilangan ganjil";
}
return 0;
}
| ALGO | 0.994402 | 3.573488 |
58bf5c1b-bcfc-4d6a-b4e5-5585897b958e | ishandutta2007/codeforces | aropan/normal/403/A.cpp | #include <ctime>
#include <queue>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <stack>
using namespace std;
template <typename T> T sqr(T x) { return x * x; }
template <typename T> T abs(T x) { return x < 0... | ALGO | 0.999944 | 3.075185 |
3cf75455-2e02-4c96-a47f-eba1d0041b60 | plantom03/leetcode | 451_sort_By_Frequency/Solution.cpp | /*************************************************************************
> File Name: Solution.cpp
> Author: habit
> Mail: <EMAIL>
> Created Time: 2017年03月30日 星期四 21时18分59秒
************************************************************************/
#pragma GCC diagnostic error "-std=c++11"
#include<iostream>
#inc... | ALGO | 0.999983 | 5.619834 |
d07acc29-6275-42db-81bb-c2900d306a9b | opensource-hisense/SmartTV-SeriesVidaaU7_NT | oss/part1/boost/boost_1_73_0/libs/math/example/binomial_quiz_example.cpp | // binomial_examples_quiz.cpp
// Simple example of computing probabilities and quantiles for a binomial random variable
// representing the correct guesses on a multiple-choice test.
// source http://www.stat.wvu.edu/SRS/Modules/Binomial/test.html
//[binomial_quiz_example1
/*`
A multiple choice test has four possibl... | ALGO | 0.992327 | 5.93841 |
738dd317-a2e4-42f9-b56f-94dcd666c53d | ckrto/C-Example | 진법 변환(시프트).cpp | #include <stdio.h>
int main()
{
}
#define BASE 16
void myrpintbin(int n)
{
unsigned int b = 1;
while (n>b) b = b*8;
b = b/8;
g
while(b) {
if(n>=b) {
putchar('0' + n/b); //2~10
n = n - n/b*b;
}else{
putchar('0');
}
b = b / 8;
}
putchar('\n');
}
void myprintbinshift(int n)
{
unsigned int m... | ALGO | 0.99963 | 3.871759 |
ec15f661-aa85-4c4e-b644-3b8a857e17b2 | eslinux/DirectFB-ilixi-LiTE | ilixi-1.0.0/ilixi/types/Affine2D.cpp | #include <types/Affine2D.h>
#include <cmath>
using namespace std;
namespace ilixi
{
#define DOUBLE_TO_FIXED(x) ((long)(x * 65536.0 + 0.5))
Affine2D::Affine2D()
{
clear();
}
Affine2D::Affine2D(double m11, double m12, double m13, double m21, double m22,
double m23)
{
_m[0] = m11;
... | ALGO | 0.862062 | 6.795457 |
f52ec834-4727-4a66-8436-5fbf0e5c6dac | jk-jung/problem-solving | codeforces/Codeforces Round 75x/R757_div2_C.cpp | #include <string.h>
#include <stdio.h>
#include <math.h>
#include <cassert>
#include <set>
#include <map>
#include <array>
#include <stack>
#include <queue>
#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vecto... | ALGO | 0.999872 | 4.251373 |
be948851-20a1-4dda-a225-7d4f17e78869 | adityasrathore/Codes | LeetCode/2103. Rings and Rods.cpp | class Solution {
public:
int countPoints(string rings) {
int R[10]={0};
int G[10]={0};
int B[10]={0};
unordered_map <int,int> mp;
int n=rings.size();
for(int i=0;i<n;i+=2){
if(rings[i]=='R'){
R[rings[i+1]-'0']+=1;
}
... | ALGO | 0.998823 | 5.85088 |
3968be1e-b988-4854-82cc-9e2fad802acc | itzraju5/CODEFORCES_SOLUTIONS | Codeforces_Solutions/476_A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
int minimum_moves(ceil(n/2.0));
for(int i=minimum_moves; i<=n; i++){
if(i%m == 0){
cout << i << endl;
return 0;
... | ALGO | 0.999986 | 4.026785 |
7f9fd6e3-bd13-48c8-b23d-4e291e9f4dfa | myunbin/PS | BOJ/3012.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
#define fileio() freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define fio() ios_base::sync_with_std... | ALGO | 0.999991 | 4.327302 |
8309125a-c4e6-4516-8eb4-d4d937ed6edb | Victor515/Data-Structures-UIUC | exam-reports/Exam10/programming_doubleHashing/dhhashtable.cpp | #include "dhhashtable.h"
using hashes::hash;
using hashes::hash2;
using std::pair;
/**
* Inserts the given key, value pair into the HashTable.
*
* @param key The key to be inserted.
* @param value The value to be inserted.
*/
template <class K, class V>
void DHHashTable<K, V>::insert(K const& key, V const& value... | ALGO | 0.973179 | 6.672805 |
2b9e9ae4-458c-4e75-8e80-24d3b96cebd1 | afrozchakure/Competitive-Programming-Solutions | LeetCode/Algorithms/Hard/BusRoutes.cpp | class Solution {
public:
int numBusesToDestination(vector<vector<int>>& routes, int source, int target) {
int n = routes.size();
int level = 0;
unordered_map<int, vector<int>> m; // store - bus stop no. -> bus numbers list
for(int i=0; i<n; i++) {
for(int j=0; j<ro... | ALGO | 0.999982 | 6.377046 |
aa666cda-d403-44e7-abbc-bddcd2201a50 | ayzk/ft-caffe-public | src/caffe/solvers/rmsprop_solver.cpp | #include <vector>
#include "caffe/sgd_solvers.hpp"
namespace caffe {
#ifndef CPU_ONLY
template <typename Dtype>
void rmsprop_update_gpu(int N, Dtype* g, Dtype* h, Dtype rms_decay,
Dtype delta, Dtype local_rate);
#endif
template <typename Dtype>
void RMSPropSolver<Dtype>::ComputeUpdateValue(int param_id, Dtype r... | ALGO | 0.991657 | 7.303316 |
320071fc-d623-4718-a8a2-3ae6e36c59a1 | vbonnici/grafe-sim | analysis/data/p02256/s379182202.cpp | using namespace std;
#include <iostream>
int gcd(int l,int m){
if (m==0) {
return l;
}
return gcd(m, l%m);
}
int main() {
// insert code here...
int p,r;
cin>>p>>r;
cout<<gcd(p,r)<<endl;
return 0;
}
| ALGO | 0.999932 | 4.143474 |
6dc23622-ee38-4122-af9f-6ba579ff34eb | KaloyanYonov/SDA | Tests/Test5/Помощникът на Дядо Коледа/solution.cpp | //this solution gives 21.43/50 (1 timeout 1 segmentation fault)
#include <bits/stdc++.h>
constexpr int MAX_N = 1000000;
bool hasPath(const std::vector<int> graph[], int from, int to) {
std::vector<bool> visited(MAX_N, false);
std::queue<int> q;
q.push(from);
visited[from] = true;
while (!q.empty... | ALGO | 0.999983 | 5.594448 |
154d0214-1817-4c32-9ce6-05fba7ab7fb1 | JabiHabib/Lab14_1 | Lab14_1/Lab14_1.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <locale>
int main() {
setlocale(LC_ALL, "Ukr");
int n;
int i;
printf("Введiть кiлькiсть елементiв масиву: ");
scanf_s("%d", &n);
if (n <= 0) {
printf("Помилка: Розмiр масиву повинен бути бiльше 0.\n");
return 1... | ALGO | 0.988192 | 3.951082 |
6a6f8645-b7dd-4192-84ef-fc0f79d80b26 | MdAfsarHossain/Phitron | Semester 2/Course 1 [Introduction to Algorithms & Problem Solving Part - III]/XM/Lab Mid Term/Prob_7.cpp | #include<bits/stdc++.h>
using namespace std;
int sumOfDigits(int n)
{
if(n==0)
return 0;
return (n%10) + sumOfDigits(n/10);
}
int main()
{
int n;
cin>>n;
cout<<sumOfDigits(n)<<"\n";
return 0;
}
/**
234
9
**/
| ALGO | 0.999907 | 4.939247 |
dc118039-4c0a-4a66-866f-94163529f944 | qpwoeirut/competitive-programming | Codeforces/Virtual/520/520c/520c.cpp | /*
* 520c.cpp
*
* Created on: Jul 27, 2020
* Author: Stanley
*/
#include <iostream>
#include <algorithm>
#include <cassert>
#include <queue>
#include <set>
#include <string>
#include <vector>
#include <map>
#include <deque>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <i... | ALGO | 0.99996 | 5.142944 |
af8a0387-c2da-415c-91a2-c7446c2e8968 | Dup4/competitive-programming | codeforces/contest/1334/d/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define SZ(x) int((x).size())
#define endl "\n"
using db = double;
using ll = long long;
using ull = unsigned long long;
using pII = pair<int, int>;
using pLL = pair<ll, ll>;
constexpr int mod = 1e9 + 7;
template <class T1, class T2>
inlin... | ALGO | 0.999751 | 3.32199 |
204cf1de-ca65-4f97-90c4-99ea13d5a4c6 | hachi-88/atcoder | abc/087/abc087c.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a1[n];
int a2[n];
for (int i = 0; i < n; i++) cin >> a1[i];
for (int i = 0; i < n; i++) cin >> a2[i];
int ans = 0;
for (int i = 0; i < n; i++) {
int sum = 0;
for (int j = 0; j <= i; j++) s... | ALGO | 0.999977 | 3.625016 |
a516ebe9-4ece-405d-8c94-547eb7f67427 | Via-R/lab2_sem1_2017 | LongArithmeticLib/XLong.cpp | #include <iostream>
#include <cmath>
#include "XLong.h"
#include <iomanip>
int counter = 0;
Multiplier * XLong::currType = new KaratsubaMult();
void XLong::setType(Multiplier * a) {
currType = a;
}
bool isOk(){
return true;
}
XLong::XLong(){
l = 0;
}
XLong::XLong(int a) {
l = a;
}
XLong::XLong(std::string n) {
... | ALGO | 0.980493 | 3.394866 |
ee8e721b-c948-4230-8c67-c7e026a2e098 | yellowHatpro/Codes-Practice | Leetcode/1704_DetermineIfStringHalvesAreAlike.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool halvesAreAlike(string s) {
set<char> count = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'};
int j = s.size() / 2;
int a = 0, b = 0;
for (int i = 0; i < s.size() / 2; i++) {
if (count.find(s[i]) != count.end()) {
... | ALGO | 0.999392 | 5.997009 |
3ffdcca1-14dc-4c7c-b83b-574cf376b6ab | FXTD-ODYSSEY/cppreference | examples/boost/thread_10/main.cpp | #include <boost/thread.hpp>
#include <boost/chrono.hpp>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
void wait(int seconds)
{
boost::this_thread::sleep_for(boost::chrono::seconds{seconds});
}
boost::shared_mutex mutex;
std::vector<int> random_numbers;
void fill()
{
std::srand(static_... | TOOL | 0.967894 | 4.722131 |
363a9a07-9a5a-451c-8e73-0deb48d8da5c | sayalideo/CP | must do/longestPalin.cpp | // https://practice.geeksforgeeks.org/problems/longest-palindrome-in-a-string3411/1
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
string longestPalin (string S) {
// code here
int i,maxlength=1,n=S.length(),start=0,high,low;
string ans="";
... | ALGO | 0.999967 | 5.981964 |
530a519b-8baf-453b-9cb2-a72b84ca75e6 | praveengupta1701/Data-Structures-and-Algorithm | Arrays/2sum.cpp | // Created by ...
/* Author -Praveen Gupta*/
#include <bits/stdc++.h>
#include <thread>
#include <mutex>
#include <chrono>
#include <memory>
#include <condition_variable>
using namespace std;
using namespace std::chrono;
vector<int> naivetwoSum(vector<int>& nums, int target)
//Time Complexity: O(N2)
{
vector<int... | ALGO | 0.999802 | 5.278874 |
d902e4f4-6629-4928-8d93-7436d9e4edbb | nextgensultan/CP-Codeforces | 1822_A.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <sstream>
using namespace std;
typedef long long ll;
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
// freopen("input.txt", "r", stdin);
// freopen... | ALGO | 0.999945 | 4.545771 |
2cd4f221-096c-4df1-ba6f-10c643c1390e | nccaiteam/histopathology_annotation_nia | libs/boost_1_67_0/libs/msm/doc/PDF/examples/ExampleCircularBuffer.cpp | #include <vector>
#include <iostream>
// back-end
#include <boost/msm/back/state_machine.hpp>
// header for support of circular_buffer
#include <boost/msm/back/queue_container_circular.hpp>
//front-end
#include <boost/msm/front/state_machine_def.hpp>
// functors
#include <boost/msm/front/functor_row.hpp>
#include <boos... | TOOL | 0.903349 | 6.351286 |
b81e7281-e313-481d-8520-d8f29fa10da0 | DavidAbdelmalek/Self_Driving_Car_ND | control_trajectory/project/pid_controller/utils.cpp | /**********************************************
* Self-Driving Car Nano-degree - Udacity
* Created on: September 20, 2020
* Author: Munir Jojo-Verge
**********************************************/
/**
* @file utils.cpp
**/
#include "utils.h"
#include <cmath>
namespace utils {
double distance(const doub... | ALGO | 0.996743 | 6.307812 |
3448551b-653a-4c21-915d-f4dd0647d0a8 | ishandutta2007/codeforces | cold_chair/normal/568/C.cpp | #include<bits/stdc++.h>
#define fo(i, x, y) for(int i = x, B = y; i <= B; i ++)
#define ff(i, x, y) for(int i = x, B = y; i < B; i ++)
#define fd(i, x, y) for(int i = x, B = y; i >= B; i --)
#define ll long long
#define pp printf
#define hh pp("\n")
using namespace std;
int gg;
char str[53]; int lc;
int num[53];
co... | ALGO | 0.999985 | 3.472693 |
296e7bae-2ed0-414b-8e0f-f28d3df4fa3d | arifparvez14/Basic-and-competetive-programming | Online-Judge-Solution/Codeforces Solutions/113(A.Rank List).cpp | #include <bits/stdc++.h>
#define fileread freopen("in.txt","r",stdin)
#define filewrite freopen("out.txt","w",stdout)
#define ll long long int
#define FOR(i,n) for(int i=0;i<n;i++)
#define vll vector<ll>
#define mp make_pair
#define msll map<string, ll>
#define pb push_back
using namespace std;
bool sortfun(const pair<... | ALGO | 0.999974 | 3.531114 |
e491ccc0-7680-4f91-a497-9cb440215e8d | Prathamesh-Mandiye-0423/Coding-for-the-summer | DP/knapsack1.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mod=1e9+7;
int main(){
ll n,w;cin>>n>>w;
vector<ll>wt(n),v(n);
for(ll i=0;i<n;i++){
cin>>wt[i]>>v[i];
}
ll dp[n][w+1];
for(ll i=0;i<n;i++){
for(ll j=0;j<=w;j++){
dp[i][j]=0;
}
}
//dp[i][j]-> till index i what is the max value ... | ALGO | 0.999998 | 4.513707 |
8011e800-ff3f-4eb2-a3bf-a17d75ee5623 | kmjp/procon | leetcode/151-200/184/1411.cpp | typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) me... | ALGO | 0.999984 | 4.178419 |
39c1d790-52e0-43cd-9e7d-b94e28e29d90 | DuyTran1234/1000ExerciseC- | Chuong 9 - Mang cau truc/bai673.cpp | #include <iostream>
using namespace std;
void nhap(struct NHANVIEN a[], int &n);
void xuat(struct NHANVIEN a[], int n);
void hoanVi(struct NHANVIEN &a, struct NHANVIEN &b);
int luongMax(struct NHANVIEN a[], int n);
double tongLuong(struct NHANVIEN a[], int n);
void sapXepTangDan(struct NHANVIEN a[], int n);
struct NHAN... | ALGO | 0.987385 | 3.71392 |
31a1e1f8-6011-4681-97ec-a738b54bbca6 | Yasi2110/USACO-Guide | Bronze/Simulation/Mixing Milk.cpp | #include <bits/stdc++.h>
using namespace std;
int c[4], m[4];
int main()
{
freopen("mixmilk.in", "r", stdin);
freopen("mixmilk.out", "w", stdout);
cin>>c[1]>>m[1];
cin>>c[2]>>m[2];
cin>>c[3]>>m[3];
int tek = 1;
for(int i=1;i<=100;i++) {
int sled = tek+1;
if(sled == 4) sled... | ALGO | 0.99988 | 3.093748 |
443da2b4-cfba-4c89-940d-f425ca3aa691 | BBohdanBB/CPA-Programing-Essentials-in-C-Page | Chapter 2/2.3 - Labs (9)/Lab 2.3.19 (2).cpp | #include <iostream>
using namespace std;
int main(void) {
double pi4 = 0.;
long n;
cout << "Number of iterations? \n";
cin >> n;
for(int i = 0; i<n; i++){
pi4+=(double)(i%2==0)?(1./(2*i+1)):(-1./(2*i+1));
}
// Insert your code here
cout.precision(20);
cout << "Pi = " << (pi4 * 4.) << endl;
return 0;
}
| ALGO | 0.999799 | 4.049302 |
3747ed2c-2ac6-46e7-8fe1-0614f1ffdf13 | ShadowSFX/cpp_stuff | beautiful_matrix.cpp | #include <bits/stdc++.h>
using namespace std;
void test_case() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int c=0, r=0;
int x;
for (int i = 0;i < 5; i++){
r++;
for (int k = 0; k < 5; k++){
c++;
cin >> x;
if (x == 1)
break;
}
if (x == 1)
break;
c = 0;
}
cout << abs(... | ALGO | 0.999839 | 3.096863 |
bce7ff09-9c76-409d-b0ba-1827488361da | RC-Kanashii/MyLeetCode | 欢乐赛/I yesterday_once_more.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
//long long mem[65] = {0};
map<vector<long long>, long long> mem;
long long yesterday_once_more(int start, int count, int end) {
if (count == 0) {
mem[{start, count, end}] = end - (start-1);
return end - (start-1);
}
... | ALGO | 0.999909 | 4.105863 |
e41a2fed-8316-4435-9b5e-c370cb2b6e5b | kishankg/Data-Structures-and-Algorithms | gfg/merge_sort.cpp | #include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<cmath>
#include<iomanip>
using namespace std;
vector<int> take_input(int n)
{
vector<int> v;
for(int i=0;i<n;i++)
{
int num;
cin >> num;
v.push_back(num);
}
return v;
}
vector<int> sumVector(v... | ALGO | 0.999882 | 4.955032 |
9175bf2f-807f-4458-b288-1d6e04ac2844 | Joyal-Patel14/CPP | TakeUForward/hashing/countCharacters.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vpii;
typedef map<int, int> mii;
typedef set<int> si;
typedef set<pair<int,int>> spii;
typedef queue<int> qi;
// String having Upper... | ALGO | 0.999877 | 5.01901 |
74f2e580-0e3a-46de-b396-ca4583f62ea9 | AmanJ24/Hiroshi | c++/manveer/challenges/Challenge5.cpp | #include <iostream>
using namespace std;
int print(int* array, int array_size);
int* apply_all(int const* array, int array_size, int const* array2, int array2_size);
int main(){
const int array1_size = 5;
const int array2_size = 3;
int array1[] = {1,2,3,4,5};
int array2[] = {10,20,30};
cout <<... | ALGO | 0.997091 | 4.221989 |
78f70ec8-98fe-48f2-8314-a9ce7e1c5b8c | Soham-KT/Codes | C++/DSA/Abdul Bari/Recursion/taylor_series_of_ex_iterative.cpp | #include <iostream>
using namespace std;
float taylor(int x, int n)
{
float sum;
while(n!=0)
{
sum+=1+(x/n);
n--;
}
return sum;
}
int main(int sinh, char const *cosech[])
{
int x, p;
cout<<"Enter value of x: ";
cin>>x;
cout<<"Enter power: ";
cin>>p;
cout<... | ALGO | 0.999796 | 4.425809 |
f36f23d8-6602-435c-adec-c69f15405b66 | Gnaroshi/practice-algorithm-solvedac | With_Levels/Bronze/Bronze_2/5145.cpp | // problem: Subway Fares
// id: 5145
// time taken:
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tc;
cin >> tc;
for (int tcc = 1; tcc <= tc; tcc++)
{
cout << "Data Set " << tcc << ":\n";
int n;
cin >> n... | ALGO | 0.999875 | 4.618147 |
37f1ef74-371f-42c7-8dd6-8430b3fcdd9e | educatedpolarbear/MyContest | 2/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
long long n, k;
cin >> n >> k;
if(n >= k) {
if(n % k == 0) cout << "1\n";
else cout << "2" << endl;
}
else
if(k % n == 0) cout << k / n << endl;
else cout << k / n + 1 << endl;
}
}
| ALGO | 0.99978 | 4.210731 |
3eb4440a-cdf4-4191-831b-a7c09e06d297 | cyrex562/Net-Loom | src/mppe.cpp | #include <ppp_opts.h>
#include <cstring>
#include <lwip_status.h>
#include <ccp.h>
#include <mppe.h>
#include <pppdebug.h>
#include <pppcrypt.h>
#include <lcp.h>
#include <ppp.h>
#include "netbuf.h"
#include "mbedtls/arc4.h"
#include "mbedtls/sha1.h"
#include "spdlog/spdlog.h"
constexpr auto SHA1_SIGNATURE_SIZE = 20;
... | TOOL | 0.966737 | 6.05586 |
889dc1ae-8ef0-46f9-94ae-881d5047d99c | chenjiajing0103/LeetCode | Hard/Edit_Distance.cpp | class Solution {
public:
int minDistance(string word1, string word2) {
int n1=word1.size();
int n2=word2.size();
vector<vector<int>> dp(2,vector<int>(n2+1));
int now=0;
int next=1;
for(int i=0;i<=n2;++i) {
dp[now][i]=i;
}
for(int i=1;i<=n1;... | ALGO | 0.999999 | 5.832449 |
0dcbaf55-844f-4613-94b7-bb80e1d58c0a | vijayraikar1999/Coding-Ninjas-Data-Structures-and-Algorithms-Course-Completion | 04_Binary_Trees/01_print_tree_level_wise_solution.cpp | /**********************************************************
Following is the Binary Tree Node class structure
template <typename T>
class BinaryTreeNode {
public :
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this -> data = data;
l... | ALGO | 0.999676 | 4.845482 |
3442e2fd-0824-494a-ae16-97ce58a4c661 | devkev/bsonview | src/third_party/mozjs-60/extract/js/src/jsutil.cpp | /* Various JS utility functions. */
#include "jsutil.h"
#include "mozilla/Assertions.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Maybe.h"
#include "mozilla/PodOperations.h"
#include "mozilla/ThreadLocal.h"
#include <stdio.h>
#include "jstypes.h"
#include "js/Utility.h"
#include "util/Windows.h"
#inclu... | TOOL | 0.901063 | 7.63196 |
354e7a76-972a-43dc-a1fd-dc25b84ac5b1 | MaxDrob/ITMO-CPP-labs | Lab9Ctrl1/Lab9Ctrl1.cpp | #include <iostream>
#include "Triangle.h"
using namespace std;
int main()
{
int a;
int b;
int c;
cout << "Type triangle sides' length ehre " << endl;
cout << "Side A: ";
cin >> a;
cout << "Side B: ";
cin >> b;
cout << "Side C: ";
cin >> c;
Triangle t(a, b, c);
try
{
double s = t.Triangle::findSquare(... | ALGO | 0.873582 | 3.970066 |
54cd6fc5-0e42-416f-bba9-fab88d25443d | ahishHB/algorithms | algorithms/cpp/primsAlgorithm.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
vector<vector<int>> prims(vector<vector<int>> graph){
vector<vector<int>> ngraph(graph.size(),vector<int>(graph[0].size(),7777));
vector<int>visited = {0};
int mini,minj,temp;
... | ALGO | 0.99997 | 4.401642 |
0f65b8bd-a0e2-4c6f-8877-9d0c760fb3ce | jovinlidan/competitive-programming | CodeForces/GNU C++17/1027A | Palindromic Twist/70839856.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int tc;
cin >> tc;
while(tc--)
{
int n;
string s;
cin >> n >> s;
int left = 0, right = n-1;
bool isYes = true;
while(left < right)
{
if(abs(s[left] - s[right]) > 2 || abs(s[left] - s[right]) == 1)
{
isYes = false;
break;
}
... | ALGO | 0.999874 | 4.775443 |
cefab500-4b09-4cbe-afea-67110e90a48e | Snowstorm0/LeetCode | 0084柱状图中最大的矩形.cpp |
//84. 柱状图中最大的矩形
//给定 n 个非负整数,用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 1 。
//求在该柱状图中,能够勾勒出来的矩形的最大面积。
//以上是柱状图的示例,其中每个柱子的宽度为 1,给定的高度为[2, 1, 5, 6, 2, 3]。
//图中阴影部分为所能勾勒出的最大矩形面积,其面积为 10 个单位。
//示例 :
//输入: [2, 1, 5, 6, 2, 3]
//输出 : 10
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <queue>
#include <iostream>
#inclu... | ALGO | 0.999938 | 5.395675 |
29111dcd-ec3b-46fc-bdb8-d61fa1f6c1f2 | hossaintaufiq/NSUPS-Season-20 | AN - To Carry or not to Carry.cpp | #include <iostream>
using namespace std;
int main() {
unsigned int a, b;
// Read input until EOF
while (cin >> a >> b) {
// Perform bitwise addition (XOR) since carry is ignored
unsigned int result = a ^ b;
cout << result << endl;
}
return 0;
}
| ALGO | 0.999782 | 5.863861 |
87394d61-7bd2-4e1c-9aff-55ee20fc7c2b | superQCman/Chiplet_Heterogeneous_newVersion_old | gpgpu-sim/src/intersim2/arbiters/tree_arb.cpp | // $Id: tree_arb.cpp 5188 2012-08-30 00:31:31Z dub $
// ----------------------------------------------------------------------
//
// TreeArbiter
//
// ----------------------------------------------------------------------
#include "tree_arb.hpp"
#include <iostream>
#include <sstream>
using namespace std ;
TreeArbi... | ALGO | 0.980585 | 5.641382 |
6921d0c1-8284-447b-a546-42552bba8b8f | electro1rage/Problems_Solved_2016 | Problems_2016/LiveArchive_3278.cpp | /*
reality, be rent!
synapse, break!
Van!shment Th!s World !!
*/
#include <bits/stdc++.h>
using namespace std;
const int MN = 20, MM = 11;
int mask[MM], sz[MM], val[MM];
int cover[MN], bestans, bestmask;
void get_ans(int i, int curmask, int rem, const int n, const int t) {
if (i == n) {
if (rem != 0) return ;
i... | ALGO | 0.999573 | 4.101383 |
2ad6ef60-b060-4f29-a163-2234a85fd815 | sameerbairwa/interviewQuestions | Dynamic Programming/LIS.cpp | #include <iostream>
using namespace std;
int lis(int *input, int n)
{
int *output = new int[n];
output[0] = 1;
for (int i = 1; i < n; i++)
{
output[i] = 1;
for (int j = i - 1; j >= 0; j--)
{
if (input[j] >= input[i])
{
continue;
... | ALGO | 0.999969 | 4.637749 |
7122e3b6-898f-454f-8920-f1dd978e0310 | tung2389/HSGS-Olympiad-code | LIQ.cpp | #include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
int n,LIS[20000],a[20000],ans=0;
cin >> n;
for(int i=1;i<=n;i++)
cin >> a[i];
for(int i=1;i<=n;i++)
{
LIS[i]=1;
for(int j=1;j<=i;j++)
{
if(a[i]>a[j]) LIS[i]=max(LIS[i],LIS[j]+1);
}
if(LIS[i]>ans)
ans=LIS[i];
}
cout << ans;
... | ALGO | 0.999943 | 3.702781 |
7b8ab15c-c82a-4e1c-a319-e3595314f3d7 | Pugipug/liceu | Fisiere/1.cpp | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
// se citesc 3 numere intregi din fisierul numar.in . Sa se afiseze suma si produsul lor pe ecran.
int a,b,c;
ifstream f("numar.in");
f>>a>>b>>c;
cout << "Suma numerelor este " << a+b+c;
cout << endl << "Produsul este " ... | TOOL | 0.968241 | 3.510672 |
2e465ce1-2428-4f46-8ad1-f444b717a5be | mireed/LeetCode | 88/88.cpp | /*leetcode 88. Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.
Note:
The number of elements initialized in nums1 and nums2 are m and n respectively.
You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional ele... | ALGO | 0.999975 | 5.555037 |
b4846a9f-ce9a-4d9b-a901-61fbe4083210 | Siddanagowda/leet-code-solutions | KthLevelSum.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.999979 | 6.558112 |
244e786e-8d34-4e80-b219-993d75dcdcec | Ritesh-Saindane/Competitive-Programming-Training | CSES Problem Set/Introductory Problems/Trailing Zeros.cpp | #include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
ll solve(ll n) {
ll res = 0;
for (ll i = 5; i <= n; i *= 5) {
res += n / i;
}
return res;
}
void input() {
ll n; cin >> n;
cout << solve(n);
}
int main() {
input();
return 0;
}
| ALGO | 0.999749 | 4.432252 |
8bf2a492-2434-4524-b5a3-a1793d7f9cfb | masonhorne/Kattis-Solutions | src/sorttwonumbers.cpp | #include<iostream>
using namespace std;
/////////////////////////////////////////////////////////////
// Problem: https://open.kattis.com/problems/sorttwonumbers /
/////////////////////////////////////////////////////////////
int main() {
// Read in x and y
int x, y; cin >> x >> y;
// If x is smaller outp... | ALGO | 0.999943 | 5.700558 |
8a78d0f1-fb39-4704-954c-9c5be1aa985d | Isma1108/IDI_FIB | entregables/Exercici-2-Lab-2223Q2/Exercici-2/Model/model.cpp | #define __MODEL__DEF__ 1
#include "model.h"
#include <fstream>
#include <sstream>
#include <iostream>
#include <cmath>
#include <cassert>
using namespace std;
// === Local stuff:
static int material = 1;
static void loadMTL(std::string filename);
static int findMat(string material);
static void omplenormals(vector<Face... | TOOL | 0.876624 | 5.094295 |
89939169-a32a-4d05-8ea6-6608a15c0e73 | Soyab-Aktar/DSA-Supreme-2.0 | 10 Linked List/Class 3/reverceLL.cpp | #include <iostream>
using namespace std;
class node
{
public:
int data;
node *next;
node()
{
this->next = NULL;
}
node(int data)
{
this->data = data;
this->next = NULL;
}
};
int printll(node *head)
{
node *temp = head;
while (temp != NULL)
{
c... | ALGO | 0.99995 | 4.91806 |
6c492a5f-177c-4081-8889-53098ff9c2dd | gioele-bernardini/essential-MLP | src/utils/MultiplyMatrix.cpp | #include "utils/MultiplyMatrix.hpp"
utils::MultiplyMatrix::MultiplyMatrix(Matrix* a, Matrix* b) {
this->a = a;
this->b = b;
if (a->getNumCols() != b->getNumRows()) {
cerr << "A_rows: " << a->getNumCols() << " != B_cols: " << b->getNumRows() << endl;
assert(false);
}
this->c = new Matrix(a->getNumR... | ALGO | 0.929054 | 4.685362 |
5359f570-cf68-44fd-8859-048532b3f14b | SAY-droid427/DSAQuestions | Solutions/LeetCode Problem Sheet/longest-palindromic-substring/longest-palindromic-substring.cpp | class Solution {
public:
string substring(string s, int low, int high)
{
string x = "";
for(int i = low;i<=high;i++)
x += s[i];
return x;
}
string longestPalindrome(string s) {
int n = s.size();
bool table[n][n];
memset(table,0,sizeof... | ALGO | 0.999972 | 5.513574 |
87af6e6c-23e0-47c1-ade5-56541e6e3db7 | mayank171/leetcode | Find kth element of spiral matrix - GFG/find-kth-element-of-spiral-matrix.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
#define MAX 1000
// } Driver Code Ends
class Solution
{
public:
/*You are required to complete this method*/
int findK(int a[MAX][MAX],int n,int m,int k)
{
if(k>n*m)
return 0;
int dx[4]={0,1,0,-1};
int ... | ALGO | 0.999925 | 5.336798 |
6ea683f6-5838-41ab-a005-fbd8b968f0b9 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_8054_0.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = 1e3 + 7;
const int mod = 1e9 + 7;
const int INF = 1e9 + 7;
const int iv2 = 5e8 + 4;
inline int pls(int x, int y) { return (x + y) % mod; }
inline int mns(int x, int y) { return pls(x, mod - y); }
inline int mul(int x, int y) { return 1LL * x * y % mod; }
in... | ALGO | 0.999981 | 3.638542 |
72882592-17f7-487f-9552-0592a10d1057 | huangallen2008/cppcode | code/CSacademy/sum-of-squares/sum-of-squares.cpp | #include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops,fast-math")
// #pragma GCC target("avx2,sse4,bmi,popcnt")
#define int long long
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<=(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define RREP1(i,n) for(int i=(n... | ALGO | 0.999994 | 4.517742 |
614aef22-18b1-4f0c-b49e-c78e939d9f80 | archit-1997/codeforces | solved_problems/165C.cpp | /*A string is binary, if it consists only of characters "0" and "1".
String v is a substring of string w if it has a non-zero length and can be read
starting from some position in string w. For example, string "010" has six
substrings: "0", "1", "0", "01", "10", "010". Two substrings are considered
different if their ... | ALGO | 0.999976 | 5.425902 |
7f910b9e-a066-4f31-8407-8b3fcf52d3e2 | junhwan26/PS | 유닛 스터디/DP(1)/2 x n 타일링.cpp | #include<iostream>
int save[1001];
using namespace std;
int f(int n){
if(n==1)
return 1;
if (n==2)
return 2;
if(!save[n])
save[n]=f(n-1)+f(n-2);
return save[n]%10007;
}
int main(){
int n;
cin>>n;
cout<<f(n);
}
| ALGO | 0.999813 | 4.4671 |
c20f29d7-4770-4bcb-bf00-d7c0d66239c6 | deanw03/Software-Design | Assignment-1/palindrome_number.cpp | /*
This program reads an integer from the user and checks if it is a palindrome.
This will be done by:
1) Storing the original input to compare it later.
2) Reversing the digits of the input by:
- Using the modulo operation(%) to isolate the last digit of the input(num).
- Adding these isolated digits to a var... | ALGO | 0.998564 | 5.349846 |
42949d3b-7f85-491d-8d98-65186c26ebe4 | aarushi-1601/GFG | Medium/Detect cycle in a directed graph/detect-cycle-in-a-directed-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to detect cycle in a directed graph.
bool isCyclic(int V, vector<int> adj[]) {
// code here
int indegree[V]={0};
for(int i=0;i<V;i++)
{
for(auto it:... | ALGO | 0.999769 | 6.489458 |
5855fb54-8bb4-468d-b7b9-740e61fef01e | lEEExp3rt/Leetcode-Exercises | ans/108.cpp | /**
* @brief 108 - Convert Sorted Array to Binary Search Tree
* @link https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/
* @author !EEExp3rt
* @date 2025-03-14
* @note 参考评论区,原来直接递归构造就好了
* @note 二编:参考了官方题解,这样基于有序的数组的中序遍历直接构造二叉树是必然平衡的,至于证明过程,我也不会
*/
#include <bits/stdc++.h>
using namespace s... | ALGO | 0.999999 | 6.898761 |
1a591832-03b8-4d0a-a1f8-4279c6d0214a | KZeroMin/Code | 알고리즘 구현/Dynamic_Greedy_구현.cpp | #include <iostream>
#include <iomanip>
#include <sys/time.h>
#include <algorithm>
#include <chrono>
using namespace std;
int seed = 408;
//job구조체 선언
struct Job{
int start_time;
int end_time;
};
//두개의 job의 위치를 바꿀 swap함수
void swap(Job *job1, Job *job2){
Job temp;
temp = *job1;
*job1 = *job2;
*j... | ALGO | 0.999525 | 4.83951 |
0d21d44a-dc64-4310-911f-7fea2872e90a | 12301098-Heminghui/LeetCode-Cpp | jianzhioffer/bigo.cpp | // 翻转链表
class Solution {
public:
bool ishuiwen(ListNode* head) {
if(!head){
return true;
}
int cnt = 0;
ListNode* node = head;
while(node){
node = node->next;
cnt ++;
}
ListNode* left = NULL;
ListNode* pre = head;
... | ALGO | 0.999951 | 5.113523 |
bf951211-4dd8-4cbb-8a5a-03d2767a3c6a | Basu0069/C-plus--learning | heap/08.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int sum;
vector<int>v;
for(int i=0;i<n;i++){
int element;
cin>>element;
v.push_back(element);
}
priority_queue<int , vector<int> , greater<int>>min_heap(v.begin() , v.end());
// for(int i=0;... | ALGO | 0.999942 | 3.951127 |
2f9e1c5b-1635-4e61-9b26-05a8afb0e78d | Kishii/Dev | dep/tbb/src/tbb/spin_rw_mutex.cpp | #include "tbb/spin_rw_mutex.h"
#include "tbb/tbb_machine.h"
#include "itt_notify.h"
#if defined(_MSC_VER) && defined(_Wp64)
// Workaround for overzealous compiler warnings in /Wp64 mode
#pragma warning (disable: 4244)
#endif
namespace tbb {
template<typename T> // a template can work with private spin_rw_mut... | TOOL | 0.935921 | 7.222482 |
40af5d94-7b62-4bbe-b69e-ec6ded4e9c80 | halogenOS/android_packages_apps_OTAUpdates | jni/boost_1_57_0/libs/spirit/example/x3/calc2.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A Calculator example demonstrating the grammar and semantic actions
// using lambda functions. The parser prints code suitable for a stack
// based virtual machine.
//
// [ JDG May 10, 2002 ] spirit 1
// [ JDG March 4, 200... | TOOL | 0.897152 | 7.71154 |
52d6b0a9-bca2-44ff-8485-3f4ffb7f172a | kaushiki2024/C-plus-plus | without_extra_arrayc.cpp | #include<iostream>
int main(){
int a[]={1,2,3,4};
int n=sizeof(a)/4;
int i=0;
int j=n-1;
while(i<j){
int temp=a[i];
a[i]=a[j];
a[j]=temp;
i++;
j--;
}
std::cout<<"\n";
for(i=0;i<=n-1;i++){
std::cout<<a[i]<<" ";
}
} | ALGO | 0.999557 | 3.218674 |
d5e9d6f8-ef1b-43a1-ab5d-4d1c862d767b | bentoper/Competitive | Contests/ED92/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define pv(x, n) fr(iii, n) printf("%d%c", x[iii], " \n"[iii==n-1])
#define pvv(x, n) frr(iii, n) printf("%d%c... | ALGO | 0.999902 | 4.036054 |
fbb9b05d-20db-42ca-8931-62edf748a715 | Ananda-01/Introduction-to-C-plus-plus | Module5_27_05/string_iterator.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
// syntax of string iterator
// string::iterator it;
cin>>s;
// for(int i=0;i<s.size();i++)
// {
// cout<<s[i]<<endl;
// }
// cout<<*s.begin()<<endl;
// cout<<*s.end()<<endl;
// cout<<*(s.end()-1)<<endl... | ALGO | 0.939726 | 3.642802 |
5e043c62-1383-4769-80f6-4bd30452e79a | DarlingInSteam/hirschberg-method | main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
/**
* @brief Функция для вычисления длины LCS (наибольшей общей подпоследовательности) двух строк
* с использованием памяти только для двух строк.
*
* @param X Первая строка.
* @param Y Вторая строка.
* @ret... | ALGO | 0.999964 | 5.706388 |
cfd21df0-adab-4b8b-b334-a6b4d5eeb606 | face4/yukicoder | Level1/0405.cpp | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
vector<string> x = {"I", "II", "III", "IIII", "V", "VI",
"VII", "VIII", "IX", "X", "XI" , "XII"};
string s;
int now, elapse;
cin >> s >> elapse;
for(int i = 0; i < 12; i++){
if(s ==... | ALGO | 0.999786 | 3.365215 |
1b12a8de-ef47-410a-8ff4-9886f868d411 | FiredPhoenixIR/CPP_Practices | SecondMinInArray.cpp | //#include<iostream>
//using namespace std;
//
//int secondMinimum(int arr[], int size) {
//
// int min = 214748364;
// int secondmin = 214748364;
//
// for (int i = 0; i < size; i++) {
// if (arr[i] < min) {
// secondmin = min;
// min = arr[i];
// }
// else if (arr[i... | ALGO | 0.999581 | 4.175753 |
0e3c0e69-e968-4a84-bc82-5addc5747b05 | miracle0609/miracle | haizeioj入门组/136.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 7; i <= n; i += 7) {
cout << i << endl;
}
return 0;
}
| ALGO | 0.998036 | 3.273719 |
cf3b16d9-8277-4b8e-a65f-1920cd02d527 | pmkosela/podstawy_programowania_23-24 | gr1/lab5/zadanie5/main.cpp | #include <iostream>
void function(float a, int & outFloor, float & outFraction)
{
outFloor = (int)a;
outFraction = a - outFloor;
}
int main()
{
float a, czescUlamkowa;
int podloga;
std::cin >> a;
function(a, podloga, czescUlamkowa);
std::cout << podloga << " " << czescUlamkowa;
return... | ALGO | 0.974623 | 4.263475 |
2327bc77-476c-492d-af69-9d56abda1d85 | WLBF/OJ | CODE/bfs/8_numbers.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<bitset>
using namespace std;
int goalStatus;
bitset<362880> Flags;
const int MAXS = 400000;
char result[MAXS];
struct Node{
int status;
int father;
char move;
Node(int s, int f, char m):status(s),father(f),move(m){}
Node(){}
};
Node my... | ALGO | 0.999968 | 4.895034 |
c9bc3167-baa2-44c2-b949-106c80e683a8 | rpuntaie/c-examples | cpp/container_vector_swap2.cpp | /*
g++ --std=c++20 -pthread -o ../_build/cpp/container_vector_swap2.exe ./cpp/container_vector_swap2.cpp && (cd ../_build/cpp/;./container_vector_swap2.exe)
https://en.cppreference.com/w/cpp/container/vector/swap2
*/
#include <algorithm>
#include <iostream>
#include <vector>
int main()
{
std::vector<int> alice{1, 2... | ALGO | 0.991012 | 5.776229 |
36bfe5f6-fb74-41ff-ba05-a5de7b5661f4 | pnkjshahare/DSA | String/isCircle.cpp | #include <bits/stdc++.h>
using namespace std;
bool isCircle(vector<string> arr)
{
vector<char> firstIndex;
vector<char> lastIndex;
for (int i = 0; i < arr.size(); i++)
{
string demo = arr[i];
int n = demo.size();
firstIndex.push_back(demo[0]);
lastIndex.push_back(demo[n -... | ALGO | 0.999626 | 4.314209 |
68bfd3eb-b0dd-4a1f-a42b-479b3a49da57 | nguyenhoangkhoi06011/Bai2_Cong2so1 | Bai2_Cong2so1.cpp | #include <iostream>
using namespace std;
int main() {
cout << "CHUONG TRINH TINH TOAN TRONG HAI SO" << endl;
int so1, so2; //khai bao bien so1 va so2 kieu so nguyen
int tong;
so1 = 3; // gan bien so1 voi gia tri 3
so2 = 9;
tong = so1 + so2;
cout << "tong hai so:" << so1 << "+" << so2 << "=" << tong;
return 0;... | TOOL | 0.969349 | 3.207097 |
e53bddd9-a591-4865-963f-7719a852bde7 | haoran0709/Mycode | luogu/P5660-CSP-J-2019-shuziyouxi.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int ans=0;
for (int i=0;i<s.length();i++) if (s[i]=='1') ans++;
cout<<ans<<endl;
return 0;
} | ALGO | 0.999911 | 4.457564 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.