結果
| 問題 |
No.2110 012 Matching
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-28 22:09:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 66 ms / 2,000 ms |
| コード長 | 364 bytes |
| コンパイル時間 | 314 ms |
| コンパイル使用メモリ | 27,392 KB |
| 最終ジャッジ日時 | 2025-02-08 14:34:23 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d", &total_testcases);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%lld %lld %lld", &A, &B, &C);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<cstdio>
using ll = long long;
int main(){
int total_testcases;
scanf("%d", &total_testcases);
for (int testcase_i = 1; testcase_i <= total_testcases; ++testcase_i){
ll A, B, C;
scanf("%lld %lld %lld", &A, &B, &C);
ll answer = 0;
printf("%lld\n", A <= C ? (A<<1) + ((C-A)>>1) + ((B>>1)<<1) : (C<<1) + B);
}
}