text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; const int DX[8] = {1, -1, 0, 0, 1, 1, -1, -1}; const int DY[8] = {0, 0, 1, -1, 1, -1, 1, -1}; const int intmax = 0x7fffffff; const int mod = 1000000007; int n, m; int f[205]; int p[205]; vector<pair<int, int> > op; int main() { scanf( %d%d , &n, &m);... |
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; const int rows[5] = {3, 4, 5, 4, 3}; bool dp[1 << 19], seen[1 << 19]; pii int_to_pair(int c) { pii res = {0, 0}; while (rows[res.first] <= c) { c -= rows[res.first]; res.first++; } res.second = 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 la... |
#include <bits/stdc++.h> using namespace std; int main() { long q, m, n, i, j, dummy, a, b, x, y, t, x1, y1; cin >> n >> m >> q; vector<vector<long> > R(100, vector<long>(100, 0)); vector<vector<long> > C(100, vector<long>(100, 0)); vector<vector<long> > E(100, vector<long>(100, 0)); for (i ... |
#include <bits/stdc++.h> using namespace std; const long long mod = 998244353; template <class T> inline void read(T &res) { char c; T flag = 1; while ((c = getchar()) < 0 || c > 9 ) if (c == - ) flag = -1; res = c - 0 ; while ((c = getchar()) >= 0 && c <= 9 ) res = res * 10 + ... |
#include <bits/stdc++.h> using namespace std; long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; } long long lcm(long long a, long long b) { return a * b / GCD(a, b); } int lb(int x) { return x & (-x); } const long long N = 3e5 + 7; const long long inf = 1e18 + 1; const long long mod2... |
// file: Clock70HMz_tb.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 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 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... |
/*+--------------------------------------------------------------------------
Copyright (c) 2015, Microsoft Corporation
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 ... |
#include <bits/stdc++.h> const int MAXN = (int)1e5 + 5; const int MODN = (int)1e9 + 7; int inf = 0x3f3f3f3f; using namespace std; char str[MAXN]; int num[MAXN]; int a[MAXN]; int vis[MAXN]; int main() { int n, m; while (scanf( %d , &n) != EOF) { memset(vis, 0, sizeof(vis)); int sum ... |
// i2c.v
// This file was auto-generated as part of a generation operation.
// If you edit it your changes will probably be lost.
`timescale 1 ps / 1 ps
module i2c (
input wire wb_clk_i, // clock.clk
input wire wb_rst_i, // clock_reset.reset
inout wire scl_pad_io, // ... |
#include <bits/stdc++.h> using namespace std; int ans[51][6] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 4, 3, 0, 0, 0, 0, 5, 3, 0, 0, 0, 0, 6, 5, 0, 0, 0, 0, 7, 6, 0, 0, 0, 0, 8, 6, 5, 4, 0, 0, 9, 5, 0, 0, 0, 0, 10, 7, ... |
//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... |
// =============================================================================
// COPYRIGHT NOTICE
// Copyright 2000-2001 (c) Lattice Semiconductor Corporation
// ALL RIGHTS RESERVED
// This confidential and proprietary software may be used only as authorised by
// a licensing agreement... |
// Accellera Standard V2.3 Open Verification Library (OVL).
// Accellera Copyright (c) 2005-2008. All rights reserved.
`ifdef OVL_ASSERT_ON
wire xzcheck_enable;
`ifdef OVL_XCHECK_OFF
assign xzcheck_enable = 1'b0;
`else
`ifdef OVL_IMPLICIT_XCHECK_OFF
assign xzcheck_enable = 1'b0;
`else
assign xzcheck... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; cout << 6 - n << n ; vector<bool> chk(6, false); for (int i = 0; i < n; i++) { string s; cin >> s; if (s[0] == p ) chk[0] = true; else i... |
// megafunction wizard: %FIFO%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: dcfifo
// ============================================================
// File Name: IPfifo.v
// Megafunction Name(s):
// dcfifo
//
// Simulation Library Files(s):
// altera_mf
// ============================================... |
#include <bits/stdc++.h> using namespace std; const int INF = 1e9 + 7; const long long LL_INF = 1ll * INF * INF; const int MAX_N = 1000000 + 7; template <typename T> inline void addmod(T& a, const long long& b, const int& MOD = INF) { a = (a + b) % MOD; if (a < 0) a += MOD; } const int mod = INF... |
//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 associated do... |
module top;
reg pass;
real rarr [1:0];
real rat;
integer i;
wire real rmon = rarr[0];
wire real rmonv = rarr[i];
always @(rarr[0]) begin
rat = rarr[0];
end
initial begin
pass = 1'b1;
i = 0;
rarr[0] = 1.125;
#1;
if (rmon != 1.125) begin
$display("Failed CA at 0, expect... |
/////////////////////////////////////////////////////////////////////
//// ////
//// pfpu32_i2f ////
//// 32-bit integer to floating point converter ////
//// ... |
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using ii = pair<int, int>; template <typename A, typename B> ostream& operator<<(ostream& os, pair<A, B> p) { return os << { << p.first << , << p.second << } ; } const int oo = 0x3f3f3f3f; const ll OO... |
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; long long T[N]; long long sum[5]; multiset<long long, greater<long long>> ms[5]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, k, b, c; cin >> n >> k >> b >> c; for (int i = 1; i <= n; i++) { cin >> T[i... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 3010; const int INF = 0x3f3f3f3f; int d[MAXN], e[MAXN]; int main() { memset(d, INF, sizeof d); memset(e, INF, sizeof e); int n; cin >> n; string s; cin >> s; int at = INF; for (int i = 0; i < n; i++) { if (s[i... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k, sum = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> k; sum += (int)abs(k); } cout << sum << endl; 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 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.4 (win64) Build Wed Dec 14 22:35:39 MST 2016
// Date : Tue May 30 22:27:54 2017
// Host : GILAMONSTER running 64-bit major release (... |
#include <bits/stdc++.h> using namespace std; int pos = -1; void Go(vector<string> &t) { if (t[++pos] == int ) { cout << int ; } else { cout << pair< ; Go(t); cout << , ; Go(t); cout << > ; } } int main() { int n, i = 0; bool check = true; cin >... |
`include "constants.vh"
module pLayer(state_in, state_out, clk, rst, out_rdy, en);
input clk;
input rst;
input [263:0] state_in;
input en;
output reg [263:0] state_out;
output reg out_rdy;
wire [7:0] out_comb;
reg [7:0] permute [0:32];
reg [263:0] state_comb;
re... |
#include <bits/stdc++.h> using namespace std; int main() { int t; scanf( %d , &t); while (t--) { int m, n; scanf( %d %d , &m, &n); if (m % n == 0) printf( YES n ); else printf( NO n ); } } |
#include <bits/stdc++.h> using namespace std; int main() { int t, s, q; cin >> t >> s >> q; int cnt = 0; while (s < t) { s = s * q; cnt++; } cout << cnt << endl; } |
#include <bits/stdc++.h> using namespace std; int main() { int n, i = 1, j = 1, c1, c2; cin >> n; if (n % 2) cout << 9 << << (n - 9) << endl; else cout << 8 << << (n - 8) << endl; return 0; } |
//---------------------------------------------------------------------------
//-- Copyright 2015 - 2017 Systems Group, ETH Zurich
//--
//-- This hardware module 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 ... |
module j1soc#(
//parameter bootram_file = "../../firmware/hello_world/j1.mem" // For synthesis
parameter bootram_file = "../firmware/Hello_World/j1.mem" // For simulation
)(
trigger, echo, done, [15:0]distance
sys_clk_i, sys_rst_i
);
inpu... |
#include <bits/stdc++.h> using namespace std; int main() { int n, a = 0, l[101], r[101], k; cin >> n; for (int i = 0; i < n; i++) { cin >> l[i] >> r[i]; } cin >> k; for (int i = 0; i < n; i++) { if (k <= r[i]) { a++; } } cout << a; } |
#include <bits/stdc++.h> using namespace std; const long long INF = 0x3ffffffffffff; int main() { long long T; scanf( %lld , &T); while (T--) { long long k, n, a, b; scanf( %lld%lld%lld%lld , &k, &n, &a, &b); k -= b * n; if (k <= 0) printf( -1 n ); else pr... |
#include <bits/stdc++.h> using namespace std; class solution { public: void solve() { int n; cin >> n; int i = 1; int prev = 0; vector<int> sol; while (n != 0) { if (n > prev) { prev++; sol.push_back(prev); n = n - prev; } else... |
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const int MAXN = 1e6 + 5; long long a[MAXN], b[MAXN]; int main() { int x; cin >> x; for (int i = 1; i <= x; i++) for (int j = 1; j <= x; j++) { if (i * j > x && (i / j) < x && (i % j == 0)) { cout << ... |
#include <bits/stdc++.h> using namespace std; inline int read() { char ch = getchar(); int x = 0, f = 1; while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) { x = (x << 1) + (x << 3) - 0 + ch; ch = getchar(); } ... |
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1.0); const int N = 1e6 + 5; int f[N]; int a[] = {1, 2}; int na = 2; int main() { int cnt; cin >> cnt; if (cnt == 1) { cout << 1 1 n1 ; return 0; } int x = 1; for (int i = 2; i < N; i++) { if (... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e4 + 5; const int mod = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int a[n + 5], mx = 0; long long sum = 0; for (int i = 0; i < n; i++) cin >> a[i], sum += a[i]... |
//Legal Notice: (C)2017 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associate... |
#include <bits/stdc++.h> using namespace std; vector<pair<int, int> > ans; int a[305], b[305], n; int cur[305]; map<int, vector<int> > m; int main() { ios_base::sync_with_stdio(0); cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; for (int i = 0;... |
#include <bits/stdc++.h> using namespace std; int min(int a, int b) { if (a > b) { return b; } else { return a; } } int max(int a, int b) { if (a > b) { return a; } else { return b; } } int main() { int n, x0; int a, b; int d, f; cin >> n >> x0... |
/*
* 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 a[2006]; int Gcd(int m, int n) { if (n == 0) return m; return Gcd(n, m % n); } int main() { int n; scanf( %d , &n); int yi = 0; int flag = 0; for (int i = 0; i < n; i++) { scanf( %d , &a[i]); if (a[i] == 1) yi++; } ... |
// Author: wlzhouzhuan #pragma GCC optimize( Ofast ) #pragma GCC target( avx ) #include <bits/stdc++.h> using namespace std; #define ull unsigned long long namespace IO { const int SIZE = 1 << 23; char ibuf[SIZE], *iS, *iT; char obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1; bool flush(... |
#include <bits/stdc++.h> using namespace std; struct coordinate { float x; float y; }; float check1(coordinate c1, coordinate c2, coordinate c3, coordinate c4, coordinate x1) { float ans1 = (x1.y - c1.y) + (x1.x - c1.x); float ans2 = (x1.y - c3.y) + (x1.x - c3.x); if (ans1 == ... |
//#############################################################################
//# Function: Isolation buffer (HIGH) for multi supply domains #
//#############################################################################
//# Author: Andreas Olofsson #
... |
/*
* 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, x1, y1, x2, y2, x, y; scanf( %d%d%d%d%d%d , &n, &m, &x1, &y1, &x2, &y2); x = abs(x1 - x2); y = abs(y1 - y2); if (x + y >= 7 || y >= 5 || x >= 5) printf( Second n ); else printf( First n ); return 0; } |
// (C) 1992-2014 Altera Corporation. All rights reserved.
// Your use of Altera Corporation's design tools, logic functions and other
// software and tools, and its AMPP partner logic functions, and any output
// files any of the foregoing (including device programming or simulati... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k; scanf( %d %d , &n, &k); char c[200005]; scanf( %s , c); int ok[26]; memset(ok, 0, sizeof(ok)); for (int i = 0; i < k; i++) { char cc; scanf( %c , &cc); ok[cc - a ] = 1; } long long cnt = 0; ... |
#include <bits/stdc++.h> using namespace std; const int N = 100500; const int INF = 2 * (1e9); int n, m; vector<pair<int, int> > edge[N]; vector<pair<int, int> > delay[N]; int dist[N]; int main() { cin.sync_with_stdio(false); cin >> n >> m; for (int i = 0; i < m; i++) { int from, to, l... |
#include <bits/stdc++.h> using namespace std; int main() { int a1, b1, a2, b2; scanf( %d%d%d%d , &a1, &b1, &a2, &b2); int i; int two1 = 0, three1 = 0, two2 = 0, three2 = 0; long long s1 = (long long)a1 * b1, s2 = (long long)a2 * b2; while (!(s1 % 2)) { two1++; s1 /= 2; } ... |
/*
* 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 ... |
module test_bench(clk, rst);
input clk;
input rst;
wire [31:0] wire_39069600;
wire wire_39069600_stb;
wire wire_39069600_ack;
wire [31:0] wire_39795024;
wire wire_39795024_stb;
wire wire_39795024_ack;
wire [31:0] wire_39795168;
wire wire_39795168_stb;
wire wire_39795168_ack;
... |
#include <bits/stdc++.h> using namespace std; const int INF = 1e9, MAXN = 4010; int n; inline int pack(int l, int r, int k) { return (l << 19) + (r << 7) + k; } unordered_map<int, int> dp(MAXN* MAXN * 2); vector<int> a, pref; int calc(int l, int r, int k, int p) { if (p) { if (dp.count(pack(l, r... |
#include <bits/stdc++.h> using namespace std; const int INFint = 2147483647; const long long INF = 9223372036854775807ll; const long long MOD = 1000000007ll; long long cnt[100000]; int main() { ios_base::sync_with_stdio(0); long long a; cin >> a; string s; cin >> s; for (int i = 0; i... |
#include <bits/stdc++.h> using namespace std; const int maxN = 1e5 + 5; long double N, t; long double Pow(long double b, long long e) { if (e == 0) return 1; long double ret = Pow(b, e / 2); ret *= ret; if (e % 2) return ret * b; return ret; } int main() { cin >> N >> t; N *= Pow... |
#include <bits/stdc++.h> using namespace std; int main() { long long n; scanf( %lld , &n); long long a[n + 100]; for (long long i = 0; i < n; i++) scanf( %lld , &a[i]); sort(a, a + n); long long q, x; scanf( %lld , &q); while (q--) { long long c = 0; scanf( %lld , &x); ... |
#include <bits/stdc++.h> using namespace std; long long int e, d, c, x, aux, aux2; priority_queue<pair<long long int, long long int> > q; void res(long long int n) { long long int k = n; e = 0; d = 1; while (k > 0) { d = d * 10 + 1; e++; k = k / 10; } c = (d - 1) / 10; ... |
#include <bits/stdc++.h> using namespace std; int main() { char ch; string s1, s2; int S = 1, H = 2, D = 3, C = 4; int T = 10, J = 11, Q = 12, K = 13, A = 14; cin >> ch >> s1 >> s2; if (s1[1] == ch && s2[1] != ch) cout << YES n ; else if (s1[1] == s2[1]) { if (s1[0] == A &... |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; const int inf = 1e9 + 7; long long n, m, k, w; long long dp1[maxn]; long long dp2[maxn]; int d1[maxn]; int d2[maxn]; long long a, b; inline int low_bit(int x) { return x & (-x); } inline void upd1(int p, int x) { while (p ... |
#include <bits/stdc++.h> using namespace std; const int NR = 5005; void Min(int& x, int y) { x = min(x, y); } void Max(int& x, int y) { x = max(x, y); } int read() { int x = 0, f = 1; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); } w... |
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2014 Xilinx, Inc.
// All Right Reserved.
///////////////////////////////////////////////////////////////////////////////
// ____ ____
// / /\/ /
// /___/ \ / Vendor : Xilinx
// \ \ \/ Vers... |
#include <bits/stdc++.h> using namespace std; string s; pair<int, int> a[100003]; int l = 0; bool lios(string s) { if (s.size() < 4) return false; if (s.substr(s.size() - 4, 4) == lios ) return true; return false; } bool liala(string s) { if (s.size() < 5) return false; if (s.substr(s... |
`timescale 1ns / 1ps
module alu(a,b,aluc,result
);
input wire [31:0] a,b;
input wire [4:0] aluc;
output reg [31:0] result;
always @*
begin
case(aluc)
5'd0://0:add
result=a+b;
5'd1://1:addu
result=a+b;
5'd2://2:sub
result=a-b;
5'd3://3:subu
result=a-b;
5... |
#include <bits/stdc++.h> bool visited[200010] = {0}; int first[200010], second[200010], thrid[200010], count = 0; std::set<long long int> happened; long long int f(int one, int two) { return (1LL * 1e6 * std::min(one, two) + std::max(one, two)); } int dfs(int current, std::vector<std::vector<int> > &g, ... |
/*
L2 Data Cache
This version will use the Cache as RAM,
0C00_0000 .. 0C00_7FFF
May be accessed either as 128 bit tiles, or as 32 or 64 bit words.
MMIO may only be accessed as 32-bits.
*/
`include "CoreDefs.v"
module Dc2Tile(
/* verilator lint_off UNUSED */
clock, reset,
regInAddr, regInData,
regOutData, r... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int test = 1; cin >> test; while (test--) { long long int n, m; cin >> n >> m; long long int sum1 = 0, sum2 = 0; long long int a[n], b[n], mina[n], mi... |
/*
* 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; const int MAX = 1000; long long d[MAX + 10][3][3]; string s; int n; long long dyn() { if (s[1] == 0) d[1][0][0] = 1; d[1][0][2] = 1; if (s[0] == 0 && s[1] == 1) d[1][1][1] = 1; if (s[0] == 1) d[1][2][2] = 1; for (int i = 1; i <= n - 2; i++) ... |
#include <bits/stdc++.h> using namespace std; const long long MAX = (long long)1e6 + 100; long long inf = (long long)1e18; long long mod = (long long)1e9 + 7; long long n, a, b, c, d; long long get_maxi() { long long uk1 = 0, uk2 = c + 1; while (uk2 - uk1 > 1) { long long mid = (uk2 + uk1) / 2... |
#include <bits/stdc++.h> using namespace std; void print(int a) { cout << a << ; } void print(long long a) { cout << a << ; } void print(double a) { cout << a << ; } void print(string a) { cout << a << ; } template <typename T1, typename T2> void print(pair<T1, T2> a) { print(a.first); ... |
#include <bits/stdc++.h> using namespace std; int main() { int w, h, u1, d1, u2, d2; cin >> w >> h >> u1 >> d1 >> u2 >> d2; int ans = w; if (d1 > d2) { ans += ((d1 + h) * (h - d1 + 1)) / 2; ans -= u1; ans = max(0, ans); ans += ((d1 + d2 - 1) * (d1 - d2) / 2); ans -= u2;... |
/*
Legal Notice: (C)2009 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 assoc... |
#include <bits/stdc++.h> using namespace std; const int mx = (int)2e5 + 5; int n, c[mx], ans[mx]; char a[mx], b[mx]; void solve() { int cnt = 0, temp = 0; for (int i = n - 1; i >= 0; i--) { c[cnt++] = (a[i] + b[i] - 2 * a + temp) % 26; temp = (a[i] + b[i] - 2 * a + temp) / 26; } ... |
#include <bits/stdc++.h> using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string s; getline(cin, s); for (auto i = s.end() - 1; i >= s.begin(); i--) { if ((int(*i) >= 65 && (int(*i) <= 90)) || (int(*i) >= 97 && (int(*i) <= ... |
#include <bits/stdc++.h> using namespace std; void solve() { int n; string s, t, ss; cin >> n >> s; ss = s; t = abacaba ; int cnt = 0; for (int i = 0; i < n - 6; i++) { int j, k = 0; for (j = i; j < i + 7; j++) { if (s[j] != t[k]) break; k++; } if... |
/*
* yosys -- Yosys Open SYnthesis Suite
*
* Copyright (C) 2012 Clifford Wolf <>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* T... |
#include <bits/stdc++.h> using namespace std; const int N = 5000 + 10; char s[N], t[N]; int n, m, dp[N][N]; int main() { scanf( %d%d%s%s , &n, &m, s + 1, t + 1); int ans = 0; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { dp[i][j] = 0; if (i >= 1) dp[i][j] = ma... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 20; const int MAXX = 65536; int n, m; long long year; vector<int> graph[MAXN], rev_graph[MAXN]; vector<int> sol; long long dp[MAXX]; long long countPermutations(int mask, int pos) { dp[0] = 1; for (int i = 1; i < 1 << (n - pos); ++... |
#include <bits/stdc++.h> using namespace std; const long N = 1000L + 10; const long long modulo = 1000000007L; vector<pair<long, long> > interv; bool memo[N][N]; bool visited[N]; void divideByZero(const char *error) { printf(error); fclose(stdout); int a = 234; a = a / (a - a); } bool ... |
/*
* 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... |
// (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 ... |
#include <bits/stdc++.h> using namespace std; bitset<4001> g[4001]; int main() { int n, m; cin >> n >> m; vector<pair<int, int> > v; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--; b--; g[a][b] = 1; g[b][a] = 1; v.push_back(pair<int, int>(a, b)... |
#include <bits/stdc++.h> using namespace std; long long fact_a[1000005]; long long factorial() { fact_a[0] = fact_a[1] = 1; for (long long i = 2; i < 1000005; i++) fact_a[i] = (fact_a[i - 1] * i); } long long power(long long x, long long n) { long long result = 1; while (n > 0) { if (n %... |
#include <bits/stdc++.h> using namespace std; void rd(int &x) { x = 0; int f = 1; char ch = (getchar()); while (!isdigit(ch)) { if (ch == - ) f = -1; ch = (getchar()); } while (isdigit(ch)) x = x * 10 + ch - 0 , ch = (getchar()); x *= f; } const int N = 5e5 + 5; int n... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); long long int num, ans = INT_MAX, temp, multi1 = INT_MAX, multi2 = INT_MAX; cin >> num; for (long long int i = 1; i <= sqrt(num); i++) { if (num % i == 0) { temp = num ... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 19:36:10 11/21/2015
// Design Name: Datapath1
// Module Name: C:/Users/Ariel/Documents/finalArquitectura/TestDatapathPart1/DatapathPart1/DatapathTest.v
// Project Nam... |
#include <bits/stdc++.h> using namespace std; bool sorting(const pair<long long int, long long int>& a, const pair<long long int, long long int>& b) { if (a.first != b.first) { return (a.first > b.first); } else return (!(a.second >= b.second)); } int main() { ios_base::sy... |
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n; int ans = 0; int l1min = 1e9, l1max = 0, r1min = 1e9, r1max = 0; for (int i = 1; i <= n; i++) { int l, r; cin >> l >> r; l1min = min(l1min, l); l1max = max(l1max, l); r1max = max(r1max, r... |
/**
* 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 la... |
//*****************************************************************************
// (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
/... |
//Legal Notice: (C)2010 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.