結果
| 問題 | No.851 テストケース |
| コンテスト | |
| ユーザー |
integer
|
| 提出日時 | 2019-08-21 22:43:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 3,153 ms |
| コード長 | 593 bytes |
| 記録 | |
| コンパイル時間 | 2,006 ms |
| コンパイル使用メモリ | 199,892 KB |
| 最終ジャッジ日時 | 2025-01-07 14:36:04 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:18:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
18 | scanf("\n");
| ~~~~~^~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for (int i =0;i < (n); ++i)
using namespace std;
typedef long long ll;
int check(string s){
for (auto &&i : s){
if (i==' ')return 0;
}
return 1;
}
int main() {
int n;
cin>>n;
scanf("\n");
string s;
getline(cin,s);
if(check(s)){
vector<ll> ar(3);
ll ans;
ar[0]=stoll(s);
rep(i,2) cin>>ar[i+1];
sort(ar.begin(),ar.end());
ans = ar[0]==ar[1] ? ar[0]*2 : ar[0]+ar[2];
cout<<ans<<endl;
}else{
cout<<"\"assert\""<<endl;
}
return 0;
}
integer