Search is not available for this dataset
name
stringlengths
2
112
description
stringlengths
29
13k
source
int64
1
7
difficulty
int64
0
25
solution
stringlengths
7
983k
language
stringclasses
4 values
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner (System.in); int n = sc.nextInt(); int k = sc.nextInt(); System.out.println((int)Math.ceil((double)(n-1)/(k-1))); } }
JAVA
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
a=input().split();print(0--~-int(a[0])//~-int(a[1]))
PYTHON3
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; int W = K-1; int M = N-1; cout << (M+W-1)/W << endl; }
CPP
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
n,k = map(int,input().split()) l = list(map(int,input().split())) print(-(-(n-1)//(k-1)))
PYTHON3
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
#include<bits/stdc++.h> using namespace std; int main(){ int n,k; cin >> n >> k; cout << (n-1)/(k-1)+((n-1)%(k-1)>0) << endl; }
CPP
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } int count = 0; count++; n -= k; if (n % (k - 1) == 0) System.out.println(count + n / (k - 1)); else System.out.println(count + n / (k - 1) + 1); } }
JAVA
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
n,k=map(int,input().split());print(((n-2)//(k-1))+1)
PYTHON3
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
#include<iostream> using namespace std; int main() { int k,n;cin>>n>>k; cout<<(n-1+k-2)/(k-1)<<endl; }
CPP
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] map = new int[N]; int min = Integer.MAX_VALUE; int minIndex = N; for (int i = 0; i < N; i++) { int Ai = sc.nextInt(); min = Math.min(Ai, min); if (min == Ai) minIndex = i; } int right = (N - 1) - minIndex; int left = (N - 1) - right; int div = K - 1; int ans = (left / div) + (right / div); int amari = (left % div) + (right % div); ans += amari / div; ans += amari % div > 0 ? 1 : 0; System.out.println(ans); } }
JAVA
p03317 AtCoder Beginner Contest 101 - Minimization
There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. Constraints * 2 \leq K \leq N \leq 100000 * A_1, A_2, ..., A_N is a permutation of 1, 2, ..., N. Input Input is given from Standard Input in the following format: N K A_1 A_2 ... A_N Output Print the minimum number of operations required. Examples Input 4 3 2 3 1 4 Output 2 Input 3 3 1 2 3 Output 1 Input 8 3 7 3 1 8 4 6 2 5 Output 4
6
0
#include <bits/stdc++.h> int main() { int N, K; std::cin >> N >> K; std::cout << ((N - 1) + (K - 1) - 1) / (K - 1) << std::endl; return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
l = int(raw_input()) print 48 - l
PYTHON
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int M = sc.nextInt(); sc.close(); System.out.println(48-M); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include "bits/stdc++.h" using namespace std; int main(){ int x; cin >> x; cout << 48 - x << endl; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; // warm-up public class Main { static void solve() { Scanner sc = new Scanner(System.in); System.out.println(24-sc.nextInt()+24); sc.close(); } public static void main(String args[]) { solve(); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
M=int(input()) time=24-M print(time+24)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<cstdio> int main(){ int a; scanf("%d",&a); printf("%d",48-a); return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
print(48-int(input().strip()))
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<iostream> using namespace std; int a; int main() { cin>>a; cout<<48-a; return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <bits/stdc++.h> using namespace std; int main() { int h; cin >> h; cout << 48 - h; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
print(2 * 24 - int(input()))
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.* ; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); System.out.println(24-n+24) ; } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); System.out.println((24 - a) + 24); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <bits/stdc++.h> using namespace std; int main() { int M; // cin>>M; // cout<<48-M<<endl; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
M=input() M=int(M) N=24-M print(N+24)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
M=int(raw_input()) print 48-M
PYTHON
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<iostream> using namespace std; int main(){ int a; cin>>a; cout<<24+24-a; return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int m = sc.nextInt(); sc.close(); System.out.println(48 - m); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
M = int(input()) Time = 48 - M print(Time)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<stdio.h> int main() { int a; while(scanf("%d",&a)!=-1){ printf("%d\n",48-a);} }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#coding:utf-8 now = int(raw_input()) time = 48 - now print time
PYTHON
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
n = int(input()) print(24*2 - n)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
N = int(input()) print(24 - N + 24)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
n=int(input()) print(abs(n-24)+24)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int M = sc.nextInt(); System.out.println(48 - M); sc.close(); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
Year = 48 print(Year-int(input()))
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.println(48 - sc.nextInt()); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
M = int(input()) print(48-M)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
print 24-input()+24
PYTHON
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <stdio.h> int main() { int m; scanf("%d", &m); printf("%d\n", 24 + 24 - m); }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <bits/stdc++.h> using namespace std; int main() { int m; cin >> m; cout << 24 + 24 - m; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println(24-sc.nextInt()+24); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; cout << (24-a)+24; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<iostream> int main(){ int n; std::cin>>n; printf("%d",48-n); return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <cstdio> int main() { int x; scanf("%d", &x); printf("%d", 48 - x); return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int M = sc.nextInt(); int x; x = 48 - M; System.out.println(x); sc.close(); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <iostream> using namespace std; int main(){ int x; cin>>x; cout<<24-x+24; return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int m = Integer.parseInt(sc.nextLine()); System.out.println(24 - m + 24); sc.close(); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Main main=new Main(); main.run(); } void run() { Scanner sc=new Scanner(System.in); int m=sc.nextInt(); System.out.println(48-m); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <stdio.h> int main(){ int n; scanf("%d", &n); printf("%d\n", (24+(24-n))); }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { final Scanner sc = new Scanner(System.in); int n = sc.nextInt(); System.out.println(24+24-n); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <cstdio> int main() { int n; scanf("%d", &n); printf("%d\n", 48 - n); return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <iostream> using namespace std; int main() { int t; cin>>t; cout<<48-t; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.next(); int M = Integer.parseInt(s); int x = 48 - M; System.out.println(x); sc.close(); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; public class Main { static Scanner scanner = new Scanner(System.in); public static void main(String[]$) { System.out.println(48 - scanner.nextInt()); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <stdio.h> int main() { int hour; scanf("%d",&hour); printf("%d\n",48-hour); return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
a = input() a = 48 - a print a
PYTHON
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
m = int(raw_input()) print 24 - m + 24
PYTHON
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#!/usr/bin/python import sys def main(argv): line = sys.stdin.readline() while line: M = int(line.rstrip("\n")) print 24 - M + 24 line = sys.stdin.readline() if __name__ == "__main__": main(sys.argv)
PYTHON
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<stdio.h> int main(){ int n=0; scanf("%d",&n); printf("%d\n",48-n); }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<stdio.h> int main() { int n; scanf("%d",&n); printf("%d\n",24+(24-n)); }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
a=int(input()) b=24-a a=b+24 print(a)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
a = input() x = int(a) print(48-x)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
print(eval('48-'+input()))
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int M = sc.nextInt(); System.out.println((48-M)); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <bits/stdc++.h> using namespace std; int main() { int V; cin>>V; cout<<48-V<<endl; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
a=int(input()) print(int(24+(24-a)))
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
M = int(input()) X = 24 + (24-M) print(X)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int time = Integer.parseInt(sc.next()); time = 48 - time; System.out.println(time); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
# | Its_Rashid | # print(48 - int(input()))
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <iostream> using namespace std; int main(void){ int M; cin>>M; cout<<48-M<<endl; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
m = int(input()) x = (24 * 2) - m print(x)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
print("%d"%(48-int(input())))
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
m = int(input()) ny = 48-m print(ny)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int M = sc.nextInt(); System.out.println(24-M+24); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int M = scanner.nextInt(); System.out.println( 48 - M ); scanner.close(); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include <bits/stdc++.h> using namespace std; int main(){ int m; cin >> m; cout << (24-m)+24; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<stdio.h> int main(void){ int M,x; scanf("%d",&M); x=48-M; printf("%d",x); return 0; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<stdio.h> int main(void) { int M; scanf("%d", &M); printf("%d", 24 - M + 24); }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
p = int(input()) print(24 + (24 - p))
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
from pprint import pprint as pp def GI(): return int(raw_input()) def GIS(): return map(int, raw_input().split()) def main(): print(24 - GI() + 24) main()
PYTHON
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int hour = sc.nextInt(); System.out.println(24 - hour + 24); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
print (lambda x: 48-x)(input())
PYTHON
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in);) { solve(sc); } } public static void solve(Scanner sc) { int n = sc.nextInt(); System.out.println(24 - n + 24); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int input = sc.nextInt(); System.out.println(24 + (24 - input)); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); System.out.println(24 - num + 24); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; public class Main { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); System.out.println(48-a); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println(48-sc.nextInt()); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int m = scan.nextInt(); int res = 24 + (24 - m); System.out.println(res); scan.close(); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
m=int(input()) print(24+24-m)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int m = sc.nextInt(); System.out.print(48-m); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<iostream> using namespace std; int main() { int M; cin>>M; cout<<M+(24-M)*2<<endl; }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
m=int(input()) n=24-m print(n+24)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int m = sc.nextInt(); if(m>=1){ System.out.println(24-m+24); }else{ System.out.println(24-m+24); } } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#84a print(24+(24-int(input())))
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int M = Integer.parseInt(sc.next()); System.out.println(24 + (24 - M)); sc.close(); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<stdio.h> int main() { int n; while(~scanf("%d",&n)) { printf("%d\n",48-n); } }
CPP
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.*; public class Main { public static void main(String[] args){ //データ取り込み Scanner sc = new Scanner(System.in); //String S = sc.next(); //int B = sc.nextInt(); //System.out.println(); int N = sc.nextInt(); System.out.println(24+24-N); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
print(48-int(input())%24)
PYTHON3
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int x = s.nextInt(); System.out.println(24+(24-x)); } }
JAVA
p03473 AtCoder Beginner Contest 084 - New Year
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? Constraints * 1≤M≤23 * M is an integer. Input Input is given from Standard Input in the following format: M Output If we have x hours until New Year at M o'clock on 30th, December, print x. Examples Input 21 Output 27 Input 12 Output 36
6
0
#include<iostream> using namespace std; int main(){ int n; cin >> n; cout << (24-n)+24<<endl; }
CPP