Submission #1986355
Source Code Expand
#include "bits/stdc++.h" #define rep(a,b) for(int a = 0;a < b;a++) #define REP(i, x, n) for(int i = x; i < n; i++) #define P(a) cout << a << endl #define pb(a) push_back(a) #define mp(a,b) make_pair(a,b) #define ssort(v) sort(v.begin(),v.end()) #define rev(v) reverse(v.begin(),v.end()) #define vP(v) for(int i = 0;i < v.size();i++){cout << v[i];if(i != v.size()-1)cout << endl;} #define vcin(v,n) rep(i,n){int a;cin >> a;v.pb(a);} using namespace std; typedef long long ll; typedef unsigned long long ull; int dx[] = { 1, -1 , 0 , 0 }; int dy[] = { 0, 0, 1, -1 }; ll MOD = 1000000007; void solve(){ string s; cin >> s; int count = 0; rep(i,s.length()){ if(s[i] == '1')count++; } P(count); } int main() { solve(); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Placing Marbles |
User | pantacia1128 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 781 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt |
All | 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 1 ms | 256 KB |
00_example_02.txt | AC | 1 ms | 256 KB |
01.txt | AC | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 1 ms | 256 KB |
06.txt | AC | 1 ms | 256 KB |