結果
| 問題 |
No.736 約比
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-01 01:44:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 321 bytes |
| コンパイル時間 | 1,820 ms |
| コンパイル使用メモリ | 192,864 KB |
| 最終ジャッジ日時 | 2025-01-07 10:24:34 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 65 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:11: warning: ‘n’ is used uninitialized [-Wuninitialized]
7 | ll a[n];
| ^
main.cpp:6:9: note: ‘n’ was declared here
6 | int n;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n;
ll a[n];
for (int i=0; i < n; i++)cin>>a[i];
ll g=a[0];
for (int i = 1; i < n; i++) g = __gcd(g, a[i]);
cout<<a[0]/g;
for (int i=1;i<n;i++) {
cout<<':'<<a[i]/g;
}
puts("");
return 0;
}