Submission #63002513
Source Code Expand
Copy
#include<bits/stdc++.h>using namespace std;#define int long long#define INF 10000000009#define MOD 1000000007#define endl '\n'typedef pair<int,int> pll;map<int,int>mp;const int N=2e5+10;int a[N],b[N];void solve(){string s;cin>>s;string ch="";for(int i=0;i<s.length();i++){if(s[i]!='2'){s.erase(i,1);i--;
#include<bits/stdc++.h> using namespace std; #define int long long #define INF 10000000009 #define MOD 1000000007 #define endl '\n' typedef pair<int,int> pll; map<int,int>mp; const int N=2e5+10; int a[N],b[N]; void solve() { string s; cin>>s; string ch=""; for(int i=0;i<s.length();i++) { if(s[i]!='2') { s.erase(i,1); i--; } } cout<<s<<endl; } signed main() { int t; t=1; // cin>>t; while(t--) { solve(); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 22222 |
User | CheckLove |
Language | C++ 20 (gcc 12.2) |
Score | 100 |
Code Size | 481 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3568 KB |
Compile Error
Main.cpp: In function ‘void solve()’: Main.cpp:16:22: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 16 | for(int i=0;i<s.length();i++) | ~^~~~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample00.txt, sample01.txt, sample02.txt |
All | sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 1 ms | 3448 KB |
sample01.txt | AC | 1 ms | 3368 KB |
sample02.txt | AC | 1 ms | 3496 KB |
testcase00.txt | AC | 1 ms | 3468 KB |
testcase01.txt | AC | 1 ms | 3564 KB |
testcase02.txt | AC | 1 ms | 3432 KB |
testcase03.txt | AC | 1 ms | 3564 KB |
testcase04.txt | AC | 1 ms | 3524 KB |
testcase05.txt | AC | 1 ms | 3432 KB |
testcase06.txt | AC | 1 ms | 3528 KB |
testcase07.txt | AC | 1 ms | 3532 KB |
testcase08.txt | AC | 1 ms | 3500 KB |
testcase09.txt | AC | 1 ms | 3564 KB |
testcase10.txt | AC | 1 ms | 3468 KB |
testcase11.txt | AC | 1 ms | 3568 KB |
testcase12.txt | AC | 1 ms | 3564 KB |
testcase13.txt | AC | 1 ms | 3432 KB |
testcase14.txt | AC | 1 ms | 3524 KB |