結果
| 問題 |
No.544 Delete 7
|
| コンテスト | |
| ユーザー |
takiteke
|
| 提出日時 | 2017-07-15 00:15:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 609 bytes |
| コンパイル時間 | 532 ms |
| コンパイル使用メモリ | 57,840 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-08 00:20:10 |
| 合計ジャッジ時間 | 2,482 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 33 WA * 15 |
ソースコード
#include<iostream>
#include<string>
using namespace std;
int main() {
int N, plu=0, leng;
string str;
int bi=1, tui;
cin >> N;
str = to_string(N);
leng = str.length();
if (str[leng - 1] == '3') {
plu++;
N++;
}
str = to_string(N);
leng = str.length();
for (int i = 0;i <= leng - 1;i++) {
if (str[i] == '2' && str[i + 1] != '0') {
plu += 10;
N += 10;
}
else if (str[i] == '3' && str[i + 1] == '0') {
plu += 10;
N += 10;
}
}
leng = str.length();
for(int i=0; i<=leng-1; i++) bi = bi * 10;
tui = -(bi - N);
cout << bi - plu << " " << tui << endl;
return 0;
}
takiteke