結果
| 問題 | No.2706 One Nafmo |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2024-04-23 21:26:03 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 402 bytes |
| 記録 | |
| コンパイル時間 | 1,925 ms |
| コンパイル使用メモリ | 190,712 KB |
| 最終ジャッジ日時 | 2025-02-21 08:45:28 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | freopen(task".inp","r",stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
main.cpp:9:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | freopen(task".out","w",stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main()
{
#define task "apencil"
if(fopen(task".inp","r"))
{
freopen(task".inp","r",stdin);
freopen(task".out","w",stdout);
}
cin.tie(0)->sync_with_stdio(0);
int A,B,X;
cin>>A>>B>>X;
int tongbut=0,tongtien=0;
while(tongbut<X)
{
tongtien+=B;
tongbut+=A;
}
cout<<tongtien;
}
vjudge1