結果

問題 No.481 1から10
コンテスト
ユーザー vjudge1
提出日時 2026-02-11 02:31:47
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 650 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,050 ms
コンパイル使用メモリ 337,632 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-21 06:35:57
合計ジャッジ時間 3,211 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/unique_ptr.h:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/memory:80,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:58,
                 from 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:
/home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/ostream.h:212:25: warning: 'n' may be used uninitialized [-Wmaybe-uninitialized]
  212 |       { return _M_insert(__n); }
      |                ~~~~~~~~~^~~~~
main.cpp: In function 'void solve()':
main.cpp:21:5: note: 'n' was declared here
   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