text stringlengths 59 71.4k |
|---|
/**
* 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... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2017.4
// Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved.
//
// ==============================================================
`timescale 1 ns / 1 ... |
/*
This block handles the autoincrement needed for bursting and detects
read responses
*/
`include "elink_regmap.v"
module erx_protocol (/*AUTOARG*/
// Outputs
erx_rdwr_access, erx_rr_access, erx_packet,
// Inputs
reset, rx_enable, clk, rx_packet, rx_burst, rx_access
);
parameter AW = 32;
pa... |
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; cout << ((n % 2) ? black : white n1 2 n ) << endl; return 0; } |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int q; cin >> q; for (int k = 0; k < q; ++k) { string s, t; cin >> s >> t; vector<bool> a(26), b(26); for (int i = 0; i < s.size(); ++i) { a[s... |
/*
* Copyright 2013, Homer Hsing <>
*
* 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 law or agreed to ... |
#include <bits/stdc++.h> using namespace std; int k, l; int main() { int i, n; scanf( %d , &n); getchar(); char ch[1000]; scanf( %s , ch); for (i = 0; i < n; ++i) { if (ch[i] == 0 ) k++; else l++; } if (n % 2 == 1 || k != l) { printf( 1 n%s n , ch... |
#include <bits/stdc++.h> using namespace std; int main() { char a; int b; scanf( %c%d , &a, &b); if ((a == a || a == h ) && (b == 1 || b == 8)) printf( 3 n ); else if (a == a || a == h || b == 1 || b == 8) printf( 5 n ); else printf( 8 n ); } |
#include <bits/stdc++.h> using namespace std; int main() { int s, v1, v2, p1, p2; scanf( %d%d%d%d%d , &s, &v1, &v2, &p1, &p2); if (v1 * s + p1 * 2 < v2 * s + p2 * 2) printf( First n ); if (v1 * s + p1 * 2 > v2 * s + p2 * 2) printf( Second n ); if (v1 * s + p1 * 2 == v2 * s + p2 * 2) printf( Frie... |
#include <bits/stdc++.h> using namespace std; const int N = 300005; int n, m, q; struct Graph { struct Edge { int to, next; } edge[N << 1]; int head[N], cnt; Graph() { memset(head, 0, sizeof(head)); cnt = 1; return; } void add_edge(int u, int v) { if (u == 0... |
#include <bits/stdc++.h> using namespace std; const int NMAX = 1e5; int v[NMAX + 5], ans[NMAX + 5]; inline void GenerateAnswer(int n) { int i, state = 1, st = 1, dr = n, dim = 0; sort(v + 1, v + n + 1); while (st <= dr) { if (st != dr) { if (state == 1) ans[++dim] = v[st], an... |
module RS232TX (
input clk,
input Tx_start,
input [23:0] dbuffer,
output Tx,
output Tx_busy
);
wire bittick;
wire[7:0] Tx_data = dbuffer[7:0];
RS232Baud baud(
.clk(clk),
.enable(Tx_busy),
.tick(bittick)
);
reg[3:0] Tx_state = 0;
wire Tx_ready = (Tx_state==0);
assign Tx_busy = ~Tx_ready;
reg[7:0] Tx_shift =... |
#include <bits/stdc++.h> using namespace std; template <class T> void read(vector<T> &a, long long n) { T x; a.clear(); for (long long i = 0; i < n; i++) { cin >> x; a.push_back(x); } } template <class T> void write(vector<T> &a) { for (T x : a) cout << x << ; cout << ... |
/**
* 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 1986-2017 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2017.3 (win64) Build Wed Oct 4 19:58:22 MDT 2017
// Date : Fri Nov 17 16:06:27 2017
// Host : egk-pc running 64-bit major release (build... |
/*------------------------------------------------------------------------------
* This code was generated by Spiral Multiplier Block Generator, www.spiral.net
* Copyright (c) 2006, Carnegie Mellon University
* All rights reserved.
* The code is distributed under a BSD style license
* (see http://www.opensource.or... |
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; scanf( %d %d %d , &a, &b, &c); double rez = 1.0 * a * a * a * 1.41421356237309 / 12.0; rez += 1.0 * b * b * b * 1.41421356237309 / 6.0; rez += 1.0 * c * c * c * 7.23606797749978 / 24.0; printf( %.10lf n , rez); retur... |
// (C) 2001-2016 Intel Corporation. All rights reserved.
// Your use of Intel 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 docum... |
/*
* 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... |
#include <bits/stdc++.h> using namespace std; bool jolmetsz(long long a, long long b, long long c, long long x1, long long y1, long long x2, long long y2) { return -c - a * x1 < b * y1 && -c - a * x2 > b * y2; } int main() { long long x1, x2, y1, y2, n, db = 0; cin >> x1 >> y1 >> x2 ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 16:19:54 04/26/2017
// Design Name:
// Module Name: decrypt_dumb
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
... |
//
// Author: Pawel Szostek ()
// Date: 01.08.2011
`timescale 1ns/1ps
module stimulus (output reg [7:0] a);
parameter S = 20000;
int unsigned j,i;
initial begin
for(i=0; i<S; i=i+1) begin
#10;
a[7] <= inject();
a[6] <= inject();
a[5] <= inject();
... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2007 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
integer cyc=0;
reg [63:0] crc;
reg [63:0] sum;
// Take CRC data and apply to test... |
module SystolicDataSetupRow #(
parameter DATA_BITS = 8,
parameter MATRIX_SIZE = 256,
parameter OUTPUT_SIZE = 2*MATRIX_SIZE-1
) (
input clock,
input reset,
input [DATA_BITS-1:0] data_in [0:MATRIX_SIZE-1][0:MATRIX_SIZE-1],
output [DATA_BITS-1:0] data_out[0:MATRIX_SIZE-1][0:OUTP... |
#include <bits/stdc++.h> using namespace std; int compare(const void *a, const void *b) { int *p = (int *)a; int *q = (int *)b; if (p[0] == q[0]) return p[1] - q[1]; return p[0] - q[0]; } int main() { int n, m, c = 0, t, i, x; scanf( %d%d , &n, &m); ; t = 0; for (i = 0; i < n... |
#include <bits/stdc++.h> using namespace std; template <class T> inline T sqr(T x) { return x * x; } const double EPS = 1e-6; const int INF = 0x3fffffff; const long long LINF = INF * 1ll * INF; const double PI = acos(-1.0); using namespace std; struct PointSet { char val; int num; } ps... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2003 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
integer cyc; initial cyc=1;
// verilator lint_off UNOPT
// verilator lint_off UNOPTFLAT
... |
#include <bits/stdc++.h> using namespace std; int main() { long long A, B, n; cin >> A >> B >> n; long long i, j; if (A == 0) { if (B == 0) { cout << 0; } else cout << No solution ; return 0; } if (B % A) { cout << No solution ; return 0; }... |
//Define 32 to 16 multiplexer
module mux32to16(out , in1 , in2 ,control);
// I/O port declaration
output [31:0] out;
input [31:0] in1,in2;
input control;
//internal nets
wire control_not;
wire [31:0] anded_out_1,anded_out_2;
//internal gate circuitry
not (control_not,control);
and (anded_out_1[0] ,... |
// Copyright 1986-2014 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2014.3 (lin64) Build Fri Oct 3 16:31:15 MDT 2014
// Date : Sun Oct 25 15:45:17 2015
// Host : arthas-ubuntu running 64-bit Ubuntu 14.04.3... |
`timescale 1ns/1ps
module tb_cocotb #(
//parameter CONSOLE_DEPTH = 12,
parameter CONSOLE_DEPTH = 5,
parameter ADDR_WIDTH = 32,
parameter DATA_WIDTH = 32,
parameter STROBE_WIDTH = (DATA_WIDTH / 8),
parameter AXIS_WIDTH = 24,
parameter AXIS_STROBE_WIDTH = (AX... |
#include <bits/stdc++.h> using namespace std; const int N = 105; const int M = 1005; int n, m, x[N], s; double p[N * M], tmp[N * M]; int main() { scanf( %d%d , &n, &m); for (int i = 1; i <= n; ++i) scanf( %d , &x[i]); for (int i = 1; i <= n; ++i) s += x[i]; if (m == 1) { puts( 1.000000... |
//
//////////////////////////////////////////////////////////////////////////////////
// Copyright © 2010, Xilinx, Inc.
// This file contains confidential and proprietary information of Xilinx, Inc. and is
// protected under U.S. and international copyright and other intellectual property laws.
///////////////////... |
// (c) Copyright 1995-2015 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 ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sum = 0; for (int i = 0; i < n; i++) { int x1, x2, y1, y2; cin >> x1 >> x2 >> y1 >> y2; sum += (max(x1, y1) - min(x1, y1) + 1) * (max(x2, y2) - min(x2, y2) + 1); } cout << sum << n ; retur... |
#include <bits/stdc++.h> using namespace std; inline long long read() { long long x = 0, f = 1; char c = getchar(); while (c < 0 || c > 9 ) { if (c == - ) f = 0; c = getchar(); } while (c >= 0 && c <= 9 ) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar(); return f ? ... |
/**
* 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() { ios::sync_with_stdio(0); cin.tie(0); int t, i, j, k, z, x, num[2]; string s; cin >> t; while (t--) { cin >> s; memset(num, 0, sizeof(num)); for (i = 0; i < s.size(); i++) { if (s[i] == 1 ) num[1]+... |
`timescale 1 ns / 1 ps
`include "../verilog/greycount.v"
module top;
reg clk = 1'b0;
integer t = 0;
reg [15:0] wd = 16'b1;
wire [15:0] rd;
reg we = 1'b1;
reg move = 1'b1;
reg pop = 1'b0;
reg twe = 1'b1;
reg tmove = 1'b1;
reg tpop = 1'b0;
stack2pipe4 #(.DEPTH(4)) dstack_(.clk(clk), .rd... |
#include <bits/stdc++.h> using namespace std; void reshenie() { int n, m; cin >> n >> m; int a[n][n]; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { a[i][j] = a[j][i] = 0; } } while (m--) { int u, v; cin >> u >> v; --u, --v; a[u][v] = ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; long long ans = 0; for (int i = (0); i < (n); ++i) { long long t, T, x, cost; cin >> t >> T >> x >> cost; if (t >= T) { ans += cost + m * x; continue; } long long aux1 = ... |
#include <bits/stdc++.h> using namespace std; const int inf = 0x7fffffff; const int maxn = 2e5 + 5; int bit[2][maxn], num[maxn]; int n, k, a, b, q; void update(int id, int x, int v) { while (x <= n) { bit[id][x] += v; x += (x & -x); } } int sum(int id, int x) { int ans = 0; w... |
/*
* Copyright (c) 2001 Philip Blundell
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* a... |
#include <bits/stdc++.h> using namespace std; struct union_find { vector<int> uf; vector<int> num_segments; vector<bool> used; union_find(int n) { uf.assign(n, -1); num_segments.assign(n, 0); used.assign(n, false); for (int i = 0; i < n; ++i) { if (i % 2 == 0) num_seg... |
#include <bits/stdc++.h> using namespace std; long long n, cv; long long level[3501]; long long vis[3501] = {}; vector<long long> graph[3501]; vector<long long> cycles[3501]; vector<long long> z; void dfs_cycle(long long u, long long p, long long color[], long long mark[], long long par... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// BCHDecoderCommandReception for Cosmos OpenSSD
// Copyright (c) 2015 Hanyang University ENC Lab.
// Contributed by Jinwoo Jeong <>
// Kibin Park <>
// Yong Ho Song <>
//
// This file i... |
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int a = 1; int b = N; for (int i = 2; N / i >= i; i++) if (N % i == 0) a = i, b = N / i; cout << a << << b << n ; } |
`timescale 1ns / 1ps
module dewater_mode
#(parameter WIDTH = 32, CLK_CH = 25, TIME_SCORE = 2)
(
input dewater_start, input start, input power, input [31:0]clk,
input [2:0]weight,
output reg dewater_end_sign,
//light
output reg dewatering_light,output reg water_out_light,
output [2:0]water_leve... |
#include <bits/stdc++.h> using namespace std; long double sq(long double a) { return a * a; } long double dist(pair<long double, long double> a, pair<long double, long double> b) { return sqrt((long double)(sq(a.second - b.second) + sq(a.first - b.first))); } long double mandist(pair<lo... |
#include <bits/stdc++.h> const int INF = 0x3f3f3f3f; using namespace std; int v[5005]; int main() { int t1; cin >> t1; for (int t = 1; t <= t1; t++) { int n, d; cin >> n >> d; memset(v, 0, sizeof(v)); int l = 1, nr = n - 1; v[0] = 1; for (; nr >= v[l - 1] * 2; l++... |
///////////////////////////////////////////////////////////////////////////////
//
// Project: Aurora 64B66B
// Company: Xilinx
//
//
//
// (c) Copyright 2008 - 2009 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under... |
module top;
typedef reg [4:0] T1;
typedef T1 [7:0] T2;
T2 q_tst [$];
T2 q_tmp [$];
T2 elem;
integer idx;
bit passed;
task automatic check_size(integer size,
string fname,
integer lineno);
if (q_tst.size !== size) begin
$display("%s:%0d:... |
#include <bits/stdc++.h> using std::cin; using std::cout; using std::endl; using std::ifstream; using std::max; using std::min; using std::ofstream; using std::string; int dp[2204][2204]; int vec[21][2]; int x, y, vec_num_n, max_dist_d; int dfs(int ori_x, int ori_y, int off_x, int off_y) { i... |
// (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 ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 16:26:59 09/20/2015
// Design Name:
// Module Name: Gato_Top
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
/... |
#include <bits/stdc++.h> using namespace std; int n, now, p[20000], p_, g[10], ans; int xx[10]; int tmp[10000]; int yoo[2][10000][10], f[1000][1000]; void dfs(int k) { int tmp = 0; for (int i = 1; i < k; ++i) tmp = tmp * 10 + xx[i] / g[k + 1] % 10; if (k == n) { ans += ::tmp[tmp]; re... |
//
// xc3s500e_godil.v - SPI loader for GODIL with XC3S500E
//
// Copied from bscan_s3e_starter.v.
// Then the starter specific signals removed.
// Top level module renamed from top to xc3s500e_godil.
// Use with a .ucf file with the right PIN assignments.
//
module xc3s500e_godil
(
output wire MOSI,
output wi... |
#include <bits/stdc++.h> using namespace std; int main() { vector<int> v; int n, i, j, k, value; cin >> n; int x = n; while (x--) { cin >> value; v.push_back(value); } for (i = 0; i < n; i++) for (j = 0; j < n; j++) { if (i == j) j++; for (k = j + 1; k <... |
/*
* 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 law... |
#include <bits/stdc++.h> using namespace std; int main() { int n, m, dd, hh, mm, t; int sep[16]; char buf[80]; vector<string> todo; map<string, int> cost; vector<pair<int, int> > time; vector<vector<pair<int, bool> > > dp; vector<pair<pair<int, int>, pair<int, int> > > job; scanf... |
#include <bits/stdc++.h> using namespace std; 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, const T &r) { return l > r ? l = r, 1 : 0; } const long long MOD = 1e9 +... |
#include <bits/stdc++.h> using namespace std; const int _ = 600 + 7; const int __ = 1e5 + 7; const int S = 601, T = 602; const int inf = 0x3f3f3f3f; int n; int lst[_], nxt[__], to[__], cap[__], tot = 1; long long ans; int gi() { int x = 0; bool f = 0; char c = getchar(); while (!isdigi... |
#include <bits/stdc++.h> using namespace std; map<int, int> MP1, MP2; map<int, int>::iterator it; const int N = 300100; const long long INF = 3000 * 1000 * 1000LL; vector<int> v; int a[N]; long long ps[N]; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n, l, r; lon... |
#include <bits/stdc++.h> #define pb push_back using namespace std; const int N = 3e5 + 5; vector<int> G[N], G0[N]; long long day; int cur, n, pv, pt, a[N], fa[N], dep[N]; int prv[N], pst[N], np[N], bp[N], ep[N]; void Build(int u) { for(int v : G0[u]) { if(v == fa[u]) continue; fa[v] = u; ... |
#include <bits/stdc++.h> using namespace std; const long long INFLL = 1e18; const int MAXN = 1e6 + 100; const long long INF = 1e9; const long long mod1 = 1e9 + 7; const long long mod2 = 2e9 + 11; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--) { ... |
#include <bits/stdc++.h> using namespace std; const int INFTY = 20000000; const int MAX = 500100; const int MOD = 10000000; void coutTab(int* tab, int n) { for (int i = 0; i < n; i++) { cout << tab[i] << ; } cout << n ; } string create(int a, int b, int x, int start) { if (start... |
#include <bits/stdc++.h> const int Maxn = 50005; int N, A[Maxn]; double L[Maxn], P[Maxn], Sum[Maxn], Ans; using namespace std; bool Cmp(const int &i, const int &j) { return (L[i] * P[i] * (1 - P[j] / 100)) > (L[j] * P[j] * (1 - P[i] / 100)); } int main() { scanf( %d , &N); for (int i = 1; i <=... |
#include <bits/stdc++.h> using namespace std; int getint() { unsigned int c; int x = 0; while (((c = getchar()) - 0 ) >= 10) { if (c == - ) return -getint(); if (!~c) exit(0); } do { x = (x << 3) + (x << 1) + (c - 0 ); } while (((c = getchar()) - 0 ) < 10); return x... |
#include <bits/stdc++.h> using namespace std; void scan() {} template <typename F, typename... R> void scan(F &f, R &...r) { cin >> f; scan(r...); } int di_; string dnms_, co_ = , ; void debug_() { cout << endl; } template <typename F, typename... R> void debug_(F f, R... r) { while (dn... |
/**
* 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 N = 1e6 + 7; const int inf = 0x3f3f3f3f; const long long INF = 0x3f3f3f3f3f3f3f3f; const int mod = 1e9 + 7; const double eps = 1e-8; const double PI = acos(-1); int n; long long h[N], dp[N][2]; int main() { scanf( %d , &n); for (int i =... |
#include <bits/stdc++.h> using namespace std; inline char gc() { static char buf[100000], *p1 = buf, *p2 = buf; return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2) ? EOF : *p1++; } inline long long read() { long long x = 0; char ch = getcha... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 09:31:33 05/12/2015
// Design Name:
// Module Name: sbox3
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependenc... |
#include <bits/stdc++.h> using namespace std; long long INF = 9999999999; double EPSILON = 0.00000001; int sint(string s) { int num = 0; istringstream myStream(s); (myStream >> num); return num; } string str(int num) { ostringstream oss; oss << num; return oss.str(); } vector... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; for (int k = 1; k <= n / 3; k++) { if (n % k == 0) { for (int p = 0; p < k; p++) { int sum = 0; for (int v = p; v < n; v += k) { ... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; const double eps = 1e-9; double mi[N], ma[N]; double pre1[N], pre2[N]; double ans1[N], ans2[N]; int main() { int n; scanf( %d , &n); for (int i = (1); i <= (n); i++) cin >> ma[i]; for (int i = (1); i <= (n); i++) cin >> m... |
module nh_lcd #(
parameter DATAS_WIDTH = 24,
parameter BUFFER_SIZE = 12
)(
input rst,
input clk,
output [31:0] debug,
//Control Signals
input i_enable,
input ... |
/**
* 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... |
module conware #(
parameter DWIDTH = 32,
parameter WIDTH = 8,
parameter HEIGHT = 1
)(
// Color conversion signals
// alive_color,
// dead_color,
// Clock and Reset
ACLK,
ARESETN,
// Input AXI stream ports
S_AXIS_TVALID,
S_AXIS_TREADY,
S_AXIS_TDATA,
S_AXIS_TL... |
#include <bits/stdc++.h> using namespace std; using namespace chrono; const long long int MOD = 1000000007; const long long int MAXN = 1000005; const long long int INF = 100000000000005; void solve() { long long int n; cin >> n; vector<long long int> a(n), pos, neg; for (long long int i = 0;... |
//////////////////////////////////////////////////////////////////////
//// ////
//// eth_maccontrol.v ////
//// ////
//// This file is part of the E... |
#include <bits/stdc++.h> using namespace std; char buf[256]; signed main() { long long n; scanf( %lld , &n); stack<long long> cur; set<long long> si; long long tmp = 1, ans = 0; for (long long i = 0; i < n * 2; i++) { scanf( %s , buf); string s(buf); if (s == add ) { ... |
#include <bits/stdc++.h> int main() { int i, j, l, n, k, good; static int a[6][1001], dp0[1001], dp1[1001], pp[6][1001]; scanf( %d%d , &n, &k); for (i = 1; i <= k; i++) for (j = 1; j <= n; j++) { scanf( %d , &a[i][j]); if (i == 1) pp[1][a[i][j]] = j; else { ... |
`timescale 1 ns / 1 ps
module axi_cfg_register #
(
parameter integer CFG_DATA_WIDTH = 1024,
parameter integer AXI_DATA_WIDTH = 32,
parameter integer AXI_ADDR_WIDTH = 16
)
(
// System signals
input wire aclk,
input wire aresetn,
// Configuration bits
out... |
#include <bits/stdc++.h> using namespace std; const int N = 5e3 + 100; struct node { int a, b, c; } p[N]; int nex[N]; vector<int> pre[N]; int dp[N][N]; int main() { int n, m, k; scanf( %d %d %d , &n, &m, &k); int sum = k; for (int i = 1; i <= n; ++i) scanf( %d %d %d , &p[i].a, ... |
#include <bits/stdc++.h> using namespace std; const long long MAX_N = 3e5 + 7; const long long MOD = 998244353; long long n; long long deg[MAX_N], fac[MAX_N]; long long f_pow(long long base, long long b, long long mod) { long long res = 1; while (b) { if (b & 1) res = res * base % mod; b... |
#include <bits/stdc++.h> using namespace std; const int oo = 1e9; const int maxc = 77; struct thang { int X, B; }; thang A[1010]; double f[1010]; int trace[1010], st[1010]; int N, L; void nhap() { scanf( %d%d , &N, &L); for (int i = 1; i <= N; i++) scanf( %d%d , &A[i].X, &A[i].B); A[... |
#include <bits/stdc++.h> using namespace std; int dp[100][100]; struct point { public: int f, t; point() {} point(int a, int b) { f = a, t = b; } }; int main() { int X, k; cin >> X >> k; int val, sum = 0; vector<pair<int, int>> a, b; for (int i = 0; i < (X); i++) { cin... |
/**
* 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 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 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... |
// ghrd_10as066n2_dipsw_pio.v
// Generated using ACDS version 17.1 240
`timescale 1 ps / 1 ps
module ghrd_10as066n2_dipsw_pio (
input wire clk, // clk.clk
input wire [3:0] in_port, // external_connection.export
output wire irq, // irq.irq
input... |
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; int *tree; void buildTree(int node, int arr[], int start, int end) { if (start == end) { tree[node] = arr[start]; return; } int mid = (start + end) / 2; buildTree(2 * node + 1, arr, start, mid); buildTree(2... |
/**
* 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 N = 1000006; int t, n, m, x, y; stack<int> s; int rg[N], rs[N], ls[N], lg[N], a[N]; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } a[0] = a[n + 1] = 0; for (int i = 1; i <= n + 1; i++) { while (!s.e... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2020 Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
module t(/*AUTOARG*/
// Inputs
clk
);
input clk;
integer cyc = 0;
reg [63:0] crc;
reg [... |
/**
* 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 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... |
module top (
input wire clk,
input wire rx,
output wire tx,
input wire [15:0] sw,
output wire [15:0] led
);
RAM32X1S #(
.INIT(32'b00000000_00000000_00000000_00000010)
) ram3 (
.WCLK (clk),
.A4 (sw[4]),
.A3 (sw[3]),
.A2 (sw[2]),
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.