Show all threads Hide all threads Show all messages Hide all messages |
Test 10: RUB hasn't got 0.000 part. Рубль не имеет тысячной доли, так как минимальная часть - копейка - одна сотая. | Keworker | 1688. Team.GOV! | 21 Jun 2021 12:10 | 1 |
Remember: maximum accuracy can not be more than 10 in minus the secong degree. Запомните: максимальная точность числа не больше 10 в -2 степени. |
WA#11 Give the test,please... | Andranik | 1688. Team.GOV! | 31 Dec 2018 03:43 | 3 |
What is the test #11?Give,please...... I believe test 11 is a test in which Ivan saves himself after the last restaurant. Example: 2000 3 2000 2000 2001 Answer: Free after 3 times. Edited by author 09.01.2011 19:55 Thank you, this is the reason of my WA11. |
accepted | Mikhail | 1688. Team.GOV! | 15 May 2018 09:23 | 1 |
//#pragma GCC optimize("Ofast,no-stack-protector") //#pragma GCC target("avx") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds; using namespace std;
#define re return #define pb push_back #define eb emplace_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define sqrt(x) sqrt(abs(x)) #define mp make_pair #define pi (3.14159265358979323846264338327950288419716939937510) #define fo(i, n) for(int i = 0; i < n; ++i) #define ro(i, n) for(int i = n - 1; i >= 0; --i) #define unique(v) v.resize(unique(all(v)) - v.begin())
template <class T> T abs (T x) { re x > 0 ? x : -x; } template <class T> T sqr (T x) { re x * x; } template <class T> T gcd (T a, T b) { re a ? gcd (b % a, a) : b; } template <class T> int sgn (T x) { re x > 0 ? 1 : (x < 0 ? -1 : 0); }
typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<string> vs; typedef double D; typedef long double ld; typedef long long ll; typedef pair<ll, ll> pll; typedef vector<ll> vll; typedef unsigned long long ull; typedef tree <pair<int, char>, null_type, less<pair<int, char>>, rb_tree_tag, tree_order_statistics_node_update> _tree; int main() { ll n, m, x; cin >> n >> m; n *= 3; fo(i, m) { cin >> x; n -= x; if (n < 0) { cout << "Free after " << i + 1 << " times.\n"; re 0; } } cout << "Team.GOV!\n"; } |
Помогите пж, ошибка в 11 тесте | AlEkSeY~` | 1688. Team.GOV! | 1 Sep 2017 23:03 | 1 |
#include <iostream> #include <cmath> #include <iomanip> #include <vector> #include<algorithm> using namespace std; int main() { long long a, c, d, min, max, n, x;
long double b, e, sum; cin >> a >> n; sum = 0; d = 0; vector<long long> z(n); for (long long i = 0; i < n ; ++i) { cin >> z[i]; } for (long long i = 0; i < n; ++i) {
b = z[i] / 3; sum = sum + b; d = d + 1; if (a < sum) { break; }
} if (a > sum) { cout << "Team.GOV!" << endl; } else { cout << "Free after " << d << " times." << endl; } return 0; } |
for them who have wa on #3 or #11 | amirani | 1688. Team.GOV! | 6 Apr 2017 01:19 | 3 |
Do not use "n/3" or "n div 3" or "input div 3" or "input/3". Do not use any division. while input n, n:=n*3 ; and then you won't have to divide at 3 every input; Sorry for bad english.If any questions please ask. |
test 10......sad.... | xinxin | 1688. Team.GOV! | 9 Oct 2016 16:25 | 1 |
#include "stdio.h" #include "stdlib.h" #include<string.h> int main() { long int m,n,sum=0,a[3001]; scanf("%ld %ld",&n,&m); for(int i=1;i<=m;i++) { scanf("%d",&a[i]); } n=n*3; for(int i=1;i<=m;i++) { sum+=a[i]; if(sum>=n) { printf("Free after %d times.",i); return 0; } } printf("Team.GOV!"); } |
WA#3 : use long long, sum > n*3 | ACSpeed | 1688. Team.GOV! | 12 Feb 2015 22:24 | 2 |
|
sum must be stongly greater than n, or can be equal to leave the team? | partisan | 1688. Team.GOV! | 11 Jun 2014 12:00 | 6 |
I don't know how partisan can get AC In fact, sum(cost1+cost2+...) should be strongly greater than n*3 YES! STRONGLY GREATER ONLY!!! If you'll use >=, you get WA#3 or smth like that >_< I wish them publish more EXACT problem situations... >_> It says here: "the money Vadim had paid for him exceeded n rubles" Since I automatically just thought it had to be only greater or equal to N (because that sounds way more logical), I got WA at test #3 and I had no idea why. This is a programming problem, not a reading one - I think there should be more emphasis on the difficulty of *making the solution*, not on understanding the text and looking for small details hidden between hundreds of words. I know the task is very easy, but that doesn't mean making the statement look more complicated will balance things out. Of course, I wouldn't mind a long statement, as long as there is a recap of everything at its end. For example, something like "For a given integer N(1<=N<=2*10^9), integer M(0<=M<=3000) and M integers a[1,2...M] (1<=a[i]<=2*10^6 inclusive), print the index i for which (a[1]+a[2]+...+a[i])/3 > N. If there is no such index, print "Team.GOV!"" |
Different results for G++ 4.7.2 and VC++ 2010. | Semm | 1688. Team.GOV! | 10 Apr 2014 18:50 | 3 |
My code #include <stdio.h> int main() { long long n, s; int m; scanf("%lld%d",&n,&m); n*=(long long)3; s=0; for(int i=0; i<m; i++) { int t; scanf("%d",&t); s+=t; if(s>n) { printf("Free after %d times.",i+1); return 0; } } printf("Team.GOV!"); return 0; } Works fine on my machine under Linux (g++ 4.8.2). On the OnlineJudge I get WA1 on g++ and AC on VC++ 2010. I think something is wrong. %lld doesn't work for MinGW GCC. Use %I64d |
m=0 | Xel | 1688. Team.GOV! | 25 Apr 2013 15:45 | 1 |
m=0 Xel 25 Apr 2013 15:45 It's strange but for m=0 correct answer is "Team.GOV!". (I think that the correct answer should be "Free after 0 times." |
Why **DOUBLE** does not work ? | sylap | 1688. Team.GOV! | 2 Dec 2012 00:34 | 1 |
I have tried double but it does not work can anybody tell me why ??? |
For AC. | ilya_romanenko | 1688. Team.GOV! | 7 Aug 2012 19:13 | 4 |
For AC. ilya_romanenko 13 Jun 2011 23:19 If you have WA, you must use long long(or int64 in Pascal).And don't use sum/3>n,use sum>n*3.After that you have AC. По русски. Не используйте типы int(или integer). Используйте типы int64(или long long). При сравнение не сумма/3>выхода,а сумма>выход*3. Желаю всем красивых AC! P.S. Sorry for bad English. Well, this method guarantee you simple AC solution, but to decrease time and get finally 0.015 secs you should come back to 32-bit ints. Keep somewhere the undivided part (the remainder) and try to eliminate it with each new value read. At the time you compare the sum to N (or the remains of N to zero) you should not forget the remainder. Write something as "if(n<0||!n&&r)" in the place of condition. Thanks helped very much!!!! |
WA 11 | an100000 | 1688. Team.GOV! | 11 Feb 2012 20:05 | 12 |
WA 11 an100000 28 Feb 2009 14:33 What is wrong with this test? use s > 3*n instead of s / 3 > n whats wrong with this program? Got AC using __int64 instead of long long. Anybody willing to explain why? Whats the difference between __int64 and long long? Edited by author 28.02.2009 15:59 because s can be greater than max(long long). Use int64 instead. But the maximum value of s can be 3000*2*10^6 which is well within the range of long long? I use int64 and s>n*3 but have WA10, what's wrong with this program? maybe you should use qword instead of int64 as i did? do not forget to make them both qword and multiply first by three rather than dividing another one. u can use unsigned long long and get AC But if i use it i have wa 10 Wrong Answer 2 in my pascal code and in this /\ /\ /\ C code use long... something biger than int is needed. |
WA7!! | Moein Fatehi | 1688. Team.GOV! | 21 Jan 2012 02:38 | 3 |
WA7!! Moein Fatehi 21 Sep 2011 21:12 I have wrong answer in my 7th testcase! can you tell me Why? bcs of wrong data types u need 8-byte data type 4-byte are useless my program crashed even on 3rd Edited by author 06.10.2011 03:33 Solved... I forgot that m can be Zero! |
Reason of WA #10 | Aram Taranyan (YSU) | 1688. Team.GOV! | 23 Sep 2011 00:00 | 2 |
To pass this test you should use int64 or long long.Good luck! I think you should use the test like 1000 5 1000 1000 1000 1000 1000 (answer 4) to pass it |
help!!WA10 | brian·hbc | 1688. Team.GOV! | 13 Apr 2010 11:32 | 1 |
what's wrong? program t1688; var h:array [1..3000] of int64; a,p:int64; n,m:int64; b,i,j:longint; begin readln(a,b); for i:=1 to b do readln(h[i]); for i:=1 to b-1 do for j:=b downto i+1 do begin if h[i]>h[j] then begin p:=h[i]; h[i]:=h[j]; h[j]:=p; end; end; for i:=1 to b do begin m:=m+h[i]; if a*3<m then inc(n); end; if n=0 then writeln('Team.GOV!') else writeln('Free after ',b-n,' times.'); end. Edited by author 16.04.2010 11:37 |
WA3 | Liceum#64_Yurik | 1688. Team.GOV! | 12 Mar 2010 00:21 | 5 |
WA3 Liceum#64_Yurik 28 Feb 2009 15:33 What's wrong in my program? I can't find mistake. Anybody knows it? #include<fstream> #include<iostream> #include<cstdio> using namespace std; long n, m; __int64 x, y = 0, n1; int main (){ cin >> n >> m; n1 = 3*n; for (int i = 0; i < m; ++i){ cin >> x; y+=x; if (y >= n1){ cout << "Free after " << i+1 << " times."; return 0; } } cout << "Team.GOV!"; return 0; } Re: WA3 Ivan Zdomskyy 28 Feb 2009 15:49 Re: WA3 Gubarev Valentin (Pskov) 9 Mar 2009 16:33 Re: WA3 Tolya_wolf 15 Jan 2010 11:23 I have the same problem. Algorithm: //----------------------------------------------- #include<stdio.h> void main(void){ int exit,goes,i,sum=0; int sums[3000]; bool free=false; scanf("%d %d",&exit,&goes); exit*=3; for(i=0;i<goes;i++) scanf("%d",&sums[i]);
for(i=0;i<goes;i++) { sum+=sums[i]; if(sum>=exit) {free=true; break;} } if(free==true) printf("Free after %d times.",i+1); else printf("Team.GOV!"); } //---------------------------------------------- Wrong answer, test No.3 your mistakes are very simple - guy's spent money should overwhelm (not equal!) n. |
hint about WA#11 | melkiy | 1688. Team.GOV! | 1 Feb 2010 15:04 | 2 |
People, __int64 not needed! I quickened my program from 0.31 to 0.15 when returned __int64 to int (if that was not a fluctuation). Listen here. During one meal Ivan can save about 2*10^6/3 ~ 666667 rub. This is maximum increment of saved money. So at maximum the saved sum will be 2*10^9 + 666667, which is much less than 2^31-1. My trouble (and most likely yours too) was connected with that i checked if saved sum is strictly greater than n fogetting of the fractional part. This is the case when ( integer part of saved money == n) BUT ( integer part == n AND fractional part > 0) |
use double no need to have long long integer | Anupam Ghosh,Bengal Engg and Sc Uni,MtechIT,2006-09,India | 1688. Team.GOV! | 24 Aug 2009 15:36 | 2 |
u can use double but beware during comparison of double numbers since c language behaves abnormally while comparing floating point numbers. otherwise problem is as easy as it seems. if you are getting WA11 then read problem statement properly again and again. You can solve this problem using only int, not even int64. |
No subject | sokol[TSOGU] | 1688. Team.GOV! | 10 May 2009 11:52 | 1 |
Edited by author 13.05.2009 23:29 Edited by author 13.05.2009 23:29 |