結果
問題 | No.736 約比 |
ユーザー | claw88 |
提出日時 | 2018-09-28 21:51:45 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 2,528 bytes |
コンパイル時間 | 965 ms |
コンパイル使用メモリ | 114,340 KB |
実行使用メモリ | 27,596 KB |
最終ジャッジ日時 | 2024-10-12 06:12:00 |
合計ジャッジ時間 | 4,367 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 30 ms
27,448 KB |
testcase_01 | AC | 29 ms
25,280 KB |
testcase_02 | AC | 30 ms
27,316 KB |
testcase_03 | AC | 28 ms
25,424 KB |
testcase_04 | AC | 29 ms
25,536 KB |
testcase_05 | AC | 29 ms
25,664 KB |
testcase_06 | AC | 29 ms
25,272 KB |
testcase_07 | AC | 29 ms
25,280 KB |
testcase_08 | AC | 30 ms
25,284 KB |
testcase_09 | AC | 29 ms
25,280 KB |
testcase_10 | AC | 30 ms
25,136 KB |
testcase_11 | AC | 29 ms
25,292 KB |
testcase_12 | AC | 28 ms
25,412 KB |
testcase_13 | AC | 29 ms
25,264 KB |
testcase_14 | AC | 28 ms
27,596 KB |
testcase_15 | AC | 30 ms
27,192 KB |
testcase_16 | AC | 29 ms
25,540 KB |
testcase_17 | AC | 30 ms
27,472 KB |
testcase_18 | AC | 30 ms
27,340 KB |
testcase_19 | AC | 30 ms
25,264 KB |
testcase_20 | AC | 29 ms
25,264 KB |
testcase_21 | AC | 30 ms
27,340 KB |
testcase_22 | AC | 31 ms
25,552 KB |
testcase_23 | AC | 30 ms
27,468 KB |
testcase_24 | AC | 30 ms
27,340 KB |
testcase_25 | AC | 30 ms
25,280 KB |
testcase_26 | AC | 30 ms
27,460 KB |
testcase_27 | AC | 31 ms
27,336 KB |
testcase_28 | AC | 29 ms
27,316 KB |
testcase_29 | AC | 29 ms
25,280 KB |
testcase_30 | AC | 29 ms
25,136 KB |
testcase_31 | AC | 29 ms
25,168 KB |
testcase_32 | AC | 30 ms
27,064 KB |
testcase_33 | AC | 30 ms
25,396 KB |
testcase_34 | AC | 29 ms
25,516 KB |
testcase_35 | AC | 28 ms
25,536 KB |
testcase_36 | AC | 29 ms
23,092 KB |
testcase_37 | AC | 30 ms
23,224 KB |
testcase_38 | AC | 30 ms
25,408 KB |
testcase_39 | AC | 29 ms
23,476 KB |
testcase_40 | AC | 29 ms
27,340 KB |
testcase_41 | AC | 30 ms
27,204 KB |
testcase_42 | AC | 31 ms
25,168 KB |
testcase_43 | AC | 29 ms
25,416 KB |
testcase_44 | AC | 29 ms
25,276 KB |
testcase_45 | AC | 29 ms
25,296 KB |
testcase_46 | AC | 29 ms
27,468 KB |
testcase_47 | AC | 29 ms
27,208 KB |
testcase_48 | AC | 29 ms
25,172 KB |
testcase_49 | AC | 30 ms
25,144 KB |
testcase_50 | AC | 30 ms
27,340 KB |
testcase_51 | AC | 30 ms
25,160 KB |
testcase_52 | AC | 29 ms
25,544 KB |
testcase_53 | AC | 29 ms
25,280 KB |
testcase_54 | AC | 29 ms
27,476 KB |
testcase_55 | AC | 30 ms
25,464 KB |
testcase_56 | AC | 30 ms
27,324 KB |
testcase_57 | AC | 30 ms
23,224 KB |
testcase_58 | AC | 30 ms
25,416 KB |
testcase_59 | AC | 30 ms
27,448 KB |
testcase_60 | AC | 30 ms
25,520 KB |
testcase_61 | AC | 28 ms
25,272 KB |
testcase_62 | AC | 28 ms
23,472 KB |
testcase_63 | AC | 29 ms
25,424 KB |
testcase_64 | AC | 29 ms
25,264 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; using System.IO; //using System.Text; //using System.Text.RegularExpressions; //using System.Globalization; //using System.Diagnostics; using static System.Console; //using System.Numerics; //using static System.Math; //using pair = Pair<int, int>; class Program { static void Main() { //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false }); new Program().solve(); Out.Flush(); } Scanner cin = new Scanner(); readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑ readonly int mod = 1000000007; void chmax<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? b : a; } void chmin<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? a : b; } void solve() { int N = cin.nextint; var A = cin.scanlong; long m = A[0]; for (int i = 1; i < N; i++) { m = gcd(m, A[i]); } WriteLine(string.Join(":", A.Select(i => i / m).ToArray())); } long gcd(long a, long b) { return (b != 0) ? gcd(b, a % b) : a; } long lcm(long a, long b) { return a / gcd(a, b) * b; } //ax + by = gcd(a, b)となるx, yを求める long extgcd(long a, long b, out long x, out long y) { long g = a; if (b != 0) { g = extgcd(b, a % b, out y, out x); y -= (a / b) * x; } else { x = 1; y = 0; } return g; } } class Scanner { string[] s; int i; char[] cs = new char[] { ' ' }; public Scanner() { s = new string[0]; i = 0; } public string[] scan { get { return ReadLine().Split(); } } public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } } public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } } public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } } public string next { get { if (i < s.Length) return s[i++]; string st = ReadLine(); while (st == "") st = ReadLine(); s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); i = 0; return next; } } public int nextint { get { return int.Parse(next); } } public long nextlong { get { return long.Parse(next); } } public double nextdouble { get { return double.Parse(next); } } }