text
stringlengths
59
71.4k
#include <bits/stdc++.h> using namespace std; const long long mod = 998244353; const int maxn = 2e5 + 9; int a[maxn], b[maxn]; int main() { int n, m; scanf( %d%d , &n, &m); for (int i = 1; i <= n; i++) { scanf( %d , &a[i]); } for (int i = 1; i <= m; i++) { scanf( %d , &b[i]); ...
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; char s[200]; vector<int> __v; __v.assign(1000000, 127); cin >> s; int n; cin >> n; set<int> n_del[ z - a + 1]; set<int>::iterator pos_n_del[ z - a + 1]; for (int i = 0; i < n; i++) { c...
#include <bits/stdc++.h> using namespace std; const int maxn = 25; string str[maxn]; int a[maxn][maxn]; long long dp[1 << 20]; int mask[26], tot[26], big[26], cnt[26], candi[26]; int Min[maxn]; int main() { int n, m; cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> str[i]; } ...
#include <bits/stdc++.h> using namespace std; int w[40]; int main() { int m, n; cin >> m >> n; for (int i = 1; i <= n; i++) { cout << 1 << endl; cin >> w[i]; if (w[i] == 0) { return 0; } } int l = 1, r = m; int index = 1; while (l <= r) { int mid =...
#include <bits/stdc++.h> const int INF = 0x3f3f3f3f; const long long int INFLL = 0x3f3f3f3f3f3f3f3fll; long long int getint() { long long int ret = 0; bool f = 0; char c; while ((c = getchar()) < 0 || c > 9 ) if (c == - ) f ^= 1; while (c >= 0 && c <= 9 ) { ret = ret * 10 + ...
#include <bits/stdc++.h> using namespace std; struct query { long long l, r, x; }; int n, a[109]; long long m; int main() { cin >> n >> m; vector<query> v; vector<long long> cp = {1LL << 60}; for (int i = 0; i < n; i++) { cin >> a[i]; int pr = sqrt(a[i]); for (int j = 1...
#include <bits/stdc++.h> using namespace std; int main() { int t, m, n, z, s, q, p; cin >> t; while (t--) { cin >> n >> m; int a[n][m], z = 200, s = 0, p = 0; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { cin >> a[i][j]; if (a[i][j] < 0) { ...
// megafunction wizard: %ROM: 1-PORT%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: altsyncram // ============================================================ // File Name: rom_dispv.v // Megafunction Name(s): // altsyncram // // Simulation Library Files(s): // altera_mf // ==========================...
// Accellera Standard V2.3 Open Verification Library (OVL). // Accellera Copyright (c) 2005-2008. All rights reserved. parameter UNCHANGE_START = 1'b0; parameter UNCHANGE_CHECK = 1'b1; reg [width-1:0] r_test_expr; reg r_state; integer i; `ifdef OVL_XCHECK_OFF //Do nothing `else `ifdef OVL_IMPLICIT_XCH...
#include <bits/stdc++.h> using namespace std; int Pow10(int deg) { int res = 1; while (deg-- > 0) res *= 10; return res; } int ToInt(const string& from) { int res = 0; for (int i = 0; i < ((int)(from).size()); ++i) res = 10 * res + from[i] - 0 ; return res; } void Solve() { stri...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 20:36:12 08/30/2017 // Design Name: messbauer_generator // Module Name: E:/PLD/MessbauerTestEnvironment/messbaue_test_environment/tests/messbauer_generator_testbench_...
/////////////////////////////////////////////////////////////////////////////// // // Module: pci_userapp.v // Project: CPCI (PCI Control FPGA) // Description: PCI userapp module - implements the "user" section of the // PCI interface // // Based upon userapp.v - generated by CoreGen // // // Cha...
// ============================================================== // File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2015.4 // Copyright (C) 2015 Xilinx Inc. All rights reserved. // // ============================================================== `timescale 1 ns / 1 ps mod...
#include <bits/stdc++.h> using namespace std; int dp[1000000 + 10], cnt[1000000 + 10]; int n; int main() { scanf( %d , &n); for (int i = 1; i <= n; i++) { int a; scanf( %d , &a); int t = 0, temp = a; while (temp <= 1e6) { dp[temp] += t; cnt[temp]++; t++; ...
//------------------------------------------------------------------ //-- Verilog template //-- Top entity //-- Board: icezum //------------------------------------------------------------------ `default_nettype none //-- Pwm circuit for the leds //-- Just fade in and fade out the leds module pwm_led(input wire clk, o...
//Legal Notice: (C)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 //simulation files), and any associate...
`timescale 1ns/1ps module tb(/*AUTOARG*/ // Outputs hash_out, hash_done, fi_cnt, // Inputs m_endn ); parameter LZF_WIDTH = 20; /*AUTOINPUT*/ // Beginning of automatic inputs (from unused autoinst inputs) input m_endn; // To data of data.v // End of automatics /*AUTOOUTPUT*/ // Be...
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); string s; cin >> s; string t = s; int n = s.size(); auto check = [&]() { for (int i = 0; i <= 0; i++) { int mx0 = 0, mx1 = 0, mmx0 = 0, mmx1 = 0; for (int j = i; j < n; j++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr[n]; long long int w[n]; long long int h[n]; for (int i = 0; i < n; i++) { cin >> w[i]; cin >> h[i]; } arr[0] = max(w[0], h[0]); for (int i = 1; i < n; i++) { if (max(w[i], h[i]) ...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of ent_ae // // Generated // by: wig // on: Mon Oct 24 10:52:44 2005 // cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl -nodelta ../../verilog.xls // // !!! Do not edit this file! Autogenerated by MIX !!! /...
#include <bits/stdc++.h> using namespace std; long long read() { long long ans = 0, f = 1; char c = getchar(); while (c > 9 || c < 0 ) { if (c == - ) f = -1; c = getchar(); } while (c >= 0 && c <= 9 ) { ans = ans * 10 + c - 0 ; c = getchar(); } return ans ...
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; for (int i = 0; i < T; i++) { long long int n, x; cin >> n >> x; cout << 2 * x << endl; } }
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; void solve() { int m, n; cin >> n >> m; vector<long long> v(n); for (int i = 0; i < n; i++) { string s; cin >> s; for (char c : s) { v[i] *= 2; v[i] += c - 0 ; } } long long n...
#include <bits/stdc++.h> using namespace std; int pen[2000005]; void update(int ind, int add) { while (ind < 2000005) { pen[ind] += add; ind += ind & (-ind); } } int query(int ind) { int ret = 0; while (ind > 0) { ret = ret + pen[ind]; ind = ind & (ind - 1); } r...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; const int N = 300009; void swap(char *p, char *q) { char temp = *p; *p = *q; *q = temp; return; } long long int powxy(long long int x, long long int y) { if (y == 0) return 1; if (y % 2 == 1) return (x * powxy(x, ...
//Legal Notice: (C)2015 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 associate...
#include <bits/stdc++.h> using namespace std; int main() { long long t; cin >> t; long long ans = t * (t + 1) / 2; if (ans % 2) cout << 1; else cout << 0; }
/* * 16-bit full adder * Copyright (C) 2008-2010 Zeus Gomez Marmolejo <> * * This file is part of the Zet processor. This processor is free * hardware; 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 versio...
#include <bits/stdc++.h> using namespace std; long long n, t, i, k, tam; int main() { while (scanf( %I64d , &n) > 0) { t = 0; tam = 0; for (i = 0; i < n; i++) { scanf( %I64d , &k); if (k % 2 != 0) { tam = k; } t += k; } if (t % 2 != 0) { ...
// ========== Copyright Header Begin ========================================== // // OpenSPARC T1 Processor File: pad_efc.v // Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. // // The above named program is free software; you can redistribute it and/or //...
#include <bits/stdc++.h> using namespace std; const double eps(1e-8); int n, m; vector<long long> seq[100010]; long long a[100010]; int main() { scanf( %d %d , &n, &m); for (int i = 1; i <= m; i++) { scanf( %I64d , &a[i]); } long long initial = 0; a[0] = a[1]; a[m + 1] = a[m]; ...
#include <bits/stdc++.h> const long double pi = acos(-1); using namespace std; char a[105][105], row[105], col[105]; bool vis[105]; int main() { int n, m; cin >> n >> m; bool b = false; if (n == 1) { cout << 0 n ; return 0; } for (int i = 0; i < n; i++) { for (int j ...
/** * 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 mxN = 5005; deque<deque<int> > Painter(mxN); vector<bool> Painted(mxN); vector<vector<int> > cnt(mxN, vector<int>(mxN, 0)); int main() { int n, q; cin >> n >> q; for (int i = 0; i < q; i++) { int l, r; cin >> l >> r; for (...
#include <bits/stdc++.h> using namespace std; int main() { int r, c, x, y; string s; cin >> r >> c >> x >> y; cin >> s; vector<int> visited(r * c + 1, 0); cout << 1 ; int t, n = s.size(); visited[c * (x - 1) + y] = 1; for (int i = 0; i < n - 1; i++) { if (s[i] == U && (...
//====================================================================== // // gcm_core.v // ---------- // Galois Counter Mode core for AES. // // // Author: Joachim Strombergson // Copyright (c) 2016, Secworks Sweden AB // All rights reserved. // // Redistribution and use in source and binary forms, with or // without...
//================================================================================================== // Filename : musb_exmem_register.v // Created On : 2014-09-27 20:25:03 // Last Modified : 2015-05-31 13:04:37 // Revision : 1.0 // Author : Angel Terrones // Company : Universidad Simón ...
#include <bits/stdc++.h> using namespace std; int main() { stack<char> s; int n, count = 0; char c; cin >> n; for (int i = 0; i < n; i++) { cin >> c; if (s.empty()) s.push(c); else if (s.top() == c) { s.pop(); s.push(c); count++; } else ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; long long l = s.length(); long long ans = 0; for (long long i = l - 1; i >= 1; i--) { ans = ans + pow(2, i); } for (long long i = 0; i < l; i++) {...
#include <bits/stdc++.h> using namespace std; map<int, int> sg; map<int, bool> us; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int x, d; cin >> x >> d; sg[x] = x + d; us[x] = true; if (us[x + d] && sg[x + d] == x && sg[x] == x + d) { cout << YE...
#include <bits/stdc++.h> using namespace std; long long power(long long a, long long b) { long long x = 1, y = a; while (b > 0) { if (b % 2) { x = (x * y) % 1000000007; } y = (y * y) % 1000000007; b /= 2; } return x % 1000000007; } int main() { ios_base::sync_...
#include <bits/stdc++.h> using namespace std; int b[100]; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; b[a[i]]++; } int f = 0, h = -1; for (int i = 1; i <= 100; i++) { if (b[i] == 1) { f++; } else if (b[i] > 2) { ...
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2, s3; long long a = 0, b = 0, c = 0; string unia; cin >> s1 >> s2 >> s3; long long *trm1, *trm2; string *uni; uni = &unia; if (s1[0] == A ) trm1 = &a; else if (s1[0] == B ) trm1 = &b; 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...
#include <bits/stdc++.h> using namespace std; template <typename T> T fact(T n) { return (n == 1 || n == 0) ? 1 : n * fact(n - 1); } bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) { return (a.second < b.second); } int subarraysum(int arr[], int n, int sum) { int curr_sum = ar...
// *************************************************************************** // *************************************************************************** // Copyright 2011(c) Analog Devices, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // a...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of ent_b // // Generated // by: wig // on: Fri Jul 15 16:37:20 2005 // cmd: h:/work/eclipse/mix/mix_0.pl -strip -nodelta ../../sigport.xls // // !!! Do not edit this file! Autogenerated by MIX !!! // $...
`include "DEF.v" module excute(clock, in_op, in_src1, in_src2, in_dst, in_imm, out_dst, out_dst_data, write_dst, dmem_address, dmem_data, dmem_write, dmem_read, cnt_ex, cnt_read, in_databus, in_databus2 ); input clock; input [31:0] in_op; input...
#include <bits/stdc++.h> using namespace std; template <typename T> T gcd(T first, T second) { while (second > 0) { first %= second; swap(first, second); } return first; } template <class T> T lcm(T a, T b) { return a / gcd(a, b) * b; } template <class _T> inline _T sqr(con...
//----------------------------------------------------------------------------- // // (c) Copyright 2012-2012 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 ...
#include <bits/stdc++.h> using namespace std; int N, A; vector<int> X; int main(void) { cin.sync_with_stdio(0); cin >> N; int Curr = 0, __Cnt = 0; for (int i = 0; i < N; i++) { cin >> A; if (A < 0) { if (__Cnt == 2) { __Cnt = 0; X.push_back(Curr); ...
// Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2018.2 (win64) Build Thu Jun 14 20:03:12 MDT 2018 // Date : Mon Sep 16 04:56:42 2019 // Host : varun-laptop running 64-bit Service Pac...
#include <bits/stdc++.h> using namespace std; const int oo = 0x3f3f3f3f; const double PI = acos(-1); const long long mod = 1e9 + 7; const long long OO = 2e18; const int N = 3e5 + 5; int parent[N]; set<int> st; set<int>::iterator it1, it2; int n, m, l, r, x; int main() { ios::sync_with_stdio(0)...
/* * 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 (c) 2005 by Terasic Technologies Inc. // -------------------------------------------------------------------- // // Permission: // // Terasic grants permission to use and modify this code for use // in synthesis for all Ter...
// -*- Mode: Verilog -*- // Filename : wb_riscv_soc_top.v // Description : Wishbone RiscV SoC Top Level // Author : Philip Tracton // Created On : Tue Dec 6 21:14:31 2016 // Last Modified By: Philip Tracton // Last Modified On: Tue Dec 6 21:14:31 2016 // Update Co...
#include <bits/stdc++.h> using namespace std; signed long long int n, m, k, x, y; signed long long int ct[3], myct; int main() { cin >> n >> m >> k >> x >> y; signed long long int f1, q, val, rem = k; if (n == 1) { f1 = m; q = rem / f1; rem -= q * f1; myct = q; ct[1] = ...
#include <bits/stdc++.h> using namespace std; const int N = 6000; int dp[N][N], len[N], dep[N], sz[N], n, k, val[N]; char S[N * 300]; char *s[N]; struct Edge { int L, len; int to; Edge(int L = 0, int len = 0, int to = 0) : L(L), len(len), to(to) {} } d[N][26]; inline int idx(int c) { return ...
/* * 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...
/** * This is written by Zhiyang Ong * and Andrew Mattheisen */ /** * Import the design modules for other design submodules * * Include statements for design modules/files need to be commented * out when I use the Make environment - similar to that in * Assignment/Homework 3. * * Else, the Make/Cadence envi...
module Barrel_Shifter #(parameter SWR=26, parameter EWR=5) ( input wire clk, input wire rst, input wire load_i, input wire [EWR-1:0] Shift_Value_i, input wire [SWR-1:0] Shift_Data_i, input wire Left_Right_i, input wire Bit_Shift_i, /////////////////////////////////////...
#include <bits/stdc++.h> using namespace std; const int maxN = (int)1e5 + 10; int a[maxN]; int n; vector<pair<int, int> > ans; int cop[maxN]; bool solve_stupid(int n) { for (int i = 1; i <= n; i++) cop[i] = a[i]; vector<pair<int, int> > all; for (int i = 1; i <= n; i++) { for (int j = i ...
// This counter counts up and is occasionally cleared. // If up and clear are applied on the same cycle, the // clear occurs first, and then the up. // `include "bsg_defines.v" module bsg_counter_clear_up #(parameter `BSG_INV_PARAM(max_val_p) // this originally had an "invalid" default value of -1 /...
/* * Copyright (c) 2015, Ziliang Guo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of cond...
// Wrapper to store WS2812 pixels in a RAM block for independent // read-out. // Copyright (c) 2013 Jared Boone, ShareBrained Technology, Inc. // // This file is part of the Medusa project. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public Licens...
#include <bits/stdc++.h> const long long inf = 1000000000ll; const long long inf64 = inf * inf; const long long base = inf + 7; const long long MOD = inf + 9; const double pi = acos(-1.0); using namespace std; bool solve() { int n, q; scanf( %d %d , &n, &q); vector<long long> a(2 * n + 1); ...
#include <bits/stdc++.h> using namespace std; long long n, p, su; long long a[100005], b[100005]; long double ex[100005]; bool check(long double mid) { long double need = 0; for (int i = 0; i < n; i++) { long double ne = max(0.0L, a[i] * (mid - ex[i])); need += ne; } return (mid * ...
#include <bits/stdc++.h> using namespace std; int main() { string s; int n; int arr[26]; int arr2[26]; cin >> s; int value; int sum = 0; int add; int length = s.size(); cin >> n; for (int i = 0; i < 26; i++) { cin >> arr[i]; arr2[i] = arr[i]; } sort(ar...
#include <bits/stdc++.h> #pragma GCC optimization( O3 ) using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long t; cin >> t; while (t) { int n, m; cin >> n >> m; vector<pair<int, int>> v; vector<int> orig; for (int i = 0; i < m...
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007LL; const long long MXSZ = 1000000LL; long long fpow(long long b, long long e) { long long ret = 1; while (e > 0) { if (e & 1) (ret *= b) %= mod; (b *= b) %= mod; e >>= 1; } return ret; } long lon...
/* Copyright (C) {2014} {Ganesh Ajjanagadde} <> 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 program is distributed 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; int main() { int w = 26; int count = 0; char a[] = { 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 }; string b; cin >> b; for (char c : b) { fo...
/** * Copyright (C) 2009 Ubixum, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * Th...
#include <bits/stdc++.h> using namespace std; int main(void) { long long a, b, c; cin >> a >> b >> c; long long flag = 1; if (a == b) flag = 0; cout << c * 2 + min(a, b) * 2 + flag << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int m, n; int mat[105][105]; int main() { cin >> m >> n; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cin >> mat[i][j]; } } if (m % 2 != 0) { cout << m << endl; } else { int aux = m; bool flag ...
#include <bits/stdc++.h> using namespace std; const int maxn = 20; const double eps = 1e-6; double p[maxn], ans[maxn], dp[1 << maxn], S[1 << maxn]; int Size[1 << maxn]; bool eq(const double &a, const double &b) { return abs(a - b) <= eps; } int main() { int n, k, zerCnt = 0; bool is0; scanf( %...
#include <bits/stdc++.h> using namespace std; const int N = 100005; const int P = 1e9 + 7; const int inf = 1e9; const long long Inf = 1e15; inline int IN() { char ch = getchar(); int x = 0, f = 0; while (ch < 0 || ch > 9 ) ch = getchar(), f = (ch == - ); while (ch >= 0 && ch <= 9 ) { ...
#include <bits/stdc++.h> using std::max; using std::min; const int inf = 0x3f3f3f3f, Inf = 0x7fffffff; const long long INF = 0x3f3f3f3f3f3f3f3f; std::mt19937 rnd(std::chrono::steady_clock::now().time_since_epoch().count()); template <typename _Tp> _Tp gcd(const _Tp &a, const _Tp &b) { return (!b) ? a ...
/** * 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; struct point { long long x, y; point(long long _x, long long _y) { x = _x; y = _y; } point() {} }; struct cmp { bool operator()(point a, point b) { return (a.x < b.x); } }; struct vec { long long x, y; vec(long long _x, lo...
/** * 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...
// DESCRIPTION: Verilator: Verilog Test module // // Copyright 2009 by Wilson Snyder. This program is free software; you can // redistribute it and/or modify it under the terms of either the GNU // Lesser General Public License Version 3 or the Perl Artistic License // Version 2.0. // SPDX-License-Identifier: LGPL-3.0-...
#include <bits/stdc++.h> using namespace std; int n, m, i, x, y, ans = 0, t; bool p1[1010], p2[1010]; int main() { scanf( %d%d , &n, &m); for (i = 1; i <= n; i++) p1[i] = p2[i] = 1; p1[1] = p2[1] = p1[n] = p2[n] = 0; for (i = 1; i <= m; i++) { scanf( %d%d , &x, &y); p1[x] = p2[y] = 0...
/* * 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...
// Accellera Standard V2.3 Open Verification Library (OVL). // Accellera Copyright (c) 2005-2008. All rights reserved. `include "std_ovl_defines.h" `module ovl_increment (clock, reset, enable, test_expr, fire); parameter severity_level = `OVL_SEVERITY_DEFAULT; parameter width = 1; parameter value ...
`timescale 1ns / 10ps `default_nettype none module tb; wire [7:0] led; reg clk; reg rst; wire tx; reg rx; reg [31:0] parport_i; wire [31:0] parport_o; reg [63:0] tracein; initial tracein = 0; always @(posedge clk) begin tracein <= tracein + 64'h1; end...
module transmit_test_model ( //input input clk_100M , input reset_n , //output output [7:0] Line_Num , output [1:0] Focus_Num, output Pr_Gate , output RX_Gate , ...
/** * 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...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 00:06:38 08/13/2013 // Design Name: // Module Name: controlador // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: /...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2003-2007 by Wilson Snyder. module t(/*AUTOARG*/ // Inputs clk ); // surefire lint_off NBAJAM input clk; reg [7:0] _ranit; reg [2:0] a; reg [7:0] vvector; ...
// ============================================================== // File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2015.4 // Copyright (C) 2015 Xilinx Inc. All rights reserved. // // ============================================================== `timescale 1ns/1ps modul...
#include <bits/stdc++.h> using namespace std; const int MAXN = 110; int n, m, k; int h[MAXN]; void load() { scanf( %d%d%d , &n, &m, &k); for (int i = 0; i < n; i++) scanf( %d , h + i); } bool solve() { long long sum = m; int ind = 0; while (ind < n - 1) { if (h[ind] >= h[ind + 1]...
/** * 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 GCC optimize( Ofast ) #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native ) using namespace std; const double PI = 3.141592653589793238463; const int INF = 0x3f3f3f3f; const int INFS = 1000000000; const long long LLINF = 9223372036854775807; const...
#include <bits/stdc++.h> using namespace std; long long fast_expo(long long base, long long exp, long long module) { long long ans = 1; while (exp) { if (exp & 1) ans = (ans * base) % module; base = (base * base) % module; exp >>= 1; } return ans; } bool primes[100001]; void ...
// ============================================================== // RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2014.4 // Copyright (C) 2014 Xilinx Inc. All rights reserved. // // =========================================================== `timescale 1 ns / 1 ps (* CO...
#include <bits/stdc++.h> using namespace std; const int maxn = 300005; const int SIGMA_SIZE = 26; int SZ = 0; struct Node { int sz, ch[SIGMA_SIZE]; Node() { memset(ch, 0, sizeof(ch)); } } nd[maxn << 1]; int newNode() { ++SZ; memset(nd[SZ].ch, 0, sizeof(nd[SZ].ch)); return SZ; } voi...
/* note for avalon interface bus type: nagtive read legacy = 0 (to consistent to FIFO) */ module adc_ltc2308_fifo( // avalon slave port slave_clk, slave_reset_n, slave_chipselect_n, slave_addr, slave_read_n, slave_wrtie_n, slave_readdata, slave_wriredata, adc_clk, // max 40mhz // adc ...