結果
| 問題 |
No.51 やる気の問題
|
| コンテスト | |
| ユーザー |
Haijinn
|
| 提出日時 | 2017-03-16 21:21:03 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 217 bytes |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 20,608 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-04 02:44:14 |
| 合計ジャッジ時間 | 835 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%ld",&a);
| ^~~~~~~~~~~~~~~
main.c:11:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%ld",&b);
| ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void)
{
long a;
long b;
long i;
long g;
scanf("%ld",&a);
scanf("%ld",&b);
g=b;
for(i=0;i<g-1;i++){
a-=a/(b*b);
b--;
//printf("%d %d\n",a,b);
}
printf("%ld\n",a);
return 0;
}
Haijinn