結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2015-12-17 19:50:56 |
言語 | C90 (gcc 12.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 415 bytes |
コンパイル時間 | 398 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 8,352 KB |
最終ジャッジ日時 | 2024-09-16 07:32:56 |
合計ジャッジ時間 | 12,790 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 33 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:5:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d",&L); | ^~~~~~~~~~~~~~ main.c:6:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&N); | ^~~~~~~~~~~~~~ main.c:8:7: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d",&W[i]); | ^~~~~~~~~~~~~~~~~
ソースコード
# include <stdio.h> int main(void){ int i, j, L, N, tmp, count, W[10000]; count = 0; scanf("%d",&L); scanf("%d",&N); for( i = 0; i < N; i++){ scanf("%d",&W[i]); } for( i = 0; i < N; i++){ for( j = i + 1; j < N; j++){ if( W[i] > W[j]){ tmp = W[i]; W[i] = W[j]; W[j] = tmp; } } } for( i = 0; i < L; i = W[i]){ count +=1; } printf("%d\n",count); return 0; }