#P339A. Helpful Maths Description Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation. The teacher has written down the sum of multiple numbers. Pupils should calculate the sum. To make the calculation easier, the sum only c...
codeforces 339A.Helpful Maths B.Xenia and Ringroad 两水题 A.题意就是把字符串里面的数字按增序排列,直接上代码。 #include <string.h> #include <stdio.h> #include <algorithm> using namespace std; int main() { char s[1005]; int num[105]; while (scanf("%s" , s) != EOF) { int l...
题目链接:http://www.codeforces.com/problemset/problem/339/A 题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列。 C++代码: C++
You've got the sum that was written on the board. Rearrange the summans and print the sum in such a way that Xenia can calculate the sum. Input The first line contains a non-empty strings— the sum Xenia needs to count. Stringscontains no spaces. It only contains digits and characters...
1+2+3 input 1+1+3+1+3 output 1+1+1+3+3 input 2 output 2 这种题目由于keyword少,所以就能够转换为counting sort的思想去解决。这样时间效率就仅仅有O(n)了。 void HelpfulMaths() { int A[4] = {0}; int a; while (scanf("%d", &a) != EOF) ...
[ An Ac a Day ^_^ ] CodeForces 339A Helpful Maths 熄灯了才想起来没写博客 赶紧水一道题碎觉…… 1#include<stdio.h>2#include<iostream>3#include<algorithm>4#include<math.h>5#include<string.h>6#include<string>7#include8#include<set>9#include<vector>10#include<queue>11#defineM(a,b) ...
A. Helpful Maths time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation. ...