結果
| 問題 |
No.481 1から10
|
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2020-03-16 13:33:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 260 bytes |
| コンパイル時間 | 1,377 ms |
| コンパイル使用メモリ | 167,764 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-28 02:46:36 |
| 合計ジャッジ時間 | 1,988 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:19:17: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
19 | cout << ans << endl;
| ^~~
main.cpp:14:13: note: 'ans' was declared here
14 | int ans;
| ^~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> b( 10 );
for( int i = 0; i < 9; i++ ) {
int B;
cin >> B;
B--;
b[B] = 1;
}
int ans;
for( int i = 0; i < 10; i++ ) {
if( b[i] == 0 ) ans = i + 1;
}
cout << ans << endl;
}
forest3