Submission #2718199


Source Code Expand

Copy
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <utility>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define For(i, a, b) for(int i = (a); i < (b); i++)
#define Rep(i, n) For(i, 0, (n))
#define Rrep(i, n) for(int i = (n - 1); i >= 0; i--)
#define pb push_back

const int inf = 999999999;
const int mod = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main(){
	int a = 0, b = 0; string s; cin >> s;
	Rep(i, 4){
		if(s[i] == '+'){
			a++;
		}else{
			b++;
		}
	}
	cout << a - b << endl;
}

Submission Info

Submission Time
Task A - Eating Symbols Easy
User niimi
Language C++14 (GCC 5.4.1)
Score 100
Code Size 683 Byte
Status
Exec Time 2 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample1.txt, sample2.txt, sample3.txt
All 100 / 100 sample1.txt, sample2.txt, sample3.txt, 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
1.txt 2 ms 256 KB
2.txt 2 ms 256 KB
3.txt 2 ms 256 KB
4.txt 1 ms 256 KB
5.txt 2 ms 256 KB
sample1.txt 2 ms 256 KB
sample2.txt 2 ms 256 KB
sample3.txt 2 ms 256 KB