Submission #3212409
Source Code Expand
#include <iostream> #include <cmath> #include <string> #include <algorithm> #include <set> #include <vector> #include <map> #include <list> #include <stack> #include <cstdio> #include <cstring> #include <cstdlib> #include <queue> #define pye cout << "yes" << endl #define pno cout << "no" << endl #define pYe cout << "Yes" << endl #define pNo cout << "No" << endl #define pYE cout << "YES" << endl #define pNO cout << "NO" << endl #define prin(num) cout << num << endl #define REP(i, n) for(i=0; i<n; i++) #define REPR(i, n) for(i=n; i>=0; i--) #define FOR(i, m, n) for(i=m; i<n; i++) #define max(a, b) ((a)>(b) ? (a):(b)) #define min(a, b) ((a)<(b) ? (a):(b)) #define INF 10000000000 #define MOD 1000000007LL #define MAX_V 100005 #define MAX_E 100005 #define NIL -1 #define WHITE 0 #define GRAY 1 #define BLACK 2 using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef priority_queue<P> PQ; class Edge { public: ll t, w; Edge (ll t, ll w): t(t), w(w) {} }; ll n, m; vector<Edge> G[MAX_V]; ll color[MAX_V]; ll d[MAX_V]; vector<ll> ans; void prim() { ll i, u; for(i=0; i<n; i++) { d[i]=INF; color[i]=WHITE; } priority_queue<P> PQ; PQ.push(P(0, 0)); d[0]=0; while(PQ.size()) { P f=PQ.top(); PQ.pop(); u=f.second; color[u]=BLACK; if(d[u]<f.first*(-1)) continue; for(i=0; i<G[u].size(); i++) { Edge e=G[u][i]; if(color[e.t]!=BLACK && d[e.t]>e.w) { d[e.t]=e.w; PQ.push(P(-d[e.t], e.t)); } } } ll tmp=0; for(i=0; i<n; i++) { tmp+=d[i]; } ans.push_back(tmp); } void add_edge(ll s, ll t, ll w) { G[s].push_back(Edge(t, w)); G[t].push_back(Edge(s, w)); } int main(void) { ll s, t; cin >> s >> t; cout << t-s+1 << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - アルバム |
User | eQe |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 1995 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 2688 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | sample_01.txt, sample_02.txt, case_01.txt, case_02.txt, case_03.txt, case_04.txt, case_05.txt, case_06.txt, case_07.txt, case_08.txt, case_09.txt, case_10.txt, case_11.txt, case_12.txt, case_13.txt, case_14.txt, case_15.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
case_01.txt | AC | 2 ms | 2560 KB |
case_02.txt | AC | 2 ms | 2560 KB |
case_03.txt | AC | 2 ms | 2560 KB |
case_04.txt | AC | 2 ms | 2560 KB |
case_05.txt | AC | 2 ms | 2560 KB |
case_06.txt | AC | 2 ms | 2560 KB |
case_07.txt | AC | 2 ms | 2560 KB |
case_08.txt | AC | 2 ms | 2560 KB |
case_09.txt | AC | 2 ms | 2688 KB |
case_10.txt | AC | 2 ms | 2560 KB |
case_11.txt | AC | 2 ms | 2560 KB |
case_12.txt | AC | 2 ms | 2560 KB |
case_13.txt | AC | 2 ms | 2560 KB |
case_14.txt | AC | 2 ms | 2560 KB |
case_15.txt | AC | 2 ms | 2560 KB |
sample_01.txt | AC | 2 ms | 2560 KB |
sample_02.txt | AC | 2 ms | 2560 KB |