結果

問題 No.3254 Xor, Max and Sum
ユーザー Gia Quyết
提出日時 2025-09-05 21:34:52
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 744 bytes
コンパイル時間 1,906 ms
コンパイル使用メモリ 194,356 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-09-05 21:34:56
合計ジャッジ時間 3,419 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 24 WA * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int32_t main()’:
main.cpp:27:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   27 |         freopen(TASKNAME ".inp","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:28:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   28 |         freopen(TASKNAME ".out","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define db double
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b / __gcd(a,b)
#define I first
#define II second
#define pb push_back
#define ii pair<int,int>
const int INF = 2 * 1e18;
const int N = 3e5 + 1;
const int MOD = 1e9 + 7;    
int n, k;
void solve() {
    cin >> n >> k;
    if (n % 2 == 0) cout << n * k << '\n'; else 
        cout << (n - 1) * k << '\n';
}
int32_t main()
{
    #define TASKNAME "test"
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    if (fopen(TASKNAME ".inp","r" ))
    {
        freopen(TASKNAME ".inp","r",stdin);
        freopen(TASKNAME ".out","w",stdout);
    }
    int t = 1; 
    // cin >> t;
    while (t--) solve();
    return 0;
}
0