結果
問題 |
No.415 ぴょん
|
ユーザー |
|
提出日時 | 2016-10-03 18:48:36 |
言語 | C90 (gcc 12.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 362 bytes |
コンパイル時間 | 105 ms |
コンパイル使用メモリ | 21,376 KB |
実行使用メモリ | 812,580 KB |
最終ジャッジ日時 | 2024-11-21 15:19:05 |
合計ジャッジ時間 | 9,997 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 RE * 3 TLE * 4 MLE * 2 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d %d",&n,&d); | ^~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<stdlib.h> int main(void){ int i,n,d,now=0,cnt=0; scanf("%d %d",&n,&d); int* flag; flag = (int*)malloc(sizeof(int)*n); for(i=1;i<n;i++) flag[i] = 0; flag[0] = 1; while(1){ if(n-1-now >= d) now += d; else now = d-n+now; if(flag[now] == 0) flag[now] = 1; else break; cnt++; } printf("%d\n",cnt); return 0; }