結果
| 問題 |
No.1437 01 Sort
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-19 23:20:05 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 684 bytes |
| コンパイル時間 | 709 ms |
| コンパイル使用メモリ | 64,256 KB |
| 実行使用メモリ | 13,640 KB |
| 最終ジャッジ日時 | 2024-11-19 01:30:10 |
| 合計ジャッジ時間 | 22,880 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 2 WA * 15 TLE * 7 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main(){
int N;
int O = 0;
string S;
cin >> N;
cin >> S;
for(int i = 0; i < N; i++){
if(S[N - 1] == '0'){
for(int j = N - 1; j < 0; j--){
S[j] = S[j - 1];
}
S[0] = '0';
O++;
}else{
int c = 0;
for(int k = 1; k < N; k ++){
if(S[k] == '0') c++;
}
if(c != 0){
for(int j = N - 1; j < 1; j--){
S[j] = S[j - 1];
}
S[1] = '1';
O++;
}
}
}
cout << O;
}