text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; struct Event { char r; int pos; Event(char r = , int pos = -1) : r(r), pos(pos) {} }; bool operator<(Event a, Event b) { if (a.r != b.r) return a.r > b.r; return a.pos < b.pos; } vector<Event> v; int main() { string s; cin >> s; ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int INF = 1000000000; const long long LINF = 1e17; const double PI = 3.141592653589793238; const int mod = 1000000007; const double eps = 0.000001; template <typename T, typename TT> ostream &operator<<(ostream &s, pair<T, TT> t) { return s << ( ... |
#include <bits/stdc++.h> using namespace std; int main() { long long int n, sx, sy, x, y; cin >> n >> sx >> sy; vector<pair<long long int, long long int> > v; v.push_back({sx, sy + 1}); v.push_back({sx, sy - 1}); v.push_back({sx + 1, sy}); v.push_back({sx - 1, sy}); vector<long long ... |
/*
* Copyright (C) 2015 Harmon Instruments, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e6 + 10; const int MM = 1e9 + 7; void pts(int x, int y, int z) { printf( 3 %d %d %d n , x, y, z); } void pts(int w, int x, int y, int z) { printf( 4 %d %d %d %d n , w, x, y, z); } void gao(int n) { if (n == 3) { pts(1, 2, 3); pt... |
//*****************************************************************************
// (c) Copyright 2008 - 2010 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
/... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// =============================================================================
// COPYRIGHT NOTICE
// Copyright 2006 (c) Lattice Semiconductor Corporation
// ALL RIGHTS RESERVED
// This confidential and proprietary software may be used only as authorised by
// a licensing agreement from Latt... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
//Legal Notice: (C)2006 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associated... |
#include <bits/stdc++.h> using namespace std; const long long len = 40; long long n, next_free = 0; long long a[2][200500 * len]; void add(long long x) { vector<long long> b; long long i; for (i = 0; i < len; i++) { long long last = x % 2; b.push_back(last); x /= 2; } rev... |
#include <bits/stdc++.h> using namespace std; int main() { int n, m; scanf( %d%d , &n, &m); int l = (n - 1) / m; if ((n - 1) % m == 0) printf( %d n , 2 * l); else printf( %d n , 2 * l + 1 + ((n - 1) % m >= 2)); int need = (n - 1) % m; for (int i = 2; i <= n;) { int maxn... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while (t--) { int s, n; cin >> s >> n; int temp = s, p = 1; while (temp > 0) { temp /= 10; p *= 10; } p /= 10; wh... |
#include <bits/stdc++.h> using namespace std; int main() { int sum; cin >> sum; int a, b, c = -1; for (int i = 0; i * 7 <= sum; i++) { if ((sum - i * 7) % 4 == 0) { int j = (sum - i * 7) / 4; if (c == -1 || i + j < c) { c = i + j; a = j; b = i; ... |
`define ADDER_WIDTH 064
`define DUMMY_WIDTH 128
`define 3_LEVEL_ADDER
module adder_tree_top (
clk,
isum0_0_0_0, isum0_0_0_1, isum0_0_1_0, isum0_0_1_1, isum0_1_0_0, isum0_1_0_1, isum0_1_1_0, isum0_1_1_1,
sum,
);
input clk;
input [`ADDER_WIDTH+0-1:0] isum0_0_0_0, isum0_0_0_1, isum0_0_1_0, isum0_0_1_1, isum0_1_0_0,... |
#include <bits/stdc++.h> using namespace std; int main() { char a[200005]; cin >> a; for (int i = 0; a[i] != 0 ; ++i) { if (i && a[i - 1] == a[i]) { if (a[i - 1] != x && a[i + 1] != x ) a[i] = x ; else if (a[i - 1] != y && a[i + 1] != y ) a[i] = y ; ... |
/**
* bsg_mux_butterfly.v
*
* @author tommy
*
* This module has stages of mux which interleaves input data.
* Output data width is same as the input data width.
* The unit of swapping increases in higher stage.
*
* The lowest order bit swaps odd and even words
* the highest order bit swaps the upper ha... |
#include <bits/stdc++.h> using namespace std; const int Maxn = 1009; pair<int, pair<int, int> > sr[Maxn * Maxn]; int n, m; int check(int k) { bitset<Maxn> row[Maxn]; for (int i = 0; i <= k; i++) { int x = sr[i].second.first, y = sr[i].second.second; row[x].set(y); } for (int i = 0;... |
#include <bits/stdc++.h> using namespace std; char s[500][500]; int di[4] = {-1, 1, 0, 0}; int dj[4] = {0, 0, -1, 1}; typedef int int2d[500][500]; int2d p[26]; int2d d; struct Pos { int r, c; Pos(int r = 0, int c = 0) : r(r), c(c) {} void init(int r, int c) { this->r = r; this->c... |
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/unisims/BUFGP.v,v 1.6 2007/05/23 21:43:33 patrickp Exp $
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2004 Xilinx, Inc.
// All Right Reserved.
/////////////////////////////////////////////////... |
#include <bits/stdc++.h> using namespace std; const long double PI = acos(-1); vector<complex<double> > fft(const vector<complex<double> >& as) { int n = (int)as.size(); int k = 0; while ((1 << k) < n) k++; vector<int> r(n); r[0] = 0; int h = -1; for (int i = 1; i < n; i++) { if ... |
//Legal Notice: (C)2017 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associated do... |
/*
* MBus Copyright 2015 Regents of the University of Michigan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... |
#include <bits/stdc++.h> #pragma GCC optimize( O3 ) #pragma GCC optimize( unroll-loops ) #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native ) using namespace std; const long long mod = 1000000007; const int mxN = 100010; vector<int> g[mxN]; int main(int argc, char** argv) { ... |
#include <bits/stdc++.h> using namespace std; long n, k, iters, p[10000], q[1000], rp[1000], ar[200000], ar1[20000]; long ans; bool not_same() { for (int i = 1; i <= n; i++) if (ar[i] != q[i]) return true; return false; } int main() { ios_base::sync_with_stdio(0); cin >> n >> k; fo... |
// nios_solo_nios2_gen2_0.v
// This file was auto-generated from altera_nios2_hw.tcl. If you edit it your changes
// will probably be lost.
//
// Generated using ACDS version 15.1 185
`timescale 1 ps / 1 ps
module nios_solo_nios2_gen2_0 (
input wire clk, // ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 13:33:36 01/02/2014
// Design Name:
// Module Name: qmults
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependen... |
#include <bits/stdc++.h> using namespace std; int main() { int n, i = 0; string a, b; vector<pair<string, string> > vec; cin >> n; while (n--) { cin >> a >> b; vec.push_back(make_pair(a, b)); } n = 0; sort(vec.begin(), vec.end()); while (i < vec.size()) { n++; ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long s[n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> s[i][j]; } } long long ans = sqrt((long long)((s[0][1] * s[0][2]) / s[1][2])); cout << ans; for (int i... |
`timescale 1ns / 1ps
/*
Copyright 2015, Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... |
// Copyright (C) 2020-2021 The SymbiFlow Authors.
//
// Use of this source code is governed by a ISC-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/ISC
//
// SPDX-License-Identifier:ISC
(* blackbox *)
module qlal4s3_mult_32x32_cell (
input [31:0] Amult,
input ... |
#include <bits/stdc++.h> using namespace std; bool solve(vector<int> ps, vector<int> v) { if (ps.empty()) return v[0] == 0; int n = v.size(); vector<int> nps(ps.begin() + 1, ps.end()); vector<vector<int> > g(ps[0], vector<int>(n / ps[0])); bool ans = true; for (int i = 0; i < n; ++i) { ... |
#include <bits/stdc++.h> using namespace std; vector<int> v[188]; int dist[188][188]; int n, m; int dp[188][188]; int best[188]; void dfs(int x, int p) { for (int i = 0; i < v[x].size(); i++) { int t = v[x][i]; if (t != p) dfs(t, x); } best[x] = 1; for (int c = 1; c <= n; c++) ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; bool isLeaf[100001] = {0}; bool isCorrect[100001] = {0}; bool nowCorrect[100001] = {0}; bool allVisited[100001] = {0}; bool visited = false; vector<int> solution; vector<vector<int> > old_pony_ville, pony_ville; bool dfs(int nodo) { if (!isLeaf[nodo]) ... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// a... |
// (C) 1992-2014 Altera Corporation. All rights reserved.
// Your use of Altera Corporation's design tools, logic functions and other
// software and tools, and its AMPP partner logic functions, and any output
// files any of the foregoing (including device programming or simulati... |
#include <bits/stdc++.h> using namespace std; const int N = 404040; int cnt, cnt2, cnt3, h, n, m; struct Node { int x, y, w, d, i; } a[N]; bool cmp(Node x, Node y) { return x.d < y.d; } vector<int> s[N]; vector<pair<int, int> > ss[N]; int dfn[N], low[N], viss[N], q[N], color[N], as[N]; map<int, ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, p, k; long long a, ans = 0; map<long long, long long> mp; scanf( %d %d %d , &n, &p, &k); for (int i = 0; i < n; i++) { scanf( %lld , &a); ans += mp[((((a * a) % p) * ((a * a) % p)) % p - (k * a) % p + p) % p]++; } ... |
#include <bits/stdc++.h> int main() { int a, b, c, d; while (scanf( %d%d%d%d , &a, &b, &c, &d) == 4) { if (c >= b - 1 && c <= 2 * (b + 1)) { printf( YES n ); continue; } if (d >= a - 1 && d <= 2 * (a + 1)) { printf( YES n ); continue; } printf( NO ... |
#include <bits/stdc++.h> int main() { int n; scanf( %d , &n); double exp, ans, pi; exp = ans = 0.0; for (int i = 0; i < n; i++) { scanf( %lf , &pi); exp = exp * pi + pi; ans = ans + 2 * exp - pi; } printf( %.12lf n , ans); return 0; } |
#include <bits/stdc++.h> int main() { int x, count = 0, i; char ar[50]; for (i = 0; i < 9; i++) scanf( %c , &ar[i]); for (i = 0; i < 9; i++) { if (ar[i] == ar[8 - i]) count++; } if (count == 9) printf( YES ); else printf( NO ); } |
// ***************************************************************************
// ***************************************************************************
// Copyright 2014(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are... |
// megafunction wizard: %FIFO%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: dcfifo
// ============================================================
// File Name: FIFO_READ.v
// Megafunction Name(s):
// dcfifo
//
// Simulation Library Files(s):
// altera_mf
// =============================... |
module ControlCore(
input confirmation, continue_button, mode_flag,
input [6 : 0] ID,
output reg enable, allow_write_on_memory, should_fill_channel_b_with_offset,
output reg is_input, is_output,
output reg [2 : 0] control_channel_B_sign_extend_unit, control_load_sign_extend_unit,
output reg [2 :... |
#include <bits/stdc++.h> using namespace std; char s[200010], p[200010]; int a[200010], n, t; bool ok(int len) { int i = 1, j = 1; while (i <= n) { if (a[i] <= len) { i++; continue; } if (s[i] == p[j]) { i++; j++; } else { i++; } ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
`timescale 1ns / 1ps
// synopsys template
module aes_1cc
(
clk,
rst,
g_input,
e_input,
o
);
localparam NR = 10;
input clk;
input rst;
input [127:0] g_input; // key
input [127:0] e_input; // message
output [127:0] o;
wire [127:0] ... |
#include <iostream> #include <string> #include <vector> constexpr int N = 1000005; constexpr int p = 1000000007; inline int add(int x, int y) { return (x += y) >= p ? x - p : x; } inline int sub(int x, int y) { return (x -= y) < 0 ? x + p : x; } inline int mul(int x, int y) { return (long long)x * y... |
#include <bits/stdc++.h> int main(void) { static unsigned char mas[125 * 1000000], mas1[125 * 1000000]; int n, m, mas2[200000], x, rez = 0, last1 = 0, last2 = 1; scanf( %d %d , &n, &m); for (int i = 0; i < ceil(m / 8.0); i++) { mas[i] = 0; mas1[i] = 0; } int samechet = 0, sameneche... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 5 * 100 * 1000 + 13; queue<int> bfsq; set<int> bfsS; set<pair<int, int> > forbid; vector<int> compV[MAXN], toDel; int main() { ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); int n, m; cin >> n >> m; for (int i = 1; ... |
#include <bits/stdc++.h> using namespace std; const int M = 1000005; int read() { int x = 0, f = 1; char c; while ((c = getchar()) < 0 || c > 9 ) { if (c == - ) f = -1; } while (c >= 0 && c <= 9 ) { x = (x << 3) + (x << 1) + (c ^ 48); c = getchar(); } return x ... |
#include <bits/stdc++.h> using namespace std; char alphz[27] = { a , b , c , d , e , f , g , h , i , j , k , l , m , n , o , p , q , r , s , t , u , v , w , x , y , z }; float Euclidean(long long x1, long long x2, long long y1, long long y2) { r... |
#include <bits/stdc++.h> using namespace std; void sprint(string s) { for (int i = 0; i < s.size(); ++i) printf( %c , s[i]); printf( n ); } int main() { int n, k, d; cin >> n >> k >> d; int a[n]; int b[n]; for (int i = 0; i < n; ++i) { scanf( %d , &a[i]); b[i] = 0; }... |
#include <bits/stdc++.h> using namespace std; const int mN = 30; int a[mN]; int n; void output(int x) { string s; string mid; for (int i = 1; i <= n; i++) { if (a[i] / x % 2) mid += char(i + a - 1); for (int j = 1; j <= a[i] / x / 2; j++) s += char(i + a - 1); } s += mid; ... |
#include <bits/stdc++.h> template <class T> inline void read(T &x) { x = 0; int f = 0; char ch = getchar(); while (!isdigit(ch)) { f |= ch == - ; ch = getchar(); } while (isdigit(ch)) { x = (x << 1) + (x << 3) + (ch ^ 48); ch = getchar(); } x = f ? -x : x; ... |
#include <bits/stdc++.h> using namespace std; int main() { int i; string s; cin >> s; int right = s.size() - 1; int left = 0; vector<int> ans; ans.resize(s.size()); for ((i) = (0); (i) < (int)(s.size()); (i)++) { if (s[i] == l ) { ans[right] = i + 1; right--; ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> #pragma warning(disable : 4996) using namespace std; const long double EPS = 1e-9; vector<vector<int>> g; vector<vector<int>> hlca; vector<vector<int>> lca; vector<vector<long long>> dp; int N; int get_num_bit(int mask) { int cnt = 0; while (mask) { cnt += mask &... |
#include <bits/stdc++.h> using namespace std; const int MAX_N = 2e5 + 10; struct Edge { int u, v, cost, idx; bool operator<(const Edge& rhs) const { return cost < rhs.cost; } } ed[MAX_N]; inline bool cmp_idx(const Edge& lhs, const Edge& rhs) { return lhs.idx < rhs.idx; } map<pair<int, int>, in... |
#include <bits/stdc++.h> using namespace std; int n, m, A, B, scc[75], tot[75], fa[75], ans[75], f[75][1 << 16]; int c, To[405], nxt[405], cst[405], Head[75]; bool vis[75][1 << 16]; inline int Read() { int x = 0, f = 1; char ch = getchar(); while (ch < 48 || ch > 57) { if (ch == - ) f = -1;... |
#include <bits/stdc++.h> using namespace std; const long double pi = 3.1415926535897932384626433832795l; template <typename T> inline auto sqr(T x) -> decltype(x * x) { return x * x; } template <typename T1, typename T2> inline bool umx(T1& a, T2 b) { if (a < b) { a = b; return 1; ... |
#include <bits/stdc++.h> using namespace std; vector<string> vec_splitter(string s) { for (char& c : s) c = c == , ? : c; stringstream ss; ss << s; vector<string> res; for (string z; ss >> z; res.push_back(z)) ; return res; } void debug_out(vector<string> args, int idx) { cer... |
`timescale 1 ns / 1 ps
`include "esaxi_v1_0_tb_include.vh"
// Burst Size Defines
`define BURST_SIZE_4_BYTES 3'b010
// Lock Type Defines
`define LOCK_TYPE_NORMAL 1'b0
// lite_response Type Defines
`define RESPONSE_OKAY 2'b00
`define RESPONSE_EXOKAY 2'b01
`define RESP_BUS_WIDTH 2
`define BURST_TYPE_INCR 2'b01
... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e5; const double EPS = 1e-8; int a[MAXN], b[MAXN]; int n, p; bool f(double T) { double have = p * T; for (int i = 0; i < n; ++i) { if (a[i] * T > b[i] + EPS) have += b[i] - a[i] * T; } return have > 0.0 + EPS; } int ma... |
module unpack_signed #(
parameter N = 64
)
(
input [ 0:M-1] in,
output reg [ N-1: 0] out,
output wire [$clog2(MB)-1: 0] len
);
localparam MB = N/7+1;
localparam M = MB*8;
wire[N-1:0] unsigned_output;
integer i;
reg [MB-1:0] gl, ub, ho, sb;
unpack_unsigned #(.N(N)) u64... |
#include <bits/stdc++.h> using namespace std; long long n, m, b; vector<pair<long long, long long> > v; long long mask[105], cost[105], monitors[105]; long long dp[1 << 21]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> m >> b; for (int i = 0; i <= 100; i++) mask[... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; const double alpha = 0.9; struct Node { int size, key, nodeCount; bool isExist; Node *lc, *rc; unordered_map<int, int> mp; bool isBad() { return lc->nodeCount > alpha * nodeCount + 5 || rc->nodeCount > al... |
#include <bits/stdc++.h> using namespace std; long long modpow(long long b, long long e, long long m) { b %= m; if (e == 0) return 1; if (e % 2 == 1) return (b * modpow(b, e - 1, m)) % m; return modpow((b * b) % m, e / 2, m); } long long powten[1005]; vector<long long> mods; int main() { ... |
#include <bits/stdc++.h> using namespace std; double x[150], y[150], z[150], a = 0, b = 0, c = 0; double dist(double x, double y, double z) { return x * x + y * y + z * z; } int main() { int i, n, ij, j; double bit = 1, t, temp; cin >> n; for (i = 1; i <= n; i++) cin >> x[i] >> y[i] >> z[i]; ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; template <class T> ostream& operator<<(ostream& os, vector<T> V) { for (auto v : V) os << v << ; return cout << ; } template <class T> ostream& operator<<(ostream& os, set<T> S) { for (auto s : S) os << s << ; return cout << ; } tem... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> int main() { int i, n, *a, t, j, flag; long m; scanf( %d , &n); scanf( %ld , &m); a = (int*)calloc(n, sizeof(int)); for (i = 0; i < n; i++) scanf( %d , &a[i]); for (i = 0; i < n; i++) for (j = 0; j < n - i - 1; j++) if (a[j + 1] > a[j]) { t ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int main() { vector<int> ans1; vector<char> ans2; int n1, n2; cin >> n1; vector<int> a1(n1); for (int i = 0; i < n1; i++) { cin >> a1[i]; } cin >> n2; vector<int> a2(n2); for (int i = 0; i < n2; i++) { cin >> a2[i]; ... |
#include <bits/stdc++.h> using namespace std; void solve() { int n, M; cin >> n >> M; vector<char> s(n); int m = M; vector<int> p(m), b(n), yes(n, 0), cnt(26, 0); for (int i = 0; i < n; i++) { cin >> s[i]; cnt[s[i] - a ]++; } for (int i = 0; i < m; i++) { cin >> p[... |
#include <bits/stdc++.h> using namespace std; const long long N = 1e3 + 7; long long dp[N][N][11][2], n, m, k; string s, t; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m >> k >> s >> t; for (long long l = 1; l <= k; l++) { for (long long i = 1;... |
module soc_system (
button_pio_external_connection_export,
clk_clk,
custom_leds_0_leds_leds,
dipsw_pio_external_connection_export,
hps_0_f2h_cold_reset_req_reset_n,
hps_0_f2h_debug_reset_req_reset_n,
hps_0_f2h_stm_hw_events_stm_hwevents,
hps_0_f2h_warm_reset_req_reset_n,
hps_0_h2f_reset_reset_n,
hps_0_hps_io... |
#include <bits/stdc++.h> using namespace std; int N; bool check(int k) { int p = (int)ceil(sqrt(k)); for (int i = 2; i <= p; ++i) if (k % i == 0) return 1; return 0; } int main() { cin >> N; int x = 200, y = x + N; for (;; ++x, ++y) if (check(x) && check(y)) return printf( ... |
#include <bits/stdc++.h> using namespace std; void prepare() { ios_base::sync_with_stdio(0); cin.tie(0); freopen( input.txt , r , stdin); freopen( output.txt , w , stdout); } int main() { long double d, l, v1, v2; cin >> d >> l >> v1 >> v2; long double ans = (l - d) / (v1 + v2); ... |
// (c) Copyright 1995-2017 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using ll = long long; using namespace std; void debugi(vector<int>& vec) { int n = (int)vec.size(); for (int i = 0; i < n; i++) { cout << vec[i] << ; } cout << endl; } void debugl(vector<ll>& vec) { int n = (int)vec.size(); for (int i = 0; i < n; i++) ... |
// megafunction wizard: %ROM: 1-PORT%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: player1.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ================================... |
/*
Copyright (C) 2013 Adapteva, Inc.
Contributed by Andreas Olofsson <>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later vers... |
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2012 *)
(* \VV/ **************************************************************)
(* // * Th... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; const int MAXN = 1e3 + 5; const int INF = 0x3f3f3f3f; const double eps = 1e-9; short int mp[MAXN][MAXN]; int d[MAXN][2]; bool vis[MAXN]; int n, m, s, t, u, v; void dijkstra(int s, int idx) { memset(vis, false, sizeof(vis)); ... |
// -*- verilog -*-
//
// USRP - Universal Software Radio Peripheral
//
// Copyright (C) 2008 Matt Ettus
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 01:44:44 09/29/2016
// Design Name:
// Module Name: ws2812b
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
//... |
/*!
btcminer -- BTCMiner for ZTEX USB-FPGA Modules: HDL code: double hash miner
Copyright (C) 2011 ZTEX GmbH
http://www.ztex.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundat... |
#include <bits/stdc++.h> using namespace std; void imGonnaDoIt() { long long r, x, y, xx, yy; cin >> r >> x >> y >> xx >> yy; cout << ceil(hypot((x - xx), (y - yy)) / (r * 2)); } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); imGonnaDoIt(); return 0; } |
#include <bits/stdc++.h> using namespace std; void solve() { long long a, b, c, d; scanf( %lld %lld %lld %lld , &a, &b, &c, &d); printf( %lld %lld %lld n , b, c, c); } int main() { int t; scanf( %d , &t); while (t--) solve(); } |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n; cin >> n; long long k; cin >> k; long long arr[n + 1]; for (long long i = 1; i <= n; i++) { cin >> arr[i]; } set<long long> s; for (long long i =... |
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; template <class T> using vv = vector<vector<T>>; template <class T> inline bool MX(T &l, const T &r) { return l < r ? l = r, 1 : 0; } template <class T> inline bool MN(T &l... |
#include <bits/stdc++.h> using namespace std; const int N(150010), INF((1 << 30) - 1); int ty, n, k; int yy[4 * N], c1[4 * N], c2[4 * N]; int ord[N], dis[N], ans[N]; struct Point { int x, y; Point() : x(0), y(0) {} Point(int _x, int _y) : x(_x), y(_y) {} void get() { scanf( %d%d , &x, &y); }... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.