text
stringlengths
59
71.4k
/* * Copyright 2012, 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 main() { int n, k, t, i, j, ii, a; while (scanf( %d%d%d , &n, &k, &t) != EOF) { for (i = 1; i <= n; i++) { if ((i * k + 1) * 100 > t * n * k) break; } for (j = 0; j <= k; j++) { a = (i - 1) * k + j; if (n * k * t >= ...
#include <bits/stdc++.h> using namespace std; const int N = 105; const int M = 505; const int MOD = int(1e9) + 7; const int INF = 0x3f3f3f3f; const double EPS = 1e-9; const double PI = acos(-1.0); const int dx[] = {-1, 1, 0, 0}; const int dy[] = {0, 0, -1, 1}; template <class T> inline T Min(T a, ...
///////////////////////////////////////////////////////////////////// //// //// //// WISHBONE AC 97 Controller //// //// Output FIFO //// //// ...
// ------------------------------------------------------------- // // File Name: hdl_prj\hdlsrc\controllerPeripheralHdlAdi\velocityControlHdl\velocityControlHdl_Reset_Delay.v // Created: 2014-08-25 21:11:09 // // Generated by MATLAB 8.2 and HDL Coder 3.3 // // -------------------------------------------------------...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); int n; cin >> n; vector<string> a(n + 1), b(n + 1); vector<int> c(n + 1); vector<long long> f1(n + 1), f2(n + 1); for (int i = 1; i <= n; ++i) { cin >> c[i]; } for (int i = 1; i <= n; +...
/** * 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...
// TOOL: vlog2tf // DATE: Wed May 07 12:26:41 2014 // TITLE: Lattice Semiconductor Corporation // MODULE: section3_schematic // DESIGN: section3_schematic // FILENAME: section3_schematic_tf.v // PROJECT: Unknown // VERSION: 2.0 // This file is auto generated by the Diamond `timescale 1 ns / 1 ns ...
#include <bits/stdc++.h> using namespace std; const long long INF = (long long)1e9 + 999999; const long long Mod = (long long)1e9 + 7; const long long MaXN = (long long)1e18; const int N = (int)1e6 + 7; const int MaXI = (int)1e9; const int Mass = (int)2e5; int main() { ios_base::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...
//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...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 21.02.2016 16:25:28 // Design Name: // Module Name: ARINC429 // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revi...
#include <bits/stdc++.h> using namespace std; int L, f, b; int n; int pos[110]; map<int, int> lot; int findpos(int L) { map<int, int>::iterator cur, next; cur = lot.begin(), next = cur; next++; for (; next != lot.end(); cur++, next++) { int back = cur->first + cur->second, front = next...
/** * 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...
#include <bits/stdc++.h> using namespace std; string s[10100]; string sep; bool u[10100] = {false}; vector<string> str; string make(pair<string, string> p) { return ((p.first + sep + p.second) < (p.second + sep + p.first)) ? (p.first + sep + p.second) : (p.second + sep + p....
#include <bits/stdc++.h> using namespace std; void ga(int N, int *A) { for (int i(0); i < N; i++) scanf( %d , A + i); } char s[222222], r[222222]; int N, A, B; int main(void) { scanf( %s%s , s, r), N = strlen(s); for (int i(0); i < N; i++) if (s[i] ^ r[i]) A += s[i] == 52, B += s[i] != 52;...
#include <bits/stdc++.h> using namespace std; int n, m, q; char s[111111][12]; const int OFF = 128, BITS = 7, MASK = 127; int dy[111111][12], dx[111111][12]; char qu[5]; int mx; void go(int &y, int &x, int upTo) { for (int z = 0; z < (int)(mx); ++z) { if (s[y][x] == ^ ) { --y; ...
#include <bits/stdc++.h> using namespace std; const int N = 1010; void solve() { int n, m; cin >> n >> m; vector<vector<long long>> a = vector<vector<long long>>(n, vector<long long>(m, 0)); for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) cin >> a[i][j]; vector<long long>...
#include <bits/stdc++.h> using namespace std; int main() { int q, v; cin >> q; for (int i = 0; i < q; i++) { cin >> v; if (v == 2) cout << 2 << n ; else { if (v % 2) cout << 1 << n ; else cout << 0 ...
// file: system_clk_wiz_0_0.v // // (c) Copyright 2008 - 2013 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 ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<pair<int, int>> v(n); vector<int> v2(k); for (int i = 0; i < n; i++) { cin >> v[i].first; v[i].second = i + 1; } sort(v.begin(), v.end()); int sum = 0; for (int i = 0; i < k; i+...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of inst_ab_e // // Generated // by: wig // on: Wed Aug 18 12:44:01 2004 // cmd: H:/work/mix_new/MIX/mix_0.pl -strip -nodelta ../../constant.xls // // !!! Do not edit this file! Autogenerated by MIX !!!...
// Model of FIFO in Altera module fifo_1c_4k ( data, wrreq, rdreq, rdclk, wrclk, aclr, q, rdfull, rdempty, rdusedw, wrfull, wrempty, wrusedw); parameter width = 32; parameter depth = 4096; //`define rd_req 0; // Set this to 0 for rd_ack, 1 for rd_req input [31:0] data; input wrreq; in...
//////////////////////////////////////////////////////////////////////////////// // // // This file is placed into the Public Domain, for any use, without warranty. // // 2012 by Iztok Jeras ...
/* Copyright (c) 2019 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
#include <bits/stdc++.h> using namespace std; int main() { string s; int m; int a[100005] = {0}; int b[100005] = {0}; cin >> s; s = + s; cin >> m; for (int i = 1; i <= s.length(); i++) { if (s[i] == s[i + 1]) a[i] = 1; } for (int i = 1; i <= s.length(); i++) { ...
#include <bits/stdc++.h> using namespace std; static const int INF = 500000000; template <class T> void debug(T a, T b) { for (; a != b; ++a) cerr << *a << ; cerr << endl; } int n, w, b; const long long int mod = 1000000009; int C[4005][4005]; int main() { for (int i = 0; i < 4003; ++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...
module fourbitmux2X1ToRegToReg(out, x, y, sel, clk); wire _00_; wire _01_; wire _02_; wire _03_; wire _04_; wire _05_; wire _06_; wire _07_; wire [3:0] \_mux4_1.out ; input clk; output [3:0] out; wire [3:0] r1; input sel; input [3:0] x; input [3:0] y; DFFPOSX1 _08_ ( .CLK(clk), .D(r1[0]), .Q(ou...
#include <bits/stdc++.h> using namespace std; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); long long ct; cin >> ct; while (ct--) { long long n, k; cin >> n >> k; vector<long long> a(n), was(n + 1), s; long long tmp = 0; for (long long i = 0; i < (n); ++...
#include <bits/stdc++.h> using namespace std; int ball[100005]; int main() { int n, m; cin >> n >> m; if (m % 2) { int basket = m / 2; while (n--) { cout << basket + 1 << n ; basket = m - basket - 1; if (basket <= m / 2) basket--; if (basket < 0) basket = ...
/** * 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...
/* * Milkymist VJ SoC * Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq * adjusted to FML 8x16 by Zeus Gomez Marmolejo <> * * 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, version 3...
#include <bits/stdc++.h> using namespace std; long long n, cnt = 0; long long a[623456], b[623456], v[9999999]; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; v[a[i]] = 1; } for (int i = 1; i <= n; i++) { cin >> b[i]; v[b[i]] = 1; } for (int i ...
///////////////////////////////////////////////////////////// // Created by: Synopsys DC Ultra(TM) in wire load mode // Version : L-2016.03-SP3 // Date : Sun Nov 20 02:52:39 2016 ///////////////////////////////////////////////////////////// module GDA_St_N8_M8_P5 ( in1, in2, res ); input [7:0] in1; input [...
#include <bits/stdc++.h> using namespace std; int arr[200000], arr2[200000]; int main() { int n, i; long long sum = 0; scanf( %d , &n); for (i = 0; i < n; i++) { scanf( %d , &arr[i]); arr2[i] = arr[i] + arr2[i - 1]; } for (i = 0; i < n; i++) { if (arr[i] == 0) { s...
#include <bits/stdc++.h> using namespace std; int main() { string s; int m; cin >> s >> m; while (m--) { int l, r, k; cin >> l >> r >> k; int init = l - 1; int len = r - l + 1; string ns = s; for (int i = init; i < r; i++) { int pos = init + (i - init + k)...
#include <bits/stdc++.h> using namespace std; const int maxn = 200025; int n, m, i, j, t, k, s, mod, a[maxn], fat[maxn]; bool flg, vis[maxn << 1]; inline int Pow(int x, int y, int mo) { int ret = 1; while (y) { if (y & 1) ret = 1ll * ret * x % mo; x = 1ll * x * x % mo; y >>= 1; }...
// VGA¿ØÖÆÄ£¿é ¸ù¾Ýµ±Ç°É¨Ãèµ½µÄµãÊÇÄÄÒ»²¿·ÖÊä³öÏàÓ¦ÑÕÉ« module VGA_Control ( input clk, input rst, input [1:0]snake, input [5:0]apple_x, input [4:0]apple_y, output reg[9:0]x_pos, output reg[9:0]y_pos, output reg hsync, output reg vsync, output reg [11:0] color_out ); reg [19:0]clk_cnt; reg [9:0]line_cn...
#include <bits/stdc++.h> int f[100005]; int g[100005]; int h[1000005]; int v[100005]; int main() { int n, m = 0; scanf( %d , &n); for (int i = 1; i <= n; i++) { scanf( %d , &f[i]); } for (int i = 1; i <= n; i++) { if (v[i] == 0) { if (f[i] == i) { m++; ...
#include <bits/stdc++.h> using namespace std; void solve() { int n,i,j=2,x,m,d,k; cin >> n; if(n%2==1) {cout << NO << endl;return;} while(j<1000000009 && j<=n) { if(n==j) { // cout << loop << endl; cout << YES << end...
#include <bits/stdc++.h> using namespace std; int n; struct hh { int t, nxt; } edge[1000020 << 1]; int head[1000020], ecnt; void make_edge(int f, int t) { edge[++ecnt] = (hh){t, head[f]}; head[f] = ecnt; edge[++ecnt] = (hh){f, head[t]}; head[t] = ecnt; } int dep[1000020], size[100002...
#include <bits/stdc++.h> using namespace std; int main() { long long int i, j, n, k, s, min, max; cin >> n >> k; if (k % n) cout << k / n + 1; else cout << k / n; return 0; }
// Copyright (c) 2000-2011 Bluespec, Inc. // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, m, mn, mx; cin >> n >> m >> mn >> mx; set<int> temp; for (int i = 0; i < m; ++i) { int x; cin >> x; temp.insert(x); } if (*temp.begin() < mn or *temp.rbegin()...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 10; int vis[maxn]; vector<int> e[maxn]; vector<int> w[maxn]; int a[maxn]; int ans; void add_edge(int u, int v, int ww) { e[u].push_back(v); e[v].push_back(u); w[u].push_back(ww); w[v].push_back(ww); } void dfs(int n...
#include <bits/stdc++.h> using namespace std; const int maxn = 3e3 + 5; int n, m; vector<int> g[maxn]; long long dis[maxn][maxn]; vector<pair<long long, long long> > from[maxn], to[maxn]; void bfs(int x) { queue<int> q; q.push(x); dis[x][x] = 0; while (!q.empty()) { int now = q.front...
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2016.3 (win64) Build Mon Oct 10 19:07:27 MDT 2016 // Date : Thu Sep 14 10:23:02 2017 // Host : PC4719 running 64-bit Service Pack 1 (...
#include <bits/stdc++.h> using namespace std; mt19937 rd(time(0)); vector<long long> v(100010), val(100010), con[100010], st(100010, 0), en(100010, 0), d(100010, 0); pair<long long, long long> t[20][100010]; long long cur = 0; void dfs(long long node, long long par, long long dep) { st[node] = ++c...
#include <bits/stdc++.h> using namespace std; template <typename T> T sqr(T x) { return x * x; } template <typename T> T abs(T x) { return x > 0 ? x : -x; } int cur = 0; string get_next() { string ans = ; if (cur >= 26) { ans = B ; } else { ans = A ; } ans +...
#include <bits/stdc++.h> using namespace std; string m[10]; bool win(int i, int j, int x, int y) { int X = 0; int O = 0; int D = 0; for (int c = 0; c < 5 && i >= 0 && i < 10 && j >= 0 && j < 10; i += x, j += y, c++) { if (m[i][j] == X ) { X++; } else if (m[i][j] == O...
#include <bits/stdc++.h> using namespace std; const int inf = ~0u >> 2; const int N = 500010; int Max[N << 2]; struct node { int x, y, z; } in[N]; int tot, n; int num[N]; int max(int a, int b) { return a > b ? a : b; } void pushup(int rt) { Max[rt] = max(Max[rt << 1], Max[rt << 1 | 1]); } void...
////////////////////////////////////////////////////////////////////////////////// // // This file is part of the N64 RGB/YPbPr DAC project. // // Copyright (C) 2015-2021 by Peter Bartmann <> // // N64 RGB/YPbPr DAC is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public ...
#include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pint = pair<int, int>; using pll = pair<ll, ll>; int main(){ int t; cin >> t; while(t--){ int k, n, m; cin >> k >> n >> m; queue<int> a, b; int size = k; fo...
#include <bits/stdc++.h> using namespace std; template <class L, class R> ostream &operator<<(ostream &os, pair<L, R> P) { return os << ( << P.first << , << P.second << ) ; } template <class T> ostream &operator<<(ostream &os, vector<T> V) { os << [ ; for (auto vv : V) os << vv << , ; ...
#include <bits/stdc++.h> using namespace std; const int sMAX = 10010; const int MAX = 114514; const long long bMAX = 1919180; int main() { int t; cin >> t; while (t--) { string zs; cin >> zs; int ans = zs.size() + 1; int m[4] = {0, 0, 0, 0}; for (int i = 0; i < zs.siz...
/* * support_dma - processes DMA on the support memory * * Used for uploading code to the suport CPU * * Part of the CPC2 project: http://intelligenttoasters.blog * * Copyright (C)2017 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public Li...
#include <bits/stdc++.h> using namespace std; int x, y; char a[1001][1001]; int n, c[1000000], ni[5001][5001]; bool vis[1001][1001], b[1000000]; int e[] = {1, -1, 0, 0}; int r[] = {0, 0, -1, 1}; void dfs(int i, int j, int n) { vis[i][j] = true; ni[i][j] = n; c[n]++; for (int g = 0; g < 4...
/* This file is part of JT12. JT12 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. JT12 program is distributed...
/** * 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 ) using namespace std; const long long infl = 0x3f3f3f3f3f3f3f3fLL; const long long infi = 0x3f3f3f3f; mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count()); const long long mod = 1e9 + 7; const long long N = 1e6 + 5; void solve() { ...
//64 registers, 32-bits each module phy_reg_file ( input clk, input rst, //Read interface input [5:0] p_rs, //Read Address 1 input [5:0] p_rt, //Read Address 2 output reg [31:0] rd_data_rs, //Read Data out1 output reg [31:0] rd_data_rt, //Read Data out2 //Write interface input [5:0] p_rd, //From CDB.Tag (...
#include <bits/stdc++.h> using namespace std; char s[5005]; int n, dp[5005][5]; const int inf = 1e7 + 5; int go(int id, int need) { if (id == n) return 0; if (dp[id][need] != -1) return dp[id][need]; int ans = 0; if (need == 1) { if (s[id] == a ) ans = max(1 + go(id + 1, 1), 1 +...
/******************************************************************************* * This file is owned and controlled by Xilinx and must be used solely * * for design, simulation, implementation and creation of design files * * limited to Xilinx devices or technologies. Use with non-Xilinx ...
/** * 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 module test(); reg clock, reset; sopc sopc( .clock(clock), .reset(reset) ); always #1 clock = ~clock; initial begin $dumpfile("dump.vcd"); $dumpvars; $dumpvars(0, sopc.cpu.register.storage[2]); $dumpvars(0, sopc.cpu.register.sto...
#include <bits/stdc++.h> namespace fdd { int n, m1, m2; std::priority_queue<int> q[1010]; std::vector<int> v1, v2; void solve() { std::cin >> n; for (int i = 3; i < n; i++) { scanf( %d%d , &m1, &m2); if (m1 > m2) std::swap(m1, m2); q[m1].push(m2); } for (int i = 2; i <= n; 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 size1; string s; vector<int> v; int arr[200]; cin >> size1 >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == * ) v.push_back(i + 1); } for (int i = 0; i < v.size(); i++) { for (int count1 = 1; count1 <= ...
// megafunction wizard: %ROM: 1-PORT% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: altsyncram // ============================================================ // File Name: redDiskModule.v // Megafunction Name(s): // altsyncram // // Simulation Library Files(s): // altera_mf // ==========================...
module top; reg [24*8-1:0] str; real rval; reg [7:0] array [0:7]; reg [7:0] array2 [8:15]; reg [7:0] array3 [-1:7]; integer idx, istr; task clear_array; for (idx = 0; idx < 8; idx = idx + 1) begin array[idx] = 0; array2[idx+8] = 0; end endtask initial begin // An invalid stri...
/* * 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 j1#( //parameter bootram_file = "../image.ram" // For synthesis parameter bootram_file = "./image.ram" // For simulation ) ( // Inputs sys_clk_i, sys_rst_i, io_din, // Outputs io_rd, io_wr, io_addr, io_dout); input sys_clk_i...
// generated by gen_VerilogEHR.py using VerilogEHR.mako // Copyright (c) 2019 Massachusetts Institute of Technology // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction...
#include <bits/stdc++.h> int dizi[100015]; int main() { int i, m, n, fark, k, j; scanf( %d %d %d %d , &m, &n, &k, &j); for (i = 1;; i++) { j = (j * m + n) % k; if (dizi[j]) { printf( %d , i - dizi[j]); break; } dizi[j] = i; } return 0; }
/* ******************************************************************************* * File Name : ada_idex_stage.v * Project : ADA processor * Version : 0.1 * Date : Aug 8th, 2014 * Author : Angel Terrones <> * * Disclaimer : Copyright © 2014 Angel Terrones * ...
`include "../mem/im.v" `include "../RF/reg_file2.v" `include "../ALU/alu.v" `include "../lib/mux5bit_2to1_2.v" `include "../lib/mux32bit_4to1.v" `include "../lib/mux32bit_2to1.v" `include "../lib/mux32bit_2to1_2.v" `include "../lib/sign_extend.v" `include "../control/control2.v" `include "../ALU/alu_control2.v" `includ...
#include <bits/stdc++.h> using namespace std; inline char nc() { static char buf[600000], *p1, *p2; return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 600000, stdin), p1 == p2) ? EOF : *p1++; } long long rd() { long long x = 0; char ch = nc(); while (ch < 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 la...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of ent_ba // // Generated // by: wig // on: Tue Jul 4 08:39:13 2006 // cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl ../../verilog.xls // // !!! Do not edit this file! Autogenerated by MIX !!! // $Author...
/** * ------------------------------------------------------------ * Copyright (c) All rights reserved * SiLab, Institute of Physics, University of Bonn * ------------------------------------------------------------ */ `timescale 1ps / 1ps `default_nettype none module tcp_to_bus ( input wire BUS_RS...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: BMSTU // Engineer: Oleg Odintsov // // Create Date: 15:09:47 01/19/2012 // Design Name: // Module Name: ag_main // Project Name: Agat Hardware Project // Target Devices: // Tool ...
#include <bits/stdc++.h> using namespace std; map<double, int> a; double b[200007]; inline long long int read() { long long int x = 0, f = 1; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) x = x * 10 + c...
// // Generated by Bluespec Compiler, version 2018.10.beta1 (build e1df8052c, 2018-10-17) // // // // // Ports: // Name I/O size props // RDY_server_reset_request_put O 1 reg // RDY_server_reset_response_get O 1 // read_rs1 O 64 // read_rs1_port2 ...
#include <bits/stdc++.h> using namespace std; int main() { long long x; cin >> x; if (!x) cout << 0 << endl; else { if (x < 0) x = -1 * x; long long ans = 1, temp = 0; while (temp < x) { temp = temp + ans; ans++; } ans--; long long res = ans ...
#include <bits/stdc++.h> const int N = 105; int n, m; char a[N][N]; struct Node { int ax, ay, bx, by, cx, cy; }; void work(int i, int j, int mask) { for (int x = 0; x < 2; ++x) { for (int y = 0; y < 2; ++y) { if (mask >> (x << 1 | y) & 1) { a[i][j] ^= 1, a[i][j + 1] ^= 1, a[i...
#include <bits/stdc++.h> using namespace std; const int MAXN = 100; int main() { long long n, m, a[MAXN], st[MAXN]; scanf( %I64d %I64d , &n, &m); st[0] = 1; for (int i = 1; i <= n; i++) st[i] = st[i - 1] * 2; int l = 0; int r = n; for (int i = 1; i < n; i++) { if (m > st[n - 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; bool comp(pair<int, int> a, pair<int, int> b) { return (a.first == b.first) ? a.second < b.second : a.first < b.first; } long long int modInverse(long long int a) { long long int m = 1000000007; long long int y = 0, x = 1; while (a > 1) { long ...
#include <bits/stdc++.h> using namespace std; long long a[100009], b[100009], s[100009]; signed main() { ios_base::sync_with_stdio(false), cin.tie(NULL); long long i, j, n, m, c; cin >> n >> m >> c; for (i = 1; i <= n; i++) cin >> a[i]; for (i = 1; i <= m; i++) cin >> b[i], s[i] = (b[i] + s[i ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using ld = long double; const int mod = 1e9 + 7; const ll inf = 2e9; const ll INF = 2e18; const ld EPS = 1e-7; const int N = 1e5 + 55; ll sx[N], sy[N]; void solve() { int...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: Case Western Reserve University // Engineer: Matt McConnell // // Create Date: 22:14:00 09/09/2017 // Project Name: EECS301 Digital Design // Design Name: Lab #4 Project // Module Name: ...
#include <bits/stdc++.h> using namespace std; int main() { int a[100001], b[100001]; int n, i, x, y; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; b[i] = a[i]; } sort(b, b + n); x = 0; while (a[x] == b[x] && x < n - 1) { x++; } y = n - 1; while (a[y] ...
/* * 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> using namespace std; int main() { int t; cin >> t; while (t--) { int n, p; cin >> n >> p; int cnt = 0; for (int i = 1; i < n; ++i) { for (int j = i + 1; j <= n; ++j) { if (cnt == 2 * n + p) break; cout << i << << j << n ;...
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int mini = INT_MAX; cin >> a >> b; int az = a.size(); for (int i = -2000; i <= az; i++) { int ans = b.size(); for (int j = 0; j < b.size(); j++) { ans -= (i + j >= 0 && i + j < a.size() && a[i + j] == b[j...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> PII; long long qpow(long long a, long long b, long long m) { long long ans = 1; while (b) { if (b & 1) ans = ans * a % m; a = a * a % m, b >>= 1; } return ans; } long long qpow(long long a, long long b) { long...
`default_nettype none `timescale 1ns / 1ps // The async_bridge core exposes an asynchronous, static RAM as a // synchronous, Wishbone B4 compatible peripheral. // // NOTE: This module does not use the chip-enable input of the static // RAM chip. It statically hardwires the _CE signal in an asserted // state. // // NO...