結果
| 問題 |
No.3157 Nabeatsu
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-05-23 17:12:25 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 411 bytes |
| コンパイル時間 | 3,133 ms |
| コンパイル使用メモリ | 275,360 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-05-23 17:12:33 |
| 合計ジャッジ時間 | 7,081 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 42 WA * 3 |
ソースコード
// WA
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
cin >> s;
int l=s.size();
for(int i=0;i<l;i++){
if(s[i]=='3'){
s[i]='2';
for(int j=i+1;j<l;j++){
s[j]='9';
}
break;
}
}
int ds=0;
for(auto &nx : s){
ds+=(nx-'0');
}
if(ds%3==0){s[l-1]--;}
cout << s << "\n";
return 0;
}