Why am I getting WA? I've compared my outputs to uDebug outputs, and it produces the correct one
#include<iostream>
#include<string>
#include<sstream>
#include<cstdio>
using namespace std;
long change (string text) { //converts string to int
long result;
stringstream convert(text);
if ...
Search found 3 matches
- Wed Jun 22, 2016 9:38 am
- Forum: Volume 15 (1500-1599)
- Topic: 1586 - Molar mass
- Replies: 2
- Views: 4627
- Wed Jun 22, 2016 9:36 am
- Forum: Volume 100 (10000-10099)
- Topic: 10025 - The ? 1 ? 2 ? ... ? n = k problem
- Replies: 42
- Views: 18513
Re: 10025 - The ? 1 ? 2 ? ... ? n = k problem
For you guys that get TLE, try this algorithm, it's not very fast, but good enough
You only need to check if, say S is the total sum from 1 to n, then check if S-k is even and larger than -1
You only need to check if, say S is the total sum from 1 to n, then check if S-k is even and larger than -1
- Mon May 30, 2016 1:10 pm
- Forum: Volume 114 (11400-11499)
- Topic: 11401 - Triangle Counting
- Replies: 19
- Views: 14585
Re: 11401 - Triangle Counting
For the fastest time, try to find the function f(n) for even n, and for odd n. They have different f(n).