4

AtCoder Regular Contest 147 Announcement

 1 year ago
source link: http://codeforces.com/blog/entry/106585
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

AtCoder Regular Contest 147 Announcement

We will hold AtCoder Regular Contest 147.

The point values will be 300-500-600-700-800-1100.

We are looking forward to your participation!

27 hours ago, # |

As one of the Writers, I hope all participants enjoy the contest. Good luck!

27 hours ago, # |

As one of the writers, good luck and have fun!

71 minute(s) ago, # |

But there might be a small problem of time,becase COMPFEST 14 — Preliminary Online Mirror will begin at 21:35(UTC+8 for me)

65 minutes ago, # |

Does anyone see the tasks?

  • 42 minutes ago, # ^ |

    Yes, I see it.

1 minute ago, # |

Rev. 2  

0

include <bits/stdc++.h>

using namespace std; signed main() { int n; cin>>n; vector vv; for(int i=0;i<n;i++) { int x; cin>>x; vv.push_back(x); } int total=0; sort(vv.begin(),vv.end()); while(vv.size()>1) { int a1=vv[vv.size()-1]; vv.pop_back(); reverse(vv.begin(),vv.end()); int a2=vv[vv.size()-1]; if(a1%a2!=0) vv.push_back(a1%a2); reverse(vv.begin(),vv.end()); total++; } cout<<total<<"\n"; }

ATCODER A


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK