結果
| 問題 |
No.481 1から10
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-13 15:30:51 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 875 bytes |
| コンパイル時間 | 763 ms |
| コンパイル使用メモリ | 93,628 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-28 10:02:10 |
| 合計ジャッジ時間 | 1,387 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 7 WA * 1 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:35:22: warning: 'last' may be used uninitialized [-Wmaybe-uninitialized]
35 | cout << last + 1 << endl ;
| ^
main.cpp:31:9: note: 'last' was declared here
31 | int last ;
| ^~~~
ソースコード
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <complex>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <typeinfo>
#include <cassert>
#include <fstream>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i = a;i<b;i++)
#define SSTR( x ) static_cast< std::ostringstream & >( \
( std::ostringstream() << std::dec << x ) ).str()
#define ALL(s) (s).begin(), (s).end()
using namespace std;
typedef long long unsigned int llu;
typedef long long ll;
int main (){
string s;
while (cin >> s){
int last ;
int next ;
sscanf(s.c_str(),"%d",&next);
if(next - last != 1){
cout << last + 1 << endl ;
break;
}
last = next;
}
return 0;
}