#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 numb
Codeforces Round #197 (Div. 2) A. Helpful Maths bfsof 一只退役蒟蒻ACMer(考研备考) 来自专栏 · Codeforces题解 创作声明: 内容包含剧透 水题 #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll arr[1000],a=0; string s; cin>>s; for(ll i=0;i='0...
Helpful Maths,B. Xenia and Ringroad A. Helpful Maths 题目链接: codeforces 339A 题意: 给个字符串,要求将其中的数字从小到大排序 题解: 简单模拟 B. Xenia and Ringroad 题目链接:codeforces 339B 题意: 输入 n和m ,第 i 个点的任务只能在 ai 的......
The first line contains a non-empty strings— the sum Xenia needs to count. Stringscontains no spaces. It only contains digits and characters "+". Besides, stringsis a correct sum of numbers 1, 2 and 3. Stringsis at most 100 characters long. Output Print the new sum that Xenia can co...
codeforces水题100道 第二十五题 Codeforces Round #197 A. Helpful Maths (Div. 2) (strings) 题目链接:http://www.codeforces.com/problemset/problem/339/A 题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列。 C++代码: C++
1. input 1+1+3+1+3 1. output 1+1+1+3+3 1. input 2 1. output 2 1. 这种题目由于keyword少,所以就能够转换为counting sort的思想去解决。这样时间效率就仅仅有O(n)了。 void HelpfulMaths() { int A[4] = {0}; int a; while (scanf("%d", &a) != EOF) ...
codeforces 339A.Helpful Maths B.Xenia and Ringroad 两水题,A.题意就是把字符串里面的数字按增序排列,直接上代码。#include#include#includ
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 = strlen(s); ...
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. ...
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. ...