Show all threads Hide all threads Show all messages Hide all messages |
If you have WA7. | Keworker | 1617. Flat Spots | 19 Jun 2021 22:30 | 1 |
24 12 12 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Right Answer is 6 |
C++ Hint | 0blivium | 1617. Flat Spots | 2 Oct 2018 09:32 | 2 |
You can solve this problem quickly by using the multiset and set data structures. To find the answer, use the set iterator. My solution is similar: map x to x - 600 and use array to count its frequency. Then accumulate all the freq[x] / 4 and just print the sum. As the diameter is constrained in [600,700], there will be at most 101 different values. |
No subject | a2ch | 1617. Flat Spots | 6 Aug 2018 18:22 | 1 |
"Some tram drivers are fans of fast driving, and they damage both rails and their trams. If a tram accelerates to a high speed, say 80 kilometers per hour, and then brakes sharply before a stop, it goes some distance skidding." Is this "initial D" reference?! Edited by author 19.08.2018 20:53 |
No subject | IT | 1617. Flat Spots | 13 Feb 2018 16:03 | 2 |
Edited by author 12.03.2016 20:21 n = int(input()) a = [] summ = 0 for i in range(n): a.append(int(input())) b = list(set(a)) for i in range(len(b)): c=a.count(b[i]) if c > 3: summ+=c//4 print(summ) |
Why wrong?????????????? | IT | 1617. Flat Spots | 12 Mar 2016 20:21 | 1 |
var A:array[1..1000] of integer; i,s,n,b,r,m,j,k,d,q:integer; begin s:=0; r:=0; q:=0; read(n); for i:=1 to n do readln(A[i]); begin for i := 1 to n-1 do for j := 1 to n-i do if A[j] > A[j+1] then begin k := A[j]; A[j] := A[j+1]; A[j+1] := k end; end; for i:=1 to (n-1) do begin d:=i+q; if (A[d]=A[d+1]) then s:=s+1 else s:=0; if s=3 then begin r:=r+1; s:=0; q:=1+q; end; end; write(r); end. |
The Power of C# --->AC | Hikmat Ahmedov | 1617. Flat Spots | 17 Dec 2014 09:39 | 4 |
[code deleted] Edited by moderator 19.11.2019 22:49 [code deleted] Edited by moderator 19.11.2019 22:50 [code deleted] Edited by author 07.10.2014 17:38 Edited by moderator 19.11.2019 22:50 [code deleted] Edited by moderator 19.11.2019 22:50 |
What about 4-th test?Please help.Here is source: | Search | 1617. Flat Spots | 4 Dec 2014 17:01 | 10 |
#include<iostream> #include<algorithm> using namespace std; int main() { int i,n,a[155],k=0; cin>>n; for(i=0;i<n;i++) cin>>a[i]; sort(a,a+n+1); for(i=0;i<n;i++) if(a[i]==a[i+3]) k++; cout<<k; return 0; } Re: * Search 1 Apr 2008 20:04 Re: * tolia 7 Mar 2009 18:40 #include<iostream> #include<algorithm> using namespace std; int main() { int i,n,a[155],k=0; cin>>n; for(i=0;i<n;i++) cin>>a[i]; sort(a,a+n+1); for(i=0;i<n;i++) if(a[i]==a[i+3]) k++; cout<<k; return 0; } Re: * Adhambek 26 May 2013 09:48 look at my test .... use your program 10 600 600 600 600 600 600 600 600 600 600 I think your answer is 7... But true answer is 2! Edited by author 26.05.2013 09:50 Re: * Ivan Metelev 4 Dec 2014 17:01 Sorry, but true answer is 1, on my opinion Edited by author 04.12.2014 17:01 Edited by author 04.12.2014 17:02 Re: * LLIRIK 3 Apr 2008 22:59 5 600 600 600 600 600 what is the answer for this test? my programm writes 1 isn't it right?? Re: * Rashid Gaziyev 26 Oct 2010 11:00 |
Wrong answer in Java 1.7 test 4 please help me | Axmadjon | 1617. Flat Spots | 2 May 2014 19:33 | 1 |
import java.util.ArrayList; import java.util.Scanner; public class _1617 { public static void main(String[] args) throws Exception { Scanner s = new Scanner(System.in); ArrayList<Integer> list = new ArrayList<Integer>(); int n, i, count1 = 0, count2 = 0; n = s.nextInt(); int[] res = new int[n]; for (i = 0; i < n; i++) { res[i] = s.nextInt(); list.add(res[i]); } int e = 0; for (i = 0; i < list.size(); i++) { if (list.get(e).equals(res[i])) { count1++; if (count1 == 4) { count2++; } } } System.out.println(count2); } } |
hint | garra | 1617. Flat Spots | 28 Apr 2012 21:13 | 2 |
hint garra 18 Feb 2012 07:17 all the tires are of the same size and not different telling coz got an ac Edited by author 18.02.2012 07:18 And there are can be more than 4 tires the same size. Good luck! |
wa test 5 | garra | 1617. Flat Spots | 8 Feb 2012 08:51 | 1 |
here is my code #include<stdio.h> #include<stdlib.h> int main() {
int n,a[150],i,j,c[150]={0},s=0,r;
scanf("%d",&n);
for(i=0;i<n;i++) {
scanf("%d",&a[i]);
}
for(i=0;i<n;i++) { for(j=i;j<n;j++) { if(a[i]==a[j]) { c[i]++; } } }
for(i=0;i<n;i++) { r=c[i]/4; s=s+r; }
if(n==c[0]) { printf("%d\n",c[0]/4); } else { printf("%d\n",s); }
return 0;
} |
WA 4. Help me I can not find my mistake!!! | Abdulmalik MSU_Tashkent | 1617. Flat Spots | 28 Nov 2011 00:33 | 1 |
#include <stdio.h> int main(){ int i,n,j,m[151],d; scanf("%d",&n); for(i=0;i<n;++i) scanf("%d",&m[i]); for(i=0;i<n;++i) for(j=0;j<n;++j) if(m[i]<m[j]){ d=m[i]; m[i]=m[j]; m[j]=d; } d=0; for(i=0;i<n-3;++i) if(m[i]==m[i+1]) if(m[i+1]==m[i+2]) if(m[i+2]==m[i+3]) if(m[i+3]>=600) if(m[i+3]<=700){ ++d; i=i+4; }
printf("%d",d); return 0; } |
WA#4 Help please. | Saimon | 1617. Flat Spots | 15 Nov 2011 02:09 | 1 |
This is my source: var arn:array[1..150]of integer; i,j,n,ans,t:integer; begin t:=1;ans:=0; readln(n); for i:=1 to n do readln(arn[i]); for i:=1 to n do if arn[i]<>0 then begin for j:=1 to n do begin if (i<>j) and (arn[i]=arn[j]) then begin t:=t+1; arn[j]:=0 end; if t=4 then begin t:=1; ans:=ans+1; end; end; t:=1; end; writeln(ans); end. Can anybody tell me, where mystake? I think to my programm is right. What is input in test 4?Help, please. |
Accepted | Aydar1 | 1617. Flat Spots | 8 Nov 2011 21:31 | 1 |
|
Danila, I need help | r2d2 | 1617. Flat Spots | 23 Oct 2011 16:37 | 1 |
Can somebody help me? I've got WA on the test №3. I've got no idea what's wrong. Please, help me. public void solve()throws Exception{ int n = nextInt(); int [] a = new int[101]; int c =0,b; for (int i=0;i<n;i++){ b = nextInt(); a[b-600]++; } for (int i=0;i<101;i++){ c+=a[i]>>1; } out.println(c>>2); } |
The description is wrong: Every car has 4 wheels and all 4 be the same size. | Nic Roets | 1617. Flat Spots | 29 Aug 2011 17:41 | 1 |
The description says 4 pairs. That means 8 wheels. I got WA when I used that definition. |
Why WA? | Georgeek | 1617. Flat Spots | 6 Jul 2011 12:15 | 1 |
import java.util.Arrays; import java.util.Scanner; public class Example2 { private static int[] col; private static int count = 1; private static int superCount = 0; public static void main(String[] args) { try { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); if (a>=0 && a<=150){ col = new int[a]; for (int i = 0; i < a; i++) { col[i]=scanner.nextInt(); if(col[i]<600 || col[i]>700){ //System.out.print("0"); throw new Exception(); } } Arrays.sort(col); for (int i = 1; i < col.length; i++) { if (col[i]==col[i-1]) { count ++; if (count==4) { superCount ++; count=1; } }else count=1; } System.out.print(superCount); }else if (a>=0){System.out.print("0");} } catch (Exception e) {} } } |
Please give a few tests | Fedotov =NRZ= Alexander [ TVER ] | 1617. Flat Spots | 11 May 2011 22:32 | 1 |
|
please tell me test № 5 | Yan_Kurganov (Kovrov STA) | 1617. Flat Spots | 15 Nov 2010 11:04 | 3 |
why the wrong answer? please tell me test № 5. sorry for bad english. Edited by author 09.11.2010 02:45 #include <iostream> #include <algorithm> using namespace std; int main() { int mass[160]={0}; int n,i,kolvo=0,xz=1; cin>>n; for (i = 0; i < n; i++) { cin>>mass[i]; } sort(&mass[0],&mass[n]); for (i = 1; i < n; i++) { if (mass[i]==mass[i-1]) { xz++; } if (mass[i]!=mass[i+1]) { if (xz/4>=1) { kolvo+=xz/4.0; xz=1; } } } cout<<kolvo; return 0; } You can use not only the wheels of the same size |
Commemorate my 100th Accepted... | lrcrichard | 1617. Flat Spots | 16 Sep 2010 22:20 | 1 |
|
help me!!! What is 4th test? | Ezio - Altair | 1617. Flat Spots | 16 Jun 2010 23:21 | 2 |
help me!!! What is 4th test? I got Ac help me!!! What is 4th test? |