結果
問題 |
No.539 インクリメント
|
ユーザー |
![]() |
提出日時 | 2017-08-11 15:38:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 656 bytes |
コンパイル時間 | 1,592 ms |
コンパイル使用メモリ | 166,468 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 20:36:30 |
合計ジャッジ時間 | 2,270 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 2 WA * 1 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h> typedef long long ll; using namespace std; int INF = 1e9; int MOD = 1e9+7; main(){ int N; cin >> N; cin.ignore(); string s; for(int j = 0;j < N;j++){ int upflag = 0,index; getline(cin,s); for(int i = s.length()-1;i >= 0;i--){ if(s[i] < '0' || s[i] > '9')continue; index = i; if(s[i] == '9'){ s[i] = '0'; upflag = 1; }else{ s[i] += 1; upflag = 0; break; } } if(upflag)s.insert(s.begin()+index,'1'); cout << s << endl; } }