Submission #8401126
Source Code Expand
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; // 1の数を表す変数 int count = 0; int countp = 0; int countm = 0; // 9文字の式に限定していることに注意 for (int i = 0; i < S.size(); i++) { // 1があればcountを増やす if (S.at(i) == '1') { count++; } if (S.at(i) == '+'){ countp++; } if (S.at(i) == '-'){ countm++; } } cout << (1 + countp - countm) << endl; }
Submission Info
Submission Time | |
---|---|
Task | EX12 - 1.12 |
User | yutori1515 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 525 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | sample01.txt, sample02.txt, sample03.txt, sample04.txt, test01.txt, test02.txt, test03.txt, test04.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample01.txt | AC | 1 ms | 256 KB |
sample02.txt | AC | 1 ms | 256 KB |
sample03.txt | AC | 1 ms | 256 KB |
sample04.txt | AC | 1 ms | 256 KB |
test01.txt | AC | 1 ms | 256 KB |
test02.txt | AC | 1 ms | 256 KB |
test03.txt | AC | 1 ms | 256 KB |
test04.txt | AC | 1 ms | 256 KB |