Show all threads Hide all threads Show all messages Hide all messages |
No subject | Felix_Mate | 1228. Array | 1 Feb 2017 17:12 | 1 |
Edited by author 01.02.2017 17:12 |
My Solution Here: | Destiny | 1228. Array | 31 Jul 2016 12:18 | 9 |
program arrays; var k:array[1..20]of longint; d:array[0..20]of longint; n:integer; s:longint; procedure init; var i:integer; begin readln(n,s); for i:=1 to n do readln(d[i]); d[0]:=s; end; procedure solve; var i:integer; begin k[n]:=d[n-1]-1; for i:=n-1 downto 1 do k[i]:=(d[i-1] div d[i])-1; for i:=1 to n-1 do write(k[i],' '); writeln(k[n]); end; begin init; solve; end. const maxn=20; var w,n,i:longint; a,b:array [1..maxn] of longint; begin readln(w,n); for i:=1 to w do readln(a[i]); n:=n-1;i:=1; repeat b[i]:=n div a[i]; n:=n mod a[i]; inc(i); until n=0; for i:=1 to w do write(b[i],' '); end. > const maxn=20; > var w,n,i:longint; > a,b:array [1..maxn] of longint; > begin > readln(w,n); > for i:=1 to w do readln(a[i]); > n:=n-1;i:=1; > repeat > b[i]:=n div a[i]; > n:=n mod a[i]; > inc(i); > until n=0; > for i:=1 to w do write(b[i],' '); > end. #include <fstream.h> void main() { int n, s, t, i; cin >> n >> s; for(i=0; i<n; i++) { cin >> t; cout << (s / t) - 1 << " "; s = t; } } var n,s,d:longint; begin readln(n,s); dec(s); for n:=1 to n do begin readln(d); write(s div d,' '); s:=s mod d; end; end. What is the use of showing you and your code off ? Instead of getting proud of yourself, giving clarification is much more better Instead of getting proud of yourself and giving right code, giving clarification is much more better |
Good problem! AC in 0.015 | [RISE] Levon Oganesyan [RAU] | 1228. Array | 3 Feb 2014 23:45 | 1 |
Thanks to author! Edited by author 19.11.2014 21:49 |
Brainbreaking text, brainless task. | Komendantian Grant Mikaelovich SSAU | 1228. Array | 23 Jan 2014 19:52 | 8 |
Absolutely right, Grant! I entirely agree with you. Easy when you understand it. It took me the monthes to understand how stupid this problem is. I wanted do this problem with brute force, by recursion, a lot of different ways, until I understood. Any way, this problem is really stupid.)) i solved it but still didn't get what the problem is "Brainbreaking text, brainless task" - exactly It took me 20 minutes to solve it.)) (the hardest part is to read the text and to write the code). )) This problem doesn't help improving any algorithm but it improves your mind to translate your understanding to easy code. (I think) Edited by author 23.01.2014 19:53 |
WA#1 | Stolyarov Artyom | 1228. Array | 28 Jul 2013 19:11 | 1 |
WA#1 Stolyarov Artyom 28 Jul 2013 19:11 I have WA 1 but on my computer all ok. Is first test not like in statement? |
i cannot understand the problem !!! | IRAKLI | 1228. Array | 16 Oct 2012 23:38 | 4 |
P( i<1> , i<2> , i<3> , ... , i<n-1> , i<n> ) determines at which position is the X[ i<1> , i<2> , i<3> , ... , i<n-1> , i<n> ] element in ( lets say ) RAM . And the Function P is absolutely correct. You should determine the dimensions k<1> , k<2> , k<3> , ... , k<n-1> , k<n> of the X for the given D elements. I don't know whether I could explain it, if not I'm really sorry ! I can't do much. :( Edited by author 16.10.2012 23:40 Edited by author 16.10.2012 23:39 |
My solution for java | boyfox | 1228. Array | 24 Oct 2009 17:31 | 1 |
import java.util.Scanner; public class T1228 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int[] a = new int[n+1]; for (int i = 1; i <=n; i++) { a[i] = in.nextInt(); } k -=1; int t=1; while (k!=0) { System.out.print((k/a[t])+" "); k = k%a[t]; t++; } } } |
All done but I can't understend how it mast do? help please me. Thencks | I am david. Tabo. | 1228. Array | 8 Jan 2008 06:12 | 3 |
|
No subject | Я крыса которая съест тебя! | 1228. Array | 27 Dec 2007 01:01 | 3 |
No subject Я крыса которая съест тебя! 16 Dec 2007 03:02 Edited by author 12.01.2008 04:09 Edited by author 12.01.2008 04:10 Edited by author 12.01.2008 04:10 |
What's wrong??? | Yarik | 1228. Array | 4 Jan 2003 04:54 | 1 |
var n, s, p, i: longint; d, k: array[1..21]of longint; begin readln(n, s); for i:=1 to n do readln(d[i]); k[n]:=d[n-1]; p:=k[n]; for i:=n-1 downto 2 do begin k[i]:=d[i-1] div p; p:=p*k[i]; end; k[1]:=s div p; for i:=1 to n-1 do write(k[i]-1, ' '); writeln(k[n]-1); end. |
Is last multiplier Dn always == 1 ? | Dirty | 1228. Array | 27 Dec 2002 15:18 | 2 |
Yes. It follows from the task statement. |
Is it: ? | ss | 1228. Array | 13 Nov 2002 13:50 | 1 |
find all K such that 1+ sumof (Di*Ki) i=1->N = S ? |
All done but I can't understend how it mast do? help please me. Thencks. ho can send me AC Program. tabo2001@posta.ge | I am david. Tabo. | 1228. Array | 5 Nov 2002 20:10 | 1 |
|