結果
| 問題 |
No.339 何人が回答したのか
|
| コンテスト | |
| ユーザー |
rsk0315
|
| 提出日時 | 2019-06-20 18:11:54 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 313 bytes |
| コンパイル時間 | 164 ms |
| コンパイル使用メモリ | 30,720 KB |
| 最終ジャッジ日時 | 2025-01-07 05:01:17 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 61 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
main.cpp:16:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d", &a);
| ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio>
#include <utility>
int gcd(int m, int n) {
while (n) std::swap(m %= n, n);
return m;
}
int main() {
int n;
scanf("%d", &n);
int g = 100;
for (int i = 0; i < n; ++i) {
int a;
scanf("%d", &a);
g = gcd(g, a);
}
printf("%d\n", 100/g);
}
rsk0315