結果
| 問題 | No.736 約比 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-01 01:45:12 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 319 bytes |
| 記録 | |
| コンパイル時間 | 2,110 ms |
| コンパイル使用メモリ | 193,240 KB |
| 最終ジャッジ日時 | 2025-01-07 10:24:43 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}