結果
| 問題 |
No.2194 兄弟の掛け引き
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-26 14:40:28 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 491 bytes |
| コンパイル時間 | 325 ms |
| コンパイル使用メモリ | 24,448 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-26 14:40:29 |
| 合計ジャッジ時間 | 1,373 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 5 WA * 9 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d %d %d",&a,&b,&c);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdbool.h>
void main(void){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
bool nFlg = false;
for(int i = 1 ; i <= 200000 ; i++){
if(c >= b && (c+b)/a == i){
printf("%d\n",i);
if(!nFlg){
nFlg = true;
}
}else if(c < b && c/a == i){
printf("%d\n",i);
if(!nFlg){
nFlg = true;
}
}
}
if(!nFlg){
printf("-1");
}
}
Maeda