結果
問題 | No.339 何人が回答したのか |
ユーザー | butsurizuki |
提出日時 | 2017-01-10 11:58:16 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 347 bytes |
コンパイル時間 | 245 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-18 00:21:59 |
合計ジャッジ時間 | 1,709 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:21:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | scanf("%d",&n); | ^~~~~~~~~~~~~~ main.c:23:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 23 | scanf("%d",&a); | ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int gcd(int x,int y){ int z; while(y){ z = x % y; x = y; y = z; } return x; } int lcm(int x,int y){ int z; z = gcd(x,y); return x*y/z; } int main(void) { int n,i,a,t = 1; scanf("%d",&n); for(i = 1;i <= n;i++){ scanf("%d",&a); a = gcd(100,a); a = 100/a; t = lcm(a,t); } printf("%d\n",t); return 0; }