結果
問題 | No.339 何人が回答したのか |
ユーザー |
![]() |
提出日時 | 2016-01-29 22:26:43 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,834 bytes |
コンパイル時間 | 804 ms |
コンパイル使用メモリ | 95,408 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-21 17:58:24 |
合計ジャッジ時間 | 2,460 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <ctime> #include <set> #include <iostream> #include <memory> #include <string> #include <cstring> #include <vector> #include <algorithm> #include <functional> #include <fstream> #include <sstream> #include <complex> #include <stack> #include <queue> #include <cstring> #include <numeric> #include <cassert> using namespace std; static const double EPS = 1e-10; typedef long long ll; #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rev(i,n) for(int i=(n)-1;(i)>=0;(i)--) #define all(a) (a).begin(),(a).end() #define pb(a) push_back(a) #define bitcount(b) __builtin_popcount(b) template<typename T, typename S> vector<T>& operator<<(vector<T>& a, S b) { a.push_back(b); return a; } template<typename T> void operator>>(vector<T>& a, int b) {while(b--)if(!a.empty())a.pop_back();} bool isprime(int n){ if(n<2)return false; for(int i=2;i*i<=n;i++)if(n%i==0)return false; return true;} ll b_pow(ll x,ll n){return n ? b_pow(x*x,n/2)*(n%2?x:1) : 1ll;} string itos(int n){stringstream ss;ss << n;return ss.str();} template<class T> ostream& operator<<(ostream& os, const pair<T,T>& p) { os << "(" << p.first << "," << p.second << ")"; return os; } template<class T> ostream& operator<<(ostream& os, const vector<T>& arr) { os << "{"; for(int i = 0 ; i < arr.size() ; i++) os << (i==0?"":",") << arr[i]; os << "}"; return os; } vector<int> a; int f(int x){ int tot = 0; for(int i = 0 ; i < a.size() ; i++){ if( x * a[i] % 100 != 0 ){ return 0; } tot += x * a[i] / 100; } return x == tot; } int main(){ int N; cin >> N; for(int i = 0 ; i < N ; i++){ int x; cin >> x; a.push_back(x); } for(int i = 1 ; ; i++){ if(f(i)){ cout << i << endl; return 0; } } }