Submission #4029976
Source Code Expand
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;++i) #define rrep(i,n) for(int i=n-1;i>=0;--i) #define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;} #define MAX_N 1002 #define i197 1000000007 using namespace std; typedef long long ll; typedef pair<ll,ll> P1; typedef pair<int,int> Pi; typedef pair<double,Pi> Pdi; typedef pair<ll,int>Pli; typedef pair<P1,ll> P2; const ll INF=1000000000000000001; struct edge{int to,cost;}; int dy[]={0, 0, 1, -1}; int dx[]={1, -1, 0, 0}; struct Road{double cost;int a,b;}; int main() { int n; int m=0,a=0; int b=0,c=0,d=0,e=0; cin>>n; m=n; if(m>=8){ m-=8; a++; b=1; } if(m>=4){ m-=4; a++; c=1; } if(m>=2){ m-=2; a++; d=1; } if(m>=1){ m-=1; a++; e=1; } cout<<a<<endl; if(b==1)cout<<"8"<<endl; if(c==1)cout<<"4"<<endl; if(d==1)cout<<"2"<<endl; if(e==1)cout<<"1"<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 足し算 |
User | akarinkof |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 942 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | subtask0_sample_01.txt, subtask0_sample_02.txt |
All | subtask0_sample_01.txt, subtask0_sample_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
subtask0_sample_01.txt | AC | 1 ms | 256 KB |
subtask0_sample_02.txt | AC | 1 ms | 256 KB |
subtask1_01.txt | AC | 1 ms | 256 KB |
subtask1_02.txt | AC | 1 ms | 256 KB |
subtask1_03.txt | AC | 1 ms | 256 KB |
subtask1_04.txt | AC | 1 ms | 256 KB |
subtask1_05.txt | AC | 1 ms | 256 KB |
subtask1_06.txt | AC | 1 ms | 256 KB |
subtask1_07.txt | AC | 1 ms | 256 KB |
subtask1_08.txt | AC | 1 ms | 256 KB |