結果

問題 No.481 1から10
コンテスト
ユーザー vjudge1
提出日時 2026-02-11 02:31:47
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
結果
WA  
実行時間 -
コード長 650 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,632 ms
コンパイル使用メモリ 340,472 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-02-11 02:31:52
合計ジャッジ時間 4,354 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
次のファイルから読み込み:  /usr/local/gcc-15/include/c++/15.2.0/bits/unique_ptr.h:43,
         次から読み込み:  /usr/local/gcc-15/include/c++/15.2.0/memory:80,
         次から読み込み:  /usr/local/gcc-15/include/c++/15.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:58,
         次から読み込み:  main.cpp:1:
In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]’,
    inlined from ‘void solve()’ at main.cpp:32:7:
/usr/local/gcc-15/include/c++/15.2.0/bits/ostream.h:212:25: 警告: ‘n’ may be used uninitialized [-Wmaybe-uninitialized]
  212 |       { return _M_insert(__n); }
      |                ~~~~~~~~~^~~~~
main.cpp: In function ‘void solve()’:
main.cpp:21:5: 備考: ‘n’ はここで定義されています
   21 | int n;
      |     ^

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
#include<map>
using namespace std;
#define int long long
#define forn(i, a, b) for (int i = a; i < b; i++)
#define vect vector<int>
#define srt(vec) sort(vec.begin(),vec.end())
bool prime(int a)
{
if(a<=1||a%2==0||a%3==0)return 0;
for(int j=5; j*j<=a; j+=6) {
int k=j+2;
if(a%j==0||a%k==0)return 0;
}
return 1;
}
const int N=2e7+10;
//vector<int> vec(N);
void solve()
{
int n;
vect vec(9);
for(int &j:vec)
cin>>j;
srt(vec);
forn(j,0,9)
{
if(vec[j]!=j+1)
{n=j+1;
break;}
}
cout<<n<<endl;
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);

int t = 1;  
//cin >> t;;  
    while (t--)  
        solve();  

    return 0;  
}
0