Submission #5219072
Source Code Expand
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace std; bool prime(int n){ if(n==1){ return false; }else if(n==2){ return true; }else{ for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ return false; } } return true; } } long long gcd(long long a, long long b){ if(a<b){ swap(a,b); } if(a%b==0){ return b; }else{ return gcd(b,a%b); } } long long lcm(long long x, long long y){ return (x/gcd(x,y))*y; } class UnionFind { public: //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。 vector<int> Parent; //クラスを作るときは、Parentの値を全て-1にする。 //以下のようにすると全てバラバラの頂点として解釈できる。 UnionFind(int N) { Parent = vector<int>(N, -1); } //Aがどのグループに属しているか調べる int root(int A) { if (Parent[A] < 0) return A; return Parent[A] = root(Parent[A]); } //自分のいるグループの頂点数を調べる int size(int A) { return -Parent[root(A)];//先祖をrootで取っておきたい。 } //AとBをくっ付ける bool connect(int A, int B) { //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける A = root(A); B = root(B); if (A == B) { //すでにくっついてるからくっ付けない return false; } //大きい方(A)に小さいほう(B)をくっ付けたい //大小が逆だったらAとBをひっくり返す。 if (size(A) < size(B)) swap(A, B); //Aのサイズを更新する Parent[A] += Parent[B]; //Bの親をAに変更する Parent[B] = A; return true; } }; int main(){ int m; cin>>m; int v; if(m<100){ cout<<0<<0<<endl; }else if(m<=5000){ v = m*10/1000; if(v<10){ cout<<0; } cout<<v<<endl; }else if(m<=30000){ v = m/1000+50; cout<<v<<endl; }else if(m<=70000){ v = (m/1000-30)/5+80; cout<<v<<endl; }else{ v = 89; cout<<v<<endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - 視程の通報 |
User | ready_player074 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 2644 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 1 ms | 256 KB |
00_sample_02.txt | AC | 1 ms | 256 KB |
00_sample_03.txt | AC | 1 ms | 256 KB |
test_01.txt | AC | 1 ms | 256 KB |
test_02.txt | AC | 1 ms | 256 KB |
test_03.txt | AC | 1 ms | 256 KB |
test_04.txt | AC | 1 ms | 256 KB |
test_05.txt | AC | 1 ms | 256 KB |
test_06.txt | AC | 1 ms | 256 KB |
test_07.txt | AC | 1 ms | 256 KB |
test_08.txt | AC | 1 ms | 256 KB |
test_09.txt | AC | 1 ms | 256 KB |
test_10.txt | AC | 1 ms | 256 KB |
test_11.txt | AC | 1 ms | 256 KB |
test_12.txt | AC | 1 ms | 256 KB |
test_13.txt | AC | 1 ms | 256 KB |
test_14.txt | AC | 1 ms | 256 KB |
test_15.txt | AC | 1 ms | 256 KB |
test_16.txt | AC | 1 ms | 256 KB |
test_17.txt | AC | 1 ms | 256 KB |
test_18.txt | AC | 1 ms | 256 KB |
test_19.txt | AC | 1 ms | 256 KB |
test_20.txt | AC | 1 ms | 256 KB |
test_21.txt | AC | 1 ms | 256 KB |
test_22.txt | AC | 1 ms | 256 KB |
test_23.txt | AC | 1 ms | 256 KB |
test_24.txt | AC | 1 ms | 256 KB |
test_25.txt | AC | 1 ms | 256 KB |
test_26.txt | AC | 1 ms | 256 KB |
test_27.txt | AC | 1 ms | 256 KB |
test_28.txt | AC | 1 ms | 256 KB |
test_29.txt | AC | 1 ms | 256 KB |
test_30.txt | AC | 1 ms | 256 KB |
test_31.txt | AC | 1 ms | 256 KB |
test_32.txt | AC | 1 ms | 256 KB |
test_33.txt | AC | 1 ms | 256 KB |
test_34.txt | AC | 1 ms | 256 KB |
test_35.txt | AC | 1 ms | 256 KB |