text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> struct count_seg { struct node { std::array<int, 2> c; bool flip = false; }; std::vector<node> seg; count_seg() : seg() {} explicit count_seg(int N) : seg(2 * N) {} std::array<int, 2> query_all() { return seg[1].c; } void update_node(int a) { int ... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2013 by Alex Solomatnikov.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
logic [6-1:0] foo[4-1:0];
//initial $display("%m: %p\n", foo);
//initial $display("... |
#include <bits/stdc++.h> using namespace std; int n, m, d = 1; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n >> m; while (n > d) { for (int i = 1; i < (m + 1); i++) { cout << d << << i << n ; cout << n << << m + 1 - i << n ;... |
#include <bits/stdc++.h> using namespace std; const int oo = 2e9; const int N = 1e6; int n; string s, x = BGR ; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ; cin >> n >> s; int k = oo; string ans; do { int cnt = 0; string t = s; ... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); unsigned long long int n, ans, i, j, k; cin >> n; if (n == 0) { cout << 1 << endl; return 0; } ans = 2 * n * n; ans = ans + ((n + 2) * (n + 1)) - 1; cout << a... |
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2014 Xilinx, Inc.
// All Right Reserved.
///////////////////////////////////////////////////////////////////////////////
// ____ ____
// / /\/ /
// /___/ \ / Vendor : Xilinx
// \ \ \/ V... |
//-------------------------------------------------------------------
//
// Filename : hevc_md_top.v
// Created On : 2014-04-23
// Version1.0 : 2014-05-04
// Version2.0 : 2015-03-09
// Author : Yanheng Lu
// Description : pre_intra(pre mode desision) top module
// V... |
#include <bits/stdc++.h> using namespace std; char str[100005]; int cnt[250]; int main() { scanf( %s , &str); int len = strlen(str); set<char> myset; for (int i = 0; i < len; i++) { myset.insert(str[i]); cnt[str[i]]++; } if (myset.size() == 1 || myset.size() > 4) { prin... |
#include <bits/stdc++.h> using namespace std; void test() { int t; cin >> t; while (t--) { int i = 0; } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ; int i = 0; int n; cin >> n; map<int, int> m; for (int i = 0; i < n; i++) {... |
#include <bits/stdc++.h> using namespace std; string s1, s2; int main() { int n, i, j; scanf( %d , &n); cin >> s1 >> s2; int ans = 0; for (i = 0; i < (n / 2); i++) { j = n - i - 1; map<char, int> mp; mp[s1[i]]++; mp[s1[j]]++; mp[s2[i]]++; mp[s2[j]]++; ... |
//
// Copyright (C) 2009-2012 Chris McClelland
//
// This program 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 3 of the License, or
// (at your option) any later version.
//
// This ... |
/*
* 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... |
// test_mis.v - Testbench for mis.bvrl
// 01-22-01 E. Brombaugh
/*
* Copyright (c) 2001 Eric Brombaugh <>
*
* 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
* Found... |
#include <bits/stdc++.h> const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, -1, 0, 1}; using namespace std; char str[5001]; class Point { public: int Left; int Right; int Up; int Down; }; Point f1[5001], f2[5001]; int ans1, ans2, n, m; int dfs(int p, int tot) { int tmp; ... |
/*
Legal Notice: (C)2007 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 int MX = (int)1e3 + 6; int n, ax, ay, cx, cy, bx, by; int dirx8[] = {0, 0, 1, -1, 1, -1, 1, -1}; int diry8[] = {1, -1, 0, 0, 1, -1, -1, 1}; bool vis[MX][MX]; void fast() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } bool vail... |
#include <bits/stdc++.h> using namespace std; int stmp; const int MAXB = 100000; const int INF = 1000000001; int vis[MAXB + 1]; vector<int> arr; int k, n, maxb, t, _t; int z; inline int lis() { vector<int> L(z, INF); for (int s = 0; s < (t); ++s) { for (int i = 0; i < ((int)(arr).size())... |
#include <bits/stdc++.h> using namespace std; int ans; void solve(long long n, long long l1, long long r1, long long l, long long r) { if (n == 0 || l1 > r || r1 < l) return; long long mid = (l1 + r1) >> 1; if (mid >= l && mid <= r) ans += (n % 2); solve(n / 2, l1, mid - 1, l, r); solve(n / 2,... |
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2014 Francis Bruno, All Rights Reserved
//
// 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 Found... |
/*
* Copyright (c) 2015, Arch Laboratory
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of con... |
// file: ClockDivider.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 is not... |
`timescale 1ns / 1ns
/*
* File : Divide.v
* Project : University of Utah, XUM Project MIPS32 core
* Creator(s) : Neil Russell
*
* Modification History:
* Rev Date Initials Description of Change
* 1.0 6-Nov-2012 NJR Initial design.
*
* Description:
* A multi-cycle 32-bit ... |
/**
* 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; long long int a, b, c; cin >> t; while (t--) { cin >> a >> b >> c; long long int max_val = (a + c); long long int min_val = b; if (a + c <= b) { cout << 0 << endl; } else if (b + c < a) { ... |
/*
Copyright 2018 Nuclei System Technology, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except i... |
`timescale 1ns/1ns
`define CLK_PERIOD 40
module tb;
reg rst_n;
reg clk;
initial
begin
clk = 1'b0;
forever
#(`CLK_PERIOD/2) clk <= ~clk;
end
initial
begin
rst_n = 1'b0;
repeat(3) @(posedge clk);
rst_n <= 1'b1;
end
reg [3:0] pre_reqs;
reg [3:0] reqs;
reg [3:0] prev;
wire [3:0] ne... |
//Legal Notice: (C)2018 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... |
////#include <iostream> ////#include <cstdio> ////#include <cstring> ////#include <algorithm> //// ////#define LL long long //// ////LL gcd(LL a,LL b) { //// if(b == 0) return a; //// else return gcd(b,a % b); ////} //// ////inline LL calc(LL x) { //// LL ret = 0; //// while(x) {... |
#include <bits/stdc++.h> using namespace std; int soch(int a) { if (a == 3) return 1; return soch(a - 1) * a / (a - 3); } int main() { int n, num, i, j, k, raz, dob, num1, dob1, sum = 0, flag = 0, flag1 = 0; bool graf[105][105]; bool graf1[6][6]; vector<pair<int, int>> ver; vector<in... |
// Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2015.1 (win64) Build Mon Apr 27 19:22:08 MDT 2015
// Date : Sun Mar 13 07:43:22 2016
// Host : DESKTOP-5FTSDRT running 64-bit major releas... |
#include <bits/stdc++.h> using namespace std; int main() { string a; int b; cin >> b >> a; for (int i = 2; i <= b; i++) { if (b % i == 0) { reverse(a.begin(), a.begin() + i); } } cout << a; } |
#include <bits/stdc++.h> using namespace std; const long long N = 1e6 + 5; string s; long long a, b; long long v[N], pre[N], suf[N]; int32_t main() { cin >> s >> a >> b; long long n = s.size(); for (long long i = 1; i <= n; i++) v[i] = s[i - 1] - 0 ; for (long long i = 1; i <= n; i++) { ... |
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1); int deg[1000]; int arr[1000][1000]; int jo[1000]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int node, edge; cin >> node >> edge; for (int i = 0; i < edge; i++) { int n1... |
#include <bits/stdc++.h> using namespace std; bool comp(int a, int b) { return (a > b); } int gcd(long long int a, long long int b) { if (b == 0) return a; else return gcd(b, a % b); } int main(void) { int n, p; cin >> n >> p; int l[n], r[n], i; long long int c, cp, l1, l2;... |
// megafunction wizard: %ROM: 1-PORT%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: nine_new2.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ==============================... |
// file: clk_166M_83M.v
//
// (c) Copyright 2008 - 2011 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... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long a, b, c, d, e, first; cin >> a >> b >> c >> d >> e >> first; b = min(c, b); if (d < a && d < b) cout << d * max(e, first); else { long long p = min(a, d) * e ... |
#include <bits/stdc++.h> using namespace std; const long long MAGIC = 400; const long long N = 1e5 + 2; const long long inf = 1e14 + 2; long long lzval[MAGIC], lzmul[MAGIC], ar[N], add[N]; bool used[N]; vector<long long> idx[MAGIC]; struct hull { long long ptr; struct line { long long a, b... |
#include <bits/stdc++.h> using namespace std; int main() { long long int n1, n2, i, j, n, ma = 0, temp, c; cin >> n1 >> n2; if (n1 < n2) { cout << 2 ; } else { cout << n1; } return 0; } |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 10; int a[maxn], b[maxn]; int p[maxn]; int main() { int n; scanf( %d , &n); for (int i = 1; i <= n; i++) { scanf( %d , &a[i]); } memset(p, 0, sizeof(p)); for (int i = 1; i <= n; i++) { scanf( %d , &b[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... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2005 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
reg [83:4] from;
reg [83:4] to;
reg [6:0] bitn;
reg [3:0] nibblep;
reg [3... |
/////////////////////////////////////////////////////////////////////
//// ////
//// WISHBONE Connection Bus Top Level ////
//// ////
//// ... |
#include <bits/stdc++.h> int main() { int n; scanf( %d , &n); int i = 1; while ((i * (i + 1) / 2) <= n) { if ((i * (i + 1) / 2) == n) { printf( YES ); return 0; } i++; } printf( NO ); } |
/*
* 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 able[105], prime[105], left[105], flag = 0; int least = 1; string tp; bool isPrime(int i) { int to = int(sqrt(double(i) + 1.0)); if (i == 1 || i == 2 || i == 5) return 1; for (int j = 2; j <= to; j++) if (i % j == 0) return 0; return 1; ... |
#include <bits/stdc++.h> using namespace std; int const N = 100000; vector<pair<int, int> > g[N + 1]; vector<int> imp; long long cl[42][N + 1]; int dp[N + 1], n; pair<int, long long> pa[N + 1][17]; bool vis[N + 1]; void pl(int v = 1, int p = 0, int w = 0) { dp[v] = dp[p] + 1; vis[v] = true; ... |
/**
* 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 n; long long m, k; scanf( %d%lld%lld , &n, &m, &k); long long a[n], asum[n + 1]; asum[0] = 0; for (int((i)) = (0); ((i)) < ((n)); ++((i))) { scanf( %lld , &a[i]); asum[i + 1] = asum[i] + a[i]; } long long dp[m... |
//////////////////////////////////////////////////////////////////////////////////
// ScrambleEncoder for Cosmos OpenSSD
// Copyright (c) 2015 Hanyang University ENC Lab.
// Contributed by Kibin Park <>
// Yong Ho Song <>
//
// This file is part of Cosmos OpenSSD.
//
// Cosmos OpenSSD is free software; y... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); long long i, j, x, n, m, l, r; cin >> n >> m; vector<long long> v; for (i = 0; i < n; i++) { cin >> x; v.push_back(x); } for (i = 0; i < m; i++) { cin >> l >> r >> x; long long... |
#include <bits/stdc++.h> using namespace std; const int p = 1000 * 1000 * 1000 + 7; int main() { int n, m; vector<long long> fact(1000001); fact[0] = 1; for (int i = 1; i < 1000001; i++) fact[i] = (i * fact[i - 1]) % p; cin >> n >> m; vector<pair<int, int>> v(m); for (int i = 0; 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 law... |
#include <bits/stdc++.h> int a[500005][9] = {0}; int nnf[500005] = {0}; int pn[200005] = {0}; int val[200005]; int x, in; void print(int *a, int n) { int i; for (i = 0; i < n; i++) printf( %d , a[i]); printf( n ); } long long int check(int cnt, int val, int d) { if (in == -1) nnf[val] ... |
//#############################################################################
//# Purpose: A DMA ENGINE #
//#############################################################################
//# Author: Andreas Olofsson #
... |
module top(
clk,
rst_n,
sda,
speed_control,
scl,
MotorPWM,
MotorA,
MotorB,
ServoPPM,
key1,
clkOut,
uart_tx,
uart_rx,
dataLED,
newControlDataW,
accXdata,
angle_control,
testICC
);
input clk, rst_n, key1;
inout sda;
input[15:0]speed_control;
output scl, MotorPWM, MotorA, Moto... |
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; while (cin >> a >> b >> c) { if (b >= c) { b = c - 1; } else { c = b + 1; } if (a >= b) { a = b - 1; cout << a + b + c << endl; } else { b = a + 1; c = a + 2;... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// a... |
#include <bits/stdc++.h> using namespace std; const long long N = 112, INF = 1e18; long long t, n, m, a[N]; long long B10(string s) { reverse(s.begin(), s.end()); long long ret = 0; for (long long i = 0; i < s.size(); i++) { if (s[i] == 1 ) ret += (1ll << i); } return ret; } strin... |
#include <bits/stdc++.h> using namespace std; int a[755]; long long dp[755][755]; int n, m; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) cin >> a[i]; dp[n + 1][0] = 0; for (int i = n; i >= 1; i--) { for (int j = 0; j <= n; j++) { dp[i][j] = min(dp[i + 1][j] + a[i], (l... |
//
// Copyright (c) 1999 Steven Wilson ()
//
// 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)
// ... |
`ifdef BSV_ASSIGNMENT_DELAY
`else
`define BSV_ASSIGNMENT_DELAY
`endif
`ifdef BSV_POSITIVE_RESET
`define BSV_RESET_VALUE 1'b1
`define BSV_RESET_EDGE posedge
`else
`define BSV_RESET_VALUE 1'b0
`define BSV_RESET_EDGE negedge
`endif
// A synchronization module for resets. Output resets are held for
// RSTD... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:16777216 ) using namespace std; struct edge { public: int flow, cap, cost; int u, v; edge(int _u, int _v, int _flow, int _cost, int _cap) { u = _u; v = _v; flow = _flow; cost = _cost; cap = _cap; } edge()... |
/*
* Copyright (c) 2001 Stephen Williams ()
*
* 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)
* ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 100; struct node { int flag, a, b; long long sum; } t[maxn * 8]; int a[maxn], cnt[maxn * 2], js[maxn * 2]; void pushdown(int x, int l, int r) { if (t[x].flag) { int num = t[x].flag; t[2 * x].sum += num * l; t[... |
#include <bits/stdc++.h> using namespace std; pair<int, int> cnt(string s) { int bal = 0, minBal = 0; for (char c : s) { if (c == ( ) bal++; else bal--; minBal = min(minBal, bal); } return {bal, minBal}; } int k[400400]; int main() { ios_base::sync_with_s... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> p(n / 2); for (int i = 0; i < n / 2; i++) { cin >> p[i]; } sort(p.begin(), p.end()); int sum1 = 0, sum2 = 0; for (int i = 0; i < n / 2; i++) { sum1 += abs(p[i] - i * 2 - 1); sum2... |
#include <bits/stdc++.h> using namespace std; int n, m, x, y, z, k, w, a, b, res, dist; vector<int> edge[200005], new_edge[200005]; int deg[200005], depth[200005], far[200005], far_dist[200005]; pair<int, int> dp[200005]; bool has_crit_point[200005]; void DFS(int x, int y, int pre) { if (y == 0) ... |
#include <bits/stdc++.h> using namespace std; int n, flag, ln, prv = -1; char in[100010][20], pr[100010][20]; int main() { scanf( %d , &n); for (int i = 0; i < n; i++) { scanf( %s , in[i]); ln = strlen(in[i]); flag = 0; if (ln < prv) { printf( NO n ); return 0; ... |
#include <bits/stdc++.h> #pragma GCC optimize( O3 ) #pragma GCC target( sse4 ) #pragma GCC optimize( unroll-loops ) #pragma GCC target( avx2 ) using namespace std; const long long MAX = -1000000000000000000; const long long MIN = 1000000000000000000; const long long inf = 1000000000; const long long K... |
#include <bits/stdc++.h> using namespace std; void file_put() { freopen( filename.in , r , stdin); freopen( filename.out , w , stdout); } long long Pow(long long x, long long k, long long _p) { long long ans = 1; for (; k; k >>= 1, x = x * x % _p) if (k & 1) (ans *= x) %= _p; return ... |
// ==============================================================
// File 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
m... |
#include <bits/stdc++.h> using namespace std; int main(int argc, char** argv) { long long n; cin >> n; long long sum = n * (n + 1) / 2; if (sum % 2 == 1) cout << 1; else cout << 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... |
#include <bits/stdc++.h> using namespace std; int num[10]; int main(void) { int T, n; scanf( %d , &T); while (T--) { memset(num, 0, sizeof(num)); scanf( %d , &n); num[1] = n / 2; if (n & 01) { printf( 7 ); for (int i = 1; i < num[1]; ++i) printf( 1 ); } el... |
/******************************************************************************
* License Agreement *
* *
* Copyright (c) 1991-2013 Altera Corporation, San Jose, California, USA. *
... |
/* Concrete parameterizations of a census transform for testing.
*
* Copyright (c) 2016, Stephen Longfield, stephenlongfield.com
*
* 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, eith... |
#include <bits/stdc++.h> using namespace std; inline int in() { int res = 0; char c; int f = 1; while ((c = getchar()) < 0 || c > 9 ) if (c == - ) f = -1; while (c >= 0 && c <= 9 ) res = res * 10 + c - 0 , c = getchar(); return res * f; } const int N = 100010; long long n... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base ::sync_with_stdio(0); cin.tie(0); ; long long int t; cin >> t; while (t--) { string s; cin >> s; long long int a[26] = {0}; long long int cnt = 0; char c; int i = 0; while (i < s.len... |
#include <bits/stdc++.h> using namespace std; void solve() { int n, x; scanf( %d%d , &n, &x); if (n < 2) n = 2; int ans = ((n - 2) + x - 1) / x + 1; printf( %d n , ans); } int main() { int t; scanf( %d , &t); while (t--) solve(); return 0; } |
//
// TV80 8-Bit Microprocessor Core
// Based on the VHDL T80 core by Daniel Wallner ()
//
// Copyright (c) 2004 Guy Hutchison ()
//
// 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 witho... |
module functionGen_tb ();
parameter ARCH = "GENERIC";
parameter BIT_COMPRESS_PHASE = 1;
parameter BIT_COMPRESS_OUTPUT = 1;
parameter OUT_WIDTH = 8;
parameter FREQ_WIDTH = 16;
parameter INCLUDE_CLAMP = 1;
reg clk;
reg rst;
reg en;
reg [1:0] waveType;
reg [FREQ_WIDTH-1:0] freq;
reg [FREQ_WIDTH-1:0] phaseOffset;
reg sig... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; long long int n, m, k; vector<long long int> a, b; while (t--) { cin >> n >> m; cout << n << << n * 2 << n ; } return 0; } |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, k; cin >> n >> k; string s; cin >> s; map<char, int> m; for (int i = 0; i < s.size(); i++) { m[s[i]]++; } char a = A ; bool flag1 = true; for (int... |
#include <bits/stdc++.h> using namespace std; int a[156], T, n, k, ans, lw, que[100]; int main() { int T; cin >> T; while (T--) { cin >> k; lw = 0; for (int i = 1; i <= 7; i++) { cin >> a[i]; a[i + 7] = a[i]; lw += a[i]; } int n = k / lw; if ... |
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll M = 1e4 + 10; const ll G = 1e3 + 10; ll n, m, g, r; vector<ll> d; ll ansDep = -1; ll ansT = -1; bool seen[M][G]; ll ans = 1e17; void bfs() { deque<tuple<ll, ll, ll> > q; q.emplace_front(0, 0, 0); while (!q.emp... |
/**
* 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 = 1e6; int q[maxn], fin, razbeg, jump, n; pair<int, int> ans[maxn]; int sz = 0; int main() { cin >> n >> fin >> razbeg >> jump; for (int i = 0; i < n; i++) cin >> q[i]; q[n] = 0; q[n + 1] = fin; n += 2; sort(q, q + n); ... |
#include <bits/stdc++.h> using namespace std; inline int max(int a, int b) { return a > b ? a : b; } map<int, int> mp; int a[200005], id; inline int read(int x) { if (mp.count(x) > 0) return mp[x]; mp[x] = ++id; return id; } int main() { int n; scanf( %d , &n); int x; for (int ... |
#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]; sort(a, a + n); for (int i = 0; i < n; i++) { if (a[i] != i + 1) { cout << i + 1; return 0; } } cout << n + 1; return 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... |
/**
* 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... |
//////////////////////////////////////////////////////////////////////
//// ////
//// OR1200's Freeze logic ////
//// ////
//// This file is part of the OpenR... |
#include <bits/stdc++.h> using namespace std; string moves[] = { MW , LW , LM }; int sequence[25]; void listify(int k, int n) { for (int i = 0; i != n; ++i) { sequence[i] = k % 3; k /= 3; } } void solve(int n, vector<vector<int> >& V) { int n1 = n / 2; int n2 = n - n1; int ... |
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const long long LINF = 0x3f3f3f3f3f3f3f3fLL; const double EPS = 1e-8; const int MOD = 998244353; const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1}; int mod = MOD; struct ModInt { unsigned val; ModInt() : val(0) {} M... |
#include <bits/stdc++.h> using namespace std; int main() { long long int n, a, b, c, result = 0, i, x, y, j = 0; cin >> n >> a >> b >> c; for (i = 0; i <= min(n, a / 2); i++) { x = min(c, (n - i) / 2); y = min(i + b, n); if (y - (n - x * 2) / 2 >= 0) { if (y >= n - x * 2) resul... |
/**
* 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 = 1000000007; const int inf = 2012345678; const int N = 2e5 + 10; string s, ans, tmp; bool ch() { int i = 0; while (s[i] == tmp[i] && i < tmp.length()) ++i; return i == tmp.length(); } int main() { int n, k; cin >> n >> k >>... |
#include <bits/stdc++.h> using namespace std; struct str { int x1; int y1; int x2; int y2; }; bool compare(str &a, str &b) { if (a.x1 < b.x1) return true; else if (a.x1 == b.x1) { if (a.x2 < b.x2) return true; else if (a.x2 == b.x2) { if (a.y1 < b.y1) ... |
`timescale 1 ps / 1 ps
module zynq_1_wrapper
(DDR_addr,
DDR_ba,
DDR_cas_n,
DDR_ck_n,
DDR_ck_p,
DDR_cke,
DDR_cs_n,
DDR_dm,
DDR_dq,
DDR_dqs_n,
DDR_dqs_p,
DDR_odt,
DDR_ras_n,
DDR_reset_n,
DDR_we_n,
FIXED_IO_ddr_vrn,
FIXED_IO_ddr_vrp,
FIXED_IO_mio,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.